Update app.py
Browse files
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 |
-
|
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 |
|