hephaestusonfire commited on
Commit
1b027f9
·
verified ·
1 Parent(s): f857211

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -495,5 +495,17 @@ with gr.Blocks(title="Writing Assistant", analytics_enabled=False) as demo:
495
  ########################################
496
 
497
  if __name__ == "__main__":
498
- demo.launch(server_name="127.0.0.1", server_port=7860,
499
- show_error=True, debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  ########################################
496
 
497
  if __name__ == "__main__":
498
+ import os
499
+ # HF Spaces requires 0.0.0.0; local dev uses 127.0.0.1
500
+ host = "0.0.0.0" if os.environ.get("SPACE_ID") else "127.0.0.1"
501
+ demo.launch(server_name=host, server_port=7860,
502
+ show_error=True, debug=False)
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+