Omnamdev02 commited on
Commit
2b743b1
·
unverified ·
1 Parent(s): 7e29aea

Change Flask app port configuration and disable debug

Browse files

Updated the Flask app to use environment variable for port and disabled debug mode.

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -490,8 +490,8 @@ if __name__ == '__main__':
490
  print("🔗 Access the application at: http://localhost:5000")
491
  print("💡 Using rule-based question generation for faster startup")
492
  print("⚡ System will initialize on first use")
493
-
494
  # Configure Flask for better timeout handling
495
  app.config['PERMANENT_SESSION_LIFETIME'] = 1800 # 30 minutes
496
 
497
- app.run(debug=True, host='0.0.0.0', port=5000, threaded=True)
 
 
490
  print("🔗 Access the application at: http://localhost:5000")
491
  print("💡 Using rule-based question generation for faster startup")
492
  print("⚡ System will initialize on first use")
 
493
  # Configure Flask for better timeout handling
494
  app.config['PERMANENT_SESSION_LIFETIME'] = 1800 # 30 minutes
495
 
496
+ port = int(os.environ.get("PORT", 7860)) # HF uses 7860
497
+ app.run(host="0.0.0.0", port=port, debug=False)