Spaces:
Sleeping
Sleeping
Download run.py from doshibhavya/Imagify: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/spaces/doshibhavya/Imagify/resolve/main/run.py
- Command line
-
hf download hf://spaces/doshibhavya/Imagify/run.py
-
curl -L -o run.py https://huggingface.co/spaces/doshibhavya/Imagify/resolve/main/run.py
1.25 kB
| #!/usr/bin/env python3 | |
| """ | |
| ImagifyAI - Image to Story Generator | |
| Startup script for the application | |
| """ | |
| import os | |
| import sys | |
| from app import app | |
| def main(): | |
| print("π¨ ImagifyAI - Image to Story Generator") | |
| print("=" * 50) | |
| # Check if models directory exists | |
| if not os.path.exists('models'): | |
| print("β οΈ Models directory not found.") | |
| print("π₯ Please make sure you have the trained models in the 'models' folder") | |
| print("π‘ You can download pre-trained models or train your own") | |
| # Check requirements | |
| try: | |
| import torch | |
| import transformers | |
| import flask | |
| print("β All dependencies are available") | |
| except ImportError as e: | |
| print(f"β Missing dependency: {e}") | |
| print("π‘ Run: pip install -r requirements.txt") | |
| sys.exit(1) | |
| print("\nπ Starting server...") | |
| print("π Local: http://localhost:5000") | |
| print("π Network: http://0.0.0.0:5000") | |
| print("βΉοΈ Press Ctrl+C to stop the server\n") | |
| # Start Flask app | |
| port = int(os.environ.get('PORT', 5000)) | |
| app.run(debug=True, host='0.0.0.0', port=port) | |
| if __name__ == '__main__': | |
| main() | |