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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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(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:
@@ -171,6 +171,9 @@ def load_model_configuration(models_path, config_name):
171
  except FileNotFoundError:
172
  # Handle the case where the configuration file does not exist
173
  return None
 
 
 
174
 
175
 
176
 
 
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:
 
171
  except FileNotFoundError:
172
  # Handle the case where the configuration file does not exist
173
  return None
174
+ except IsADirectoryError:
175
+ # Handle the case where config_name is a directory (not a file)
176
+ return None
177
 
178
 
179