Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
-
from gradio import components
|
3 |
|
4 |
models = [
|
5 |
"models/stabilityai/stable-diffusion-xl-base-0.9",
|
@@ -20,7 +20,11 @@ models = [
|
|
20 |
def choose_model(model_name):
|
21 |
gr.Interface.load(model_name).launch()
|
22 |
|
23 |
-
model_dropdown =
|
24 |
interface = gr.Interface(fn=choose_model, inputs=model_dropdown, outputs=None)
|
25 |
-
interface.launch()
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
models = [
|
5 |
"models/stabilityai/stable-diffusion-xl-base-0.9",
|
|
|
20 |
def choose_model(model_name):
|
21 |
gr.Interface.load(model_name).launch()
|
22 |
|
23 |
+
model_dropdown = gr.inputs.Dropdown(models)
|
24 |
interface = gr.Interface(fn=choose_model, inputs=model_dropdown, outputs=None)
|
|
|
25 |
|
26 |
+
api_key = os.getenv("HUGGINGFACE_API_KEY")
|
27 |
+
if api_key:
|
28 |
+
interface.api_key = api_key
|
29 |
+
|
30 |
+
interface.launch()
|