Spaces:
Sleeping
Sleeping
Download run.py from Nausad/Data2Model: direct link, hf CLI and curl.
- Browser
- Download file 908 Bytes
-
https://huggingface.co/spaces/Nausad/Data2Model/resolve/main/run.py
- Command line
-
hf download hf://spaces/Nausad/Data2Model/run.py
-
curl -L -o run.py https://huggingface.co/spaces/Nausad/Data2Model/resolve/main/run.py
908 Bytes
| #!/usr/bin/env python3 | |
| """ | |
| Data2Model Run Script | |
| Easy way to start the application | |
| """ | |
| import os | |
| import sys | |
| def main(): | |
| print("=" * 60) | |
| print(" 🚀 Starting Data2Model Server") | |
| print("=" * 60) | |
| print() | |
| print("Server will start at: http://localhost:5000") | |
| print("Press Ctrl+C to stop the server") | |
| print() | |
| print("=" * 60) | |
| print() | |
| # Set environment variables | |
| os.environ['FLASK_APP'] = 'app.py' | |
| os.environ['FLASK_ENV'] = 'development' | |
| # Import and run the app | |
| try: | |
| from app import app | |
| app.run(debug=True, host='0.0.0.0', port=5000) | |
| except ImportError: | |
| print("❌ Error: Could not import app.py") | |
| print(" Make sure you're in the Data2Model directory") | |
| sys.exit(1) | |
| except KeyboardInterrupt: | |
| print("\n\n✅ Server stopped") | |
| sys.exit(0) | |
| if __name__ == "__main__": | |
| main() | |