Spaces:
Build error
Build error
barghavani
commited on
Commit
·
26874b9
1
Parent(s):
a5b8ffc
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,6 @@ MODEL_INFO = [
|
|
23 |
|
24 |
# ... Add other models similarly
|
25 |
]
|
26 |
-
|
27 |
# Extract model names from MODEL_INFO
|
28 |
MODEL_NAMES = [info[0] for info in MODEL_INFO]
|
29 |
|
@@ -68,9 +67,7 @@ for info in MODEL_INFO:
|
|
68 |
|
69 |
# Download model and config files
|
70 |
model_files[model_name] = hf_hub_download(repo_id=repo_name, filename=model_file, use_auth_token=TOKEN)
|
71 |
-
|
72 |
config_files[model_name] = hf_hub_download(repo_id=repo_name, filename=config_file, use_auth_token=TOKEN)
|
73 |
-
|
74 |
|
75 |
# Download speakers.pth if it exists
|
76 |
if speaker_file:
|
@@ -127,7 +124,6 @@ def synthesize(text: str, model_name: str, speaker_name=None) -> str:
|
|
127 |
return fp.name
|
128 |
|
129 |
# Callback function to update UI based on the selected model
|
130 |
-
|
131 |
def update_options(model_name):
|
132 |
synthesizer = synthesizers[model_name]
|
133 |
# if synthesizer.tts.is_multi_speaker:
|
@@ -138,7 +134,7 @@ def update_options(model_name):
|
|
138 |
else:
|
139 |
# return empty options if not multi-speaker
|
140 |
return []
|
141 |
-
|
142 |
# Create Gradio interface
|
143 |
iface = gr.Interface(
|
144 |
fn=synthesize,
|
|
|
23 |
|
24 |
# ... Add other models similarly
|
25 |
]
|
|
|
26 |
# Extract model names from MODEL_INFO
|
27 |
MODEL_NAMES = [info[0] for info in MODEL_INFO]
|
28 |
|
|
|
67 |
|
68 |
# Download model and config files
|
69 |
model_files[model_name] = hf_hub_download(repo_id=repo_name, filename=model_file, use_auth_token=TOKEN)
|
|
|
70 |
config_files[model_name] = hf_hub_download(repo_id=repo_name, filename=config_file, use_auth_token=TOKEN)
|
|
|
71 |
|
72 |
# Download speakers.pth if it exists
|
73 |
if speaker_file:
|
|
|
124 |
return fp.name
|
125 |
|
126 |
# Callback function to update UI based on the selected model
|
|
|
127 |
def update_options(model_name):
|
128 |
synthesizer = synthesizers[model_name]
|
129 |
# if synthesizer.tts.is_multi_speaker:
|
|
|
134 |
else:
|
135 |
# return empty options if not multi-speaker
|
136 |
return []
|
137 |
+
|
138 |
# Create Gradio interface
|
139 |
iface = gr.Interface(
|
140 |
fn=synthesize,
|