Update app.py
Browse files
app.py
CHANGED
@@ -73,10 +73,22 @@ def gen_text(audio_filepath, action, source_lang, target_lang):
|
|
73 |
def gen_speech(text, lang):
|
74 |
set_seed(555) # Make it deterministic
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
# load TTS model
|
82 |
tts_model = VitsModel.from_pretrained(model)
|
|
|
73 |
def gen_speech(text, lang):
|
74 |
set_seed(555) # Make it deterministic
|
75 |
|
76 |
+
match lang:
|
77 |
+
case "en":
|
78 |
+
model = "facebook/mms-tts-eng"
|
79 |
+
case "fr":
|
80 |
+
model = "facebook/mms-tts-fra"
|
81 |
+
case "de":
|
82 |
+
model = "facebook/mms-tts-deu"
|
83 |
+
case "es":
|
84 |
+
model = "facebook/mms-tts-spa"
|
85 |
+
case _:
|
86 |
+
model = "facebook/mms-tts-eng"
|
87 |
+
|
88 |
+
# if lang=="en":
|
89 |
+
# model = "facebook/mms-tts-eng"
|
90 |
+
# elif lang=="fr":
|
91 |
+
# model = "facebook/mms-tts-fra"
|
92 |
|
93 |
# load TTS model
|
94 |
tts_model = VitsModel.from_pretrained(model)
|