Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -195,20 +195,20 @@ def load_model_configuration(models_path, config_name):
|
|
195 |
|
196 |
|
197 |
# Define a dependency function to get the selected_model and selected_speaker_id on startup
|
198 |
-
def get_initial_values() -> Tuple[str, str]:
|
199 |
# You can set default values or load them from a configuration file here
|
200 |
-
selected_model = onnx_models[0] if onnx_models else "default_model"
|
201 |
-
selected_speaker_id = "default_speaker_id" # Default value
|
202 |
|
203 |
# Check if there are onnx models and load the speaker_id_map from the first model's config
|
204 |
-
if onnx_models:
|
205 |
-
first_model_config = model_configurations.get(onnx_models[0])
|
206 |
-
if first_model_config:
|
207 |
-
speaker_id_map = first_model_config.get("speaker_id_map")
|
208 |
-
if speaker_id_map:
|
209 |
-
selected_speaker_id = next(iter(speaker_id_map)) # Get the first speaker_id
|
210 |
-
|
211 |
-
return selected_model, selected_speaker_id
|
212 |
|
213 |
|
214 |
|
|
|
195 |
|
196 |
|
197 |
# Define a dependency function to get the selected_model and selected_speaker_id on startup
|
198 |
+
#def get_initial_values() -> Tuple[str, str]:
|
199 |
# You can set default values or load them from a configuration file here
|
200 |
+
# selected_model = onnx_models[0] if onnx_models else "default_model"
|
201 |
+
# selected_speaker_id = "default_speaker_id" # Default value
|
202 |
|
203 |
# Check if there are onnx models and load the speaker_id_map from the first model's config
|
204 |
+
# if onnx_models:
|
205 |
+
# first_model_config = model_configurations.get(onnx_models[0])
|
206 |
+
# if first_model_config:
|
207 |
+
# speaker_id_map = first_model_config.get("speaker_id_map")
|
208 |
+
# if speaker_id_map:
|
209 |
+
# selected_speaker_id = next(iter(speaker_id_map)) # Get the first speaker_id
|
210 |
+
|
211 |
+
#return selected_model, selected_speaker_id
|
212 |
|
213 |
|
214 |
|