Spaces:
Running
Running
feat: Fix selected space loading in app.py
Browse filesThis commit fixes the loading of the selected space in the `infer` function of `app.py`. The code now attempts to load the next available space from the list of spaces until a successful load is achieved, ensuring proper model loading and preventing errors during inference.
app.py
CHANGED
@@ -78,6 +78,7 @@ with gr.Blocks(css=css) as demo:
|
|
78 |
""")
|
79 |
space = gr.Text(
|
80 |
label="HF Space",
|
|
|
81 |
)
|
82 |
|
83 |
with gr.Row():
|
@@ -137,8 +138,8 @@ with gr.Blocks(css=css) as demo:
|
|
137 |
gr.Examples(
|
138 |
examples = examples,
|
139 |
fn = infer,
|
140 |
-
inputs = [prompt],
|
141 |
-
outputs = [result, seed],
|
142 |
cache_examples="lazy"
|
143 |
)
|
144 |
|
|
|
78 |
""")
|
79 |
space = gr.Text(
|
80 |
label="HF Space",
|
81 |
+
value=flux_1_schell_spaces[selected_space_index]
|
82 |
)
|
83 |
|
84 |
with gr.Row():
|
|
|
138 |
gr.Examples(
|
139 |
examples = examples,
|
140 |
fn = infer,
|
141 |
+
inputs = [selected_space_index, prompt],
|
142 |
+
outputs = [selected_space_index, space, result, seed],
|
143 |
cache_examples="lazy"
|
144 |
)
|
145 |
|