Spaces:
Runtime error
Runtime error
Create run.py
Browse files
run.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Application entry point
|
| 3 |
+
"""
|
| 4 |
+
import os
|
| 5 |
+
from app import create_app
|
| 6 |
+
|
| 7 |
+
app = create_app()
|
| 8 |
+
|
| 9 |
+
if __name__ == "__main__":
|
| 10 |
+
port = int(os.getenv("PORT", 7860))
|
| 11 |
+
debug = os.getenv("FLASK_ENV") == "development"
|
| 12 |
+
|
| 13 |
+
print(f"π Starting Flask OpenAI Chat on port {port}")
|
| 14 |
+
print(f"π§ Debug mode: {debug}")
|
| 15 |
+
print(f"π Health check: http://localhost:{port}/health")
|
| 16 |
+
print(f"π¬ Chat endpoint: http://localhost:{port}/chat")
|
| 17 |
+
|
| 18 |
+
app.run(
|
| 19 |
+
host="0.0.0.0",
|
| 20 |
+
port=port,
|
| 21 |
+
debug=debug
|
| 22 |
+
)
|