| #!/usr/bin/env python | |
| """ | |
| Entry point for the Lin application. | |
| This is an alternative entry point that can be used if needed. | |
| """ | |
| 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 | |
| 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) |