Jethro85 commited on
Commit
69b933e
·
1 Parent(s): 4f57edc

Fix HF Space port: use

Browse files
Files changed (1) hide show
  1. run.py +14 -8
run.py CHANGED
@@ -13,12 +13,18 @@ if __name__ == '__main__':
13
  parser.add_argument("--host", type=str, default=os.getenv("HOST", "0.0.0.0"), help="Host to run the server on (default: 0.0.0.0)")
14
  args = parser.parse_args()
15
 
16
- # Enable debug mode for development
17
- app.config['DEBUG'] = True
18
- # Disable CORS in development
19
- app.config['CORS_HEADERS'] = 'Content-Type'
20
-
 
 
 
 
 
 
 
21
  print(f"Starting server on http://{args.host}:{args.port}")
22
-
23
- # Run the application with threaded=True for SSE streaming support
24
- app.run(host=args.host, port=args.port, debug=True, threaded=True)
 
13
  parser.add_argument("--host", type=str, default=os.getenv("HOST", "0.0.0.0"), help="Host to run the server on (default: 0.0.0.0)")
14
  args = parser.parse_args()
15
 
16
+ # # Enable debug mode for development
17
+ # app.config['DEBUG'] = True
18
+ # # Disable CORS in development
19
+ # app.config['CORS_HEADERS'] = 'Content-Type'
20
+ #
21
+ # print(f"Starting server on http://{args.host}:{args.port}")
22
+ #
23
+ # # Run the application with threaded=True for SSE streaming support
24
+ # app.run(host=args.host, port=args.port, debug=True, threaded=True)
25
+
26
+ args.port = int(os.environ.get("PORT", args.port))
27
+
28
  print(f"Starting server on http://{args.host}:{args.port}")
29
+
30
+ app.run(host=args.host, port=args.port, debug=False, threaded=True, use_reloader=False)