PoppyPepperPie2894 commited on
Commit
4eb9dcd
·
verified ·
1 Parent(s): 3895cef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -337,30 +337,29 @@ def api_analyze_stream():
337
  # ========================================
338
  # Main
339
  # ========================================
340
-
341
  if __name__ == '__main__':
 
342
  print()
343
  print("=" * 50)
344
  print(" SyncNet FCN - Web Interface")
345
  print("=" * 50)
346
  print()
347
- print(" Starting server...")
348
- print(" Open http://localhost:5000 in your browser")
 
 
 
 
 
349
  print()
350
  print(" Press Ctrl+C to stop")
351
  print("=" * 50)
352
  print()
353
-
354
  # Run Flask app
355
  app.run(
356
  host='0.0.0.0',
357
- port=5000,
358
  debug=False,
359
  threaded=True
360
- )
361
-
362
- # Production configuration
363
- if __name__ == '__main__':
364
- import os
365
- port = int(os.environ.get('PORT', 5000))
366
- app.run(host='0.0.0.0', port=port, debug=False)
 
337
  # ========================================
338
  # Main
339
  # ========================================
 
340
  if __name__ == '__main__':
341
+ # Print startup banner
342
  print()
343
  print("=" * 50)
344
  print(" SyncNet FCN - Web Interface")
345
  print("=" * 50)
346
  print()
347
+
348
+ # Get port from environment (Hugging Face uses 7860, Render uses 10000, Local uses 5000)
349
+ port = int(os.environ.get('PORT', 7860))
350
+
351
+ print(f" Starting server on port {port}...")
352
+ if port == 5000:
353
+ print(" Open http://localhost:5000 in your browser")
354
  print()
355
  print(" Press Ctrl+C to stop")
356
  print("=" * 50)
357
  print()
358
+
359
  # Run Flask app
360
  app.run(
361
  host='0.0.0.0',
362
+ port=port,
363
  debug=False,
364
  threaded=True
365
+ )