ApsidalSolid4 commited on
Commit
f69e7ad
·
verified ·
1 Parent(s): 75a0240

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -497,17 +497,17 @@ demo = gr.Interface(
497
  app = demo.app
498
  app.add_middleware(
499
  CORSMiddleware,
500
- allow_origins=["*"], # For development - in production, specify exact domains
501
  allow_credentials=True,
502
- allow_methods=["*"],
503
  allow_headers=["*"],
504
  )
505
 
506
- # Launch the interface
507
  if __name__ == "__main__":
508
- demo.queue() # Enable queuing
509
  demo.launch(
510
- server_name="0.0.0.0", # Allow external connections
511
  server_port=7860,
512
- share=True # Don't use share since you're on Spaces
513
  )
 
497
  app = demo.app
498
  app.add_middleware(
499
  CORSMiddleware,
500
+ allow_origins=["*"], # For development
501
  allow_credentials=True,
502
+ allow_methods=["GET", "POST", "OPTIONS"], # Explicitly list methods
503
  allow_headers=["*"],
504
  )
505
 
506
+ # Ensure CORS is applied before launching
507
  if __name__ == "__main__":
508
+ demo.queue()
509
  demo.launch(
510
+ server_name="0.0.0.0",
511
  server_port=7860,
512
+ share=True
513
  )