Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,14 @@ import gradio as gr
|
|
3 |
from TTS.api import TTS
|
4 |
import os
|
5 |
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
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
|