Spaces:
mashroo
/
Running on Zero

YoussefAnso commited on
Commit
0f57281
·
1 Parent(s): b43fc0b

Enhance Gradio interface by adding concurrency limits to button actions and updating SDK version to 4.44.1 for improved performance.

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +9 -3
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 📊
4
  colorFrom: gray
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 4.21.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: gray
5
  colorTo: red
6
  sdk: gradio
7
+ sdk_version: 4.44.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -268,18 +268,24 @@ with gr.Blocks() as demo:
268
  output_model,
269
  ]
270
 
271
- text_button.click(fn=check_input_image, inputs=[image_input]).success(
 
 
 
 
272
  fn=preprocess_image,
273
  inputs=[image_input, background_choice, foreground_ratio, back_groud_color],
274
  outputs=[processed_image],
 
275
  ).success(
276
  fn=gen_image,
277
  inputs=inputs,
278
  outputs=outputs,
 
279
  )
280
 
281
  # Launch the interface
282
- demo.queue(concurrency_count=1).launch(
283
  show_error=True,
284
- share=False
285
  )
 
268
  output_model,
269
  ]
270
 
271
+ text_button.click(
272
+ fn=check_input_image,
273
+ inputs=[image_input],
274
+ concurrency_limit=1
275
+ ).success(
276
  fn=preprocess_image,
277
  inputs=[image_input, background_choice, foreground_ratio, back_groud_color],
278
  outputs=[processed_image],
279
+ concurrency_limit=1
280
  ).success(
281
  fn=gen_image,
282
  inputs=inputs,
283
  outputs=outputs,
284
+ concurrency_limit=1
285
  )
286
 
287
  # Launch the interface
288
+ demo.launch(
289
  show_error=True,
290
+ max_threads=1
291
  )