ElectricAlexis commited on
Commit
6790c7a
·
verified ·
1 Parent(s): caf339e

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -464,9 +464,13 @@ with gr.Blocks(css=css) as demo:
464
  if __name__ == "__main__":
465
  # Check if running on Hugging Face Spaces
466
  if "SPACE_ID" in os.environ:
467
- # Running on HF Spaces - don't specify any server parameters
468
- # Let HF Spaces handle the networking configuration
469
- demo.launch()
 
 
 
 
470
  else:
471
  # Running locally - use custom server settings and share
472
  demo.launch(
 
464
  if __name__ == "__main__":
465
  # Check if running on Hugging Face Spaces
466
  if "SPACE_ID" in os.environ:
467
+ # Running on HF Spaces - use minimal configuration
468
+ demo.launch(
469
+ server_port=7860, # Match the port HF Spaces expects
470
+ share=False, # Explicitly disable sharing
471
+ debug=False, # Disable debug mode in production
472
+ show_error=True # Show detailed errors if they occur
473
+ )
474
  else:
475
  # Running locally - use custom server settings and share
476
  demo.launch(