Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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")
|