|
""" |
|
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__': |
|
|
|
port = os.environ.get('PORT', '7860') |
|
os.environ.setdefault('PORT', port) |
|
|
|
print(f"Starting Lin application on port {port}...") |
|
|
|
try: |
|
|
|
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) |