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

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`. 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.

Files changed (1) hide show
  1. app.py +3 -2
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