Spaces:
Sleeping
Sleeping
| """ | |
| Hugging Face Spaces entry point | |
| This wraps the Flask app for Hugging Face deployment | |
| Copyright (c) 2024-2025 Marcos Thadeu Queiroz Magalhães (thadillo@gmail.com) | |
| Licensed under MIT License - See LICENSE file for details | |
| """ | |
| import os | |
| import sys | |
| from app import create_app | |
| # Run storage cleanup on startup to prevent 50GB limit errors | |
| try: | |
| from cleanup_storage import cleanup_storage | |
| print("Running storage cleanup...") | |
| cleanup_storage() | |
| print("Storage cleanup complete") | |
| except Exception as e: | |
| print(f"Warning: Storage cleanup failed: {e}") | |
| # Create Flask app | |
| app = create_app() | |
| # Hugging Face Spaces uses port 7860 | |
| if __name__ == "__main__": | |
| port = int(os.environ.get("PORT", 7860)) | |
| app.run(host="0.0.0.0", port=port, debug=False) | |