Gregniuki commited on
Commit
fbe764d
·
1 Parent(s): 0a5bbbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -142,8 +142,8 @@ def get_initial_values():
142
  return selected_model, selected_speaker_id
143
  @app.get("/get_speaker_id_map")
144
  async def get_speaker_id_map(selected_model: str):
145
- print("selected model",selected_model)
146
- config = model_configurations.get(selected_model)
147
  print("selectef config ",config)
148
  if config:
149
  speaker_id_map = config.get("speaker_id_map", {})
@@ -171,13 +171,13 @@ async def load_model_data():
171
  onnx_models = model_names # Populate onnx_models here
172
  print(config_names[0])
173
  print(model_names[0])
174
- for model_name in model_names:
175
- print(model_name)
176
  # Load the configuration data for each model (including speaker_id_map)
177
- config = load_model_configuration(models_path, model_name) # Pass config_name, not models_path
178
 
179
  if config:
180
- model_configurations[model_name] = config
181
 
182
  def load_model_configuration(models_path, config_name):
183
  # Assuming config_name is the name of the JSON configuration file, e.g., 'model.json'
 
142
  return selected_model, selected_speaker_id
143
  @app.get("/get_speaker_id_map")
144
  async def get_speaker_id_map(selected_model: str):
145
+ print("selected model",selected_model + ".json")
146
+ config = model_configurations.get(selected_model + ".json")
147
  print("selectef config ",config)
148
  if config:
149
  speaker_id_map = config.get("speaker_id_map", {})
 
171
  onnx_models = model_names # Populate onnx_models here
172
  print(config_names[0])
173
  print(model_names[0])
174
+ for config_name in config_names:
175
+ print(config_name)
176
  # Load the configuration data for each model (including speaker_id_map)
177
+ config = load_model_configuration(models_path, config_name) # Pass config_name, not models_path
178
 
179
  if config:
180
+ model_configurations[config_name] = config
181
 
182
  def load_model_configuration(models_path, config_name):
183
  # Assuming config_name is the name of the JSON configuration file, e.g., 'model.json'