thadillo
Fix HF Spaces storage limit (50GB) error
e70b2c2
raw
history blame
632 Bytes
"""
Hugging Face Spaces entry point
This wraps the Flask app for Hugging Face deployment
"""
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)