rayl-aoit commited on
Commit
99ac92b
1 Parent(s): e796a00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -4
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
- if lang=="en":
77
- model = "facebook/mms-tts-eng"
78
- elif lang=="fr":
79
- model = "facebook/mms-tts-fra"
 
 
 
 
 
 
 
 
 
 
 
 
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)