Spaces:
Build error
Build error
Olivier-Truong
commited on
Commit
•
e111049
1
Parent(s):
5aae4b2
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import gradio as gr
|
|
7 |
from TTS.api import TTS
|
8 |
|
9 |
model_names = TTS().list_models()
|
10 |
-
m = model_names[1]
|
11 |
#for model in model_names:
|
12 |
# if model.find("/fr/") != -1:
|
13 |
# m = model
|
@@ -44,12 +44,19 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, agree):
|
|
44 |
None,
|
45 |
)
|
46 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
tts.tts_to_file(
|
48 |
text=prompt,
|
49 |
file_path="output.wav",
|
50 |
speaker_wav=speaker_wav,
|
51 |
language=language,
|
52 |
)
|
|
|
53 |
except RuntimeError as e :
|
54 |
if "device-assert" in str(e):
|
55 |
# cannot do anything on cuda device side error, need tor estart
|
|
|
7 |
from TTS.api import TTS
|
8 |
|
9 |
model_names = TTS().list_models()
|
10 |
+
m = "tts_models/fr/mai/tacotron2-DDC"#model_names[1]
|
11 |
#for model in model_names:
|
12 |
# if model.find("/fr/") != -1:
|
13 |
# m = model
|
|
|
44 |
None,
|
45 |
)
|
46 |
try:
|
47 |
+
tts.tts_to_file(
|
48 |
+
text=prompt,
|
49 |
+
file_path="output.wav",
|
50 |
+
speaker_wav=speaker_wav
|
51 |
+
)
|
52 |
+
"""
|
53 |
tts.tts_to_file(
|
54 |
text=prompt,
|
55 |
file_path="output.wav",
|
56 |
speaker_wav=speaker_wav,
|
57 |
language=language,
|
58 |
)
|
59 |
+
"""
|
60 |
except RuntimeError as e :
|
61 |
if "device-assert" in str(e):
|
62 |
# cannot do anything on cuda device side error, need tor estart
|