File size: 726 Bytes
fc8e8f2 ca4914e fc8e8f2 |
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 |
"""
Entry point for the Lin application on Hugging Face Spaces.
This file imports and runs the backend Flask application directly.
"""
import os
import sys
if __name__ == '__main__':
# Set the port for Hugging Face Spaces
port = os.environ.get('PORT', '7860')
os.environ.setdefault('PORT', port)
print(f"Starting Lin application on port {port}...")
try:
# Import and run the backend Flask app directly
from backend.app import create_app,config
app = create_app()
app.run(
host='0.0.0.0',
port=int(port),
debug=False
)
except Exception as e:
print(f"Failed to start Lin application: {e}")
sys.exit(1) |