DPSGDTool / run.py
Jethro85
HF Space: Dockerized Flask app
1ebdc66
raw
history blame contribute delete
952 Bytes
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=5000, 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
app.run(host=args.host, port=args.port, debug=True)