Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -156,11 +156,12 @@ async def load_model_data():
|
|
156 |
onnx_models = model_names # Populate onnx_models here
|
157 |
for config_name in config_names:
|
158 |
# Load the configuration data for each model (including speaker_id_map)
|
159 |
-
config = load_model_configuration(models_path, config_name)
|
160 |
-
|
|
|
161 |
|
162 |
def load_model_configuration(models_path, config_name):
|
163 |
-
# Assuming config_name is the
|
164 |
config_file_path = os.path.join(models_path, config_name)
|
165 |
|
166 |
try:
|
@@ -173,6 +174,7 @@ def load_model_configuration(models_path, config_name):
|
|
173 |
|
174 |
|
175 |
|
|
|
176 |
|
177 |
@app.post("/", response_class=HTMLResponse)
|
178 |
async def main(
|
|
|
156 |
onnx_models = model_names # Populate onnx_models here
|
157 |
for config_name in config_names:
|
158 |
# Load the configuration data for each model (including speaker_id_map)
|
159 |
+
config = load_model_configuration(models_path, config_name) # Pass config_name, not models_path
|
160 |
+
if config:
|
161 |
+
model_configurations[config_name] = config
|
162 |
|
163 |
def load_model_configuration(models_path, config_name):
|
164 |
+
# Assuming config_name is the name of the JSON configuration file, e.g., 'model.json'
|
165 |
config_file_path = os.path.join(models_path, config_name)
|
166 |
|
167 |
try:
|
|
|
174 |
|
175 |
|
176 |
|
177 |
+
|
178 |
|
179 |
@app.post("/", response_class=HTMLResponse)
|
180 |
async def main(
|