Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
HuggingFace Spaces entry point for ChatCal.ai
|
| 3 |
+
v0.3.1 - Corrected for HF deployment
|
| 4 |
+
"""
|
| 5 |
+
import os
|
| 6 |
+
import uvicorn
|
| 7 |
+
|
| 8 |
+
# Set HF-specific environment variables
|
| 9 |
+
os.environ.setdefault("SESSION_BACKEND", "jwt")
|
| 10 |
+
os.environ.setdefault("APP_ENV", "production")
|
| 11 |
+
os.environ.setdefault("PORT", "7860")
|
| 12 |
+
|
| 13 |
+
if __name__ == "__main__":
|
| 14 |
+
# Change to the chatcal-ai directory where the app module is
|
| 15 |
+
os.chdir('/app/chatcal-ai')
|
| 16 |
+
|
| 17 |
+
# Run uvicorn with the correct module path
|
| 18 |
+
uvicorn.run(
|
| 19 |
+
"app.api.main:app",
|
| 20 |
+
host="0.0.0.0",
|
| 21 |
+
port=7860,
|
| 22 |
+
reload=False
|
| 23 |
+
)
|