deekshachilukuri commited on
Commit
182c411
·
verified ·
1 Parent(s): 248e28b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -3,11 +3,14 @@ import gradio as gr
3
  from TTS.api import TTS
4
  import os
5
 
 
 
 
6
 
7
-
8
- # Assume that the TTS and its required setup are correctly configured similar to your script above
9
- device = "cuda:0" if torch.cuda.is_available() else "cpu"
10
- tts = TTS(model_name="tts_models/multilingual/multi-dataset/xtts_v2", progress_bar=False).to(device)
11
 
12
  def generate_voice(text, audio_file_path):
13
  output_path = "/content/cloned_audio.wav" # Setting the output path
 
3
  from TTS.api import TTS
4
  import os
5
 
6
+ # Function to always return 'y'
7
+ def always_yes(*args, **kwargs):
8
+ return 'y'
9
 
10
+ # Patch the input function to always return 'y'
11
+ with patch('builtins.input', always_yes):
12
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
13
+ tts = TTS(model_name="tts_models/multilingual/multi-dataset/xtts_v2", progress_bar=False).to(device)
14
 
15
  def generate_voice(text, audio_file_path):
16
  output_path = "/content/cloned_audio.wav" # Setting the output path