mhrahmani commited on
Commit
94d56ad
·
1 Parent(s): 4712ee3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -32,6 +32,9 @@ def synthesize(text: str, model_name: str) -> str:
32
  text = text[:MAX_TXT_LEN]
33
  print(f"Input text was cut off as it exceeded the {MAX_TXT_LEN} character limit.")
34
 
 
 
 
35
  synthesizer = Synthesizer(f"{model_name}/{model_file}", f"{model_name}/{config_file}")
36
  if synthesizer is None:
37
  raise NameError("Model not found")
 
32
  text = text[:MAX_TXT_LEN]
33
  print(f"Input text was cut off as it exceeded the {MAX_TXT_LEN} character limit.")
34
 
35
+ # Extract model_file and config_file based on the model_name
36
+ model_file, config_file = next((model_file, config_file) for name, model_file, config_file, _ in MODEL_INFO if name == model_name)
37
+
38
  synthesizer = Synthesizer(f"{model_name}/{model_file}", f"{model_name}/{config_file}")
39
  if synthesizer is None:
40
  raise NameError("Model not found")