Spaces:
Sleeping
Sleeping
Download app_hf.py from snehasis19/AbStrPred: direct link, hf CLI and curl.
- Browser
- Download file 686 Bytes
-
https://huggingface.co/spaces/snehasis19/AbStrPred/resolve/main/app_hf.py
- Command line
-
hf download hf://spaces/snehasis19/AbStrPred/app_hf.py
-
curl -L -o app_hf.py https://huggingface.co/spaces/snehasis19/AbStrPred/resolve/main/app_hf.py
686 Bytes
| # Wrapper for Hugging Face Spaces deployment | |
| # Import your original app and run it on port 7860 | |
| import os | |
| import sys | |
| # Add your original app path | |
| sys.path.insert(0, '/app') | |
| # Set environment for HF | |
| os.environ['FLASK_ENV'] = 'production' | |
| os.environ['FLASK_DEBUG'] = '0' | |
| try: | |
| # Try importing your main app | |
| from app import app | |
| except ImportError: | |
| try: | |
| from app_new import app | |
| except ImportError: | |
| print("ERROR: Could not import app.py or app_new.py") | |
| sys.exit(1) | |
| if __name__ == '__main__': | |
| # Run on 0.0.0.0:7860 (required for HF Spaces) | |
| app.run( | |
| host='0.0.0.0', | |
| port=7860, | |
| debug=False, | |
| threaded=True | |
| ) | |