Spaces:
Sleeping
Sleeping
Add app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Hugging Face Spaces entry point for FastAPI app.
|
| 3 |
+
This file is required for Hugging Face Spaces deployment.
|
| 4 |
+
"""
|
| 5 |
+
import os
|
| 6 |
+
import sys
|
| 7 |
+
|
| 8 |
+
# Add the app directory to the path
|
| 9 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 10 |
+
|
| 11 |
+
# Import the FastAPI app from app.main
|
| 12 |
+
from app.main import app
|
| 13 |
+
|
| 14 |
+
# The app will be served by Hugging Face Spaces automatically
|
| 15 |
+
if __name__ == "__main__":
|
| 16 |
+
import uvicorn
|
| 17 |
+
port = int(os.environ.get("PORT", 7860))
|
| 18 |
+
uvicorn.run(app, host="0.0.0.0", port=port)
|