Gregniuki commited on
Commit
f1b3895
·
1 Parent(s): 691f5ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -118,7 +118,7 @@ class Translator:
118
  lan = Translator()
119
  def detect_onnx_models(path):
120
  onnx_models = glob.glob(path + '/*.onnx')
121
- onnx_configs = glob.glob('*.json')
122
  if len(onnx_models) > 1:
123
  return onnx_models, onnx_configs # Return both lists as a tuple
124
  elif len(onnx_models) == 1:
@@ -157,12 +157,13 @@ async def load_model_data():
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:
168
  with open(config_file_path, 'r') as config_file:
 
118
  lan = Translator()
119
  def detect_onnx_models(path):
120
  onnx_models = glob.glob(path + '/*.onnx')
121
+ onnx_configs = glob.glob(path + /'*.json')
122
  if len(onnx_models) > 1:
123
  return onnx_models, onnx_configs # Return both lists as a tuple
124
  elif len(onnx_models) == 1:
 
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
+ print(config_name)
161
  if config:
162
  model_configurations[config_name] = config
163
 
164
  def load_model_configuration(models_path, config_name):
165
  # Assuming config_name is the name of the JSON configuration file, e.g., 'model.json'
166
+ config_file_path = os.path.join("", config_name)
167
 
168
  try:
169
  with open(config_file_path, 'r') as config_file: