File size: 1,214 Bytes
6640531 8ad5d56 b0b2c21 6640531 b0b2c21 4f57edc b0b2c21 b9a3c66 69b933e b0b2c21 69b933e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
from app import create_app
import os
import sys
import argparse
app = create_app()
if __name__ == '__main__':
# Parse command line arguments
parser = argparse.ArgumentParser(description='Run DP-SGD Explorer')
parser.add_argument('--port', type=int, default=7860, help='Port to run the server on (default: 5000)')
# parser.add_argument('--host', type=str, default='127.0.0.1', help='Host to run the server on (default: 127.0.0.1)')
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)")
args = parser.parse_args()
# # Enable debug mode for development
# app.config['DEBUG'] = True
# # Disable CORS in development
# app.config['CORS_HEADERS'] = 'Content-Type'
#
# print(f"Starting server on http://{args.host}:{args.port}")
#
# # Run the application with threaded=True for SSE streaming support
# app.run(host=args.host, port=args.port, debug=True, threaded=True)
args.port = int(os.environ.get("PORT", args.port))
print(f"Starting server on http://{args.host}:{args.port}")
app.run(host=args.host, port=args.port, debug=False, threaded=True, use_reloader=False) |