Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -132,6 +132,7 @@ async def main(
|
|
132 |
elif isinstance(onnx_models, str):
|
133 |
onnx_model = onnx_models
|
134 |
model, config = load_onnx(onnx_model, sess_options, providers)
|
|
|
135 |
if config["num_speakers"] > 1:
|
136 |
speaker_selection.options = config["speaker_id_map"].values()
|
137 |
speaker_selection.layout.visibility = 'visible'
|
@@ -155,11 +156,11 @@ async def main(
|
|
155 |
# )
|
156 |
# config = None
|
157 |
# def load_model(button):
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
onnx_model = f"{models_path}/{selected_voice}"
|
164 |
model, config = load_onnx(onnx_model, sess_options, providers)
|
165 |
# if enhanced_accessibility:
|
|
|
132 |
elif isinstance(onnx_models, str):
|
133 |
onnx_model = onnx_models
|
134 |
model, config = load_onnx(onnx_model, sess_options, providers)
|
135 |
+
print("nuber of speakers = ", config["num_speakers"])
|
136 |
if config["num_speakers"] > 1:
|
137 |
speaker_selection.options = config["speaker_id_map"].values()
|
138 |
speaker_selection.layout.visibility = 'visible'
|
|
|
156 |
# )
|
157 |
# config = None
|
158 |
# def load_model(button):
|
159 |
+
nonlocal config
|
160 |
+
global onnx_model
|
161 |
+
nonlocal model
|
162 |
+
nonlocal models_path
|
163 |
+
selected_voice = selection.value
|
164 |
onnx_model = f"{models_path}/{selected_voice}"
|
165 |
model, config = load_onnx(onnx_model, sess_options, providers)
|
166 |
# if enhanced_accessibility:
|