soiz commited on
Commit
f477a0b
1 Parent(s): e05fc54

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -21,10 +21,13 @@ def load_fn(models):
21
  for model in models:
22
  if model not in models_load.keys():
23
  try:
24
- m = gr.load(f'models/{model}')
 
 
25
  except Exception as error:
 
26
  m = gr.Interface(lambda txt: None, ['text'], ['image'])
27
- models_load.update({model: m})
28
 
29
  load_fn(models)
30
 
 
21
  for model in models:
22
  if model not in models_load.keys():
23
  try:
24
+ m = gr.Interface.load(f'models/{model}')
25
+ models_load[model] = m
26
+ print(f"Loaded model: {model}")
27
  except Exception as error:
28
+ print(f"Error loading model {model}: {error}")
29
  m = gr.Interface(lambda txt: None, ['text'], ['image'])
30
+ models_load[model] = m
31
 
32
  load_fn(models)
33