Lin / app.py
Zelyanoth's picture
Update app.py
ca4914e verified
raw
history blame
726 Bytes
"""
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)