charliebaby2023 commited on
Commit
f14dcc3
Β·
verified Β·
1 Parent(s): ca4c542

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -22,8 +22,13 @@ def load_fn(models):
22
  try:
23
  m = gr.load(f'models/{model}')
24
  except Exception as error:
25
- m = gr.Interface(lambda txt: None, ['text'], ['image'])
26
- models_load.update({model: m})
 
 
 
 
 
27
 
28
  load_fn(models)
29
 
 
22
  try:
23
  m = gr.load(f'models/{model}')
24
  except Exception as error:
25
+ print(f"Error loading model {model}: {error}")
26
+ return gr.Interface(
27
+ fn=lambda txt: f"Failed to load model {model}.",
28
+ inputs=gr.Textbox(label="Input Prompt"),
29
+ outputs=gr.Textbox(label="Output"),
30
+ )
31
+
32
 
33
  load_fn(models)
34