Spaces:
mashroo
/
Running on Zero

YoussefAnso commited on
Commit
d8bbedc
·
1 Parent(s): b96430e

Remove API endpoint name from event listener and disable sharing option in Gradio interface, while maintaining concurrency limits for improved performance.

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -262,7 +262,7 @@ with gr.Blocks(analytics_enabled=False) as demo: # Disable analytics to reduce
262
  processed = preprocess_image(image, bg_choice, fg_ratio, bg_color)
263
  return gen_image(processed, seed_val, guidance, steps)
264
 
265
- # Use concurrency_limit on the event listener instead of queue
266
  text_button.click(
267
  fn=generate,
268
  inputs=[
@@ -279,7 +279,6 @@ with gr.Blocks(analytics_enabled=False) as demo: # Disable analytics to reduce
279
  xyz_output,
280
  output_model
281
  ],
282
- api_name="generate", # Give the endpoint a specific name
283
  concurrency_limit=1 # Set concurrency limit directly on the event listener
284
  )
285
 
@@ -287,7 +286,6 @@ with gr.Blocks(analytics_enabled=False) as demo: # Disable analytics to reduce
287
  demo.launch(
288
  server_name="0.0.0.0", # Allow external access
289
  server_port=7860, # Use the standard Gradio port
290
- share=True, # Required for Hugging Face Spaces
291
  show_error=True,
292
  max_threads=1 # Control total number of workers
293
  )
 
262
  processed = preprocess_image(image, bg_choice, fg_ratio, bg_color)
263
  return gen_image(processed, seed_val, guidance, steps)
264
 
265
+ # Use concurrency_limit on the event listener and remove api_name
266
  text_button.click(
267
  fn=generate,
268
  inputs=[
 
279
  xyz_output,
280
  output_model
281
  ],
 
282
  concurrency_limit=1 # Set concurrency limit directly on the event listener
283
  )
284
 
 
286
  demo.launch(
287
  server_name="0.0.0.0", # Allow external access
288
  server_port=7860, # Use the standard Gradio port
 
289
  show_error=True,
290
  max_threads=1 # Control total number of workers
291
  )