Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,21 +20,20 @@ model_list = [
|
|
| 20 |
]
|
| 21 |
|
| 22 |
default_model = "stabilityai/stable-diffusion-2"
|
| 23 |
-
model_name = gr.
|
| 24 |
model = None
|
| 25 |
|
| 26 |
def load_model(model_name):
|
| 27 |
global model
|
| 28 |
-
model = gr.
|
| 29 |
|
| 30 |
def predict(inputs):
|
| 31 |
return model.predict(inputs)
|
| 32 |
|
| 33 |
iface = gr.Interface(
|
| 34 |
fn=predict,
|
| 35 |
-
inputs=
|
| 36 |
outputs="text",
|
| 37 |
-
capture_session=True,
|
| 38 |
title="Model Selection App",
|
| 39 |
description="Choose a model and input data to make predictions."
|
| 40 |
)
|
|
|
|
| 20 |
]
|
| 21 |
|
| 22 |
default_model = "stabilityai/stable-diffusion-2"
|
| 23 |
+
model_name = gr.outputs.Dropdown(model_list, label="Select Model", default=default_model)
|
| 24 |
model = None
|
| 25 |
|
| 26 |
def load_model(model_name):
|
| 27 |
global model
|
| 28 |
+
model = gr.load(model_name, api_key=api_key)
|
| 29 |
|
| 30 |
def predict(inputs):
|
| 31 |
return model.predict(inputs)
|
| 32 |
|
| 33 |
iface = gr.Interface(
|
| 34 |
fn=predict,
|
| 35 |
+
inputs=model_name,
|
| 36 |
outputs="text",
|
|
|
|
| 37 |
title="Model Selection App",
|
| 38 |
description="Choose a model and input data to make predictions."
|
| 39 |
)
|