File size: 769 Bytes
23654e5
 
 
67d3f72
 
 
23654e5
 
e70b2c2
23654e5
 
e70b2c2
 
 
 
 
 
 
 
 
23654e5
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
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)