Lisandro commited on
Commit
6115825
·
1 Parent(s): b3fc20d

feat: Fix selected space loading in app.py

Browse files

This commit fixes the loading of the selected space in the `infer` function of `app.py`. Previously, the code was not properly handling the case when the selected space failed to load. The updated code now attempts to load the next available space from the list of spaces until a successful load is achieved. This ensures that the model is properly loaded and prevents any errors from occurring during inference.

Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -76,12 +76,11 @@ with gr.Blocks(css=css) as demo:
76
  12B param rectified flow transformer distilled from [FLUX.1 [pro]](https://blackforestlabs.ai/) for 4 step generation
77
  [[blog](https://blackforestlabs.ai/2024/07/31/announcing-black-forest-labs/)] [[model](https://huggingface.co/black-forest-labs/FLUX.1-schnell)]
78
  """)
 
 
 
79
 
80
  with gr.Row():
81
- space = gr.Text(
82
- label="HF Space",
83
- )
84
-
85
  prompt = gr.Text(
86
  label="Prompt",
87
  show_label=False,
 
76
  12B param rectified flow transformer distilled from [FLUX.1 [pro]](https://blackforestlabs.ai/) for 4 step generation
77
  [[blog](https://blackforestlabs.ai/2024/07/31/announcing-black-forest-labs/)] [[model](https://huggingface.co/black-forest-labs/FLUX.1-schnell)]
78
  """)
79
+ space = gr.Text(
80
+ label="HF Space",
81
+ )
82
 
83
  with gr.Row():
 
 
 
 
84
  prompt = gr.Text(
85
  label="Prompt",
86
  show_label=False,