Zelyanoth commited on
Commit
fc8e8f2
·
verified ·
1 Parent(s): b36b7f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -1
app.py CHANGED
@@ -1 +1,26 @@
1
- import fast
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Entry point for the Lin application on Hugging Face Spaces.
3
+ This file imports and runs the backend Flask application directly.
4
+ """
5
+ import os
6
+ import sys
7
+
8
+ if __name__ == '__main__':
9
+ # Set the port for Hugging Face Spaces
10
+ port = os.environ.get('PORT', '7860')
11
+ os.environ.setdefault('PORT', port)
12
+
13
+ print(f"Starting Lin application on port {port}...")
14
+
15
+ try:
16
+ # Import and run the backend Flask app directly
17
+ from backend.app import create_app
18
+ app = create_app()
19
+ app.run(
20
+ host='0.0.0.0',
21
+ port=int(port),
22
+ debug=False
23
+ )
24
+ except Exception as e:
25
+ print(f"Failed to start Lin application: {e}")
26
+ sys.exit(1)