Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from random import randint
|
3 |
from all_models import models
|
4 |
|
5 |
-
|
6 |
|
7 |
def load_fn(models):
|
8 |
global models_load
|
@@ -11,7 +11,7 @@ def load_fn(models):
|
|
11 |
for model in models:
|
12 |
if model not in models_load.keys():
|
13 |
try:
|
14 |
-
m =
|
15 |
except Exception as error:
|
16 |
m = gr.Interface(lambda txt: None, ['text'], ['image'])
|
17 |
models_load.update({model: m})
|
@@ -119,5 +119,5 @@ with gr.Blocks() as demo:
|
|
119 |
"""
|
120 |
)
|
121 |
|
122 |
-
demo.queue(
|
123 |
demo.launch()
|
|
|
2 |
from random import randint
|
3 |
from all_models import models
|
4 |
|
5 |
+
from externalmod import gr_Interface_load
|
6 |
|
7 |
def load_fn(models):
|
8 |
global models_load
|
|
|
11 |
for model in models:
|
12 |
if model not in models_load.keys():
|
13 |
try:
|
14 |
+
m = gr_Interface_load(f'models/{model}')
|
15 |
except Exception as error:
|
16 |
m = gr.Interface(lambda txt: None, ['text'], ['image'])
|
17 |
models_load.update({model: m})
|
|
|
119 |
"""
|
120 |
)
|
121 |
|
122 |
+
demo.queue()
|
123 |
demo.launch()
|