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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -22,12 +22,9 @@ def load_fn(models):
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)
 
22
  try:
23
  m = gr.load(f'models/{model}')
24
  except Exception as error:
25
+ print(f"Error loading model {model}: {error}")
26
+ # Fallback to a dummy interface with valid components
27
+ m = gr.Interface(lambda txt: None, inputs=gr.Textbox(), outputs=gr.Image())
 
 
 
28
 
29
 
30
  load_fn(models)