Spaces:
Sleeping
Sleeping
altawil
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -400,7 +400,7 @@ app = FastAPI(
|
|
| 400 |
)
|
| 401 |
|
| 402 |
# متغيرات عامة سيتم تهيئتها عند بدء التشغيل
|
| 403 |
-
MODEL:
|
| 404 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 405 |
SESSIONS: Dict[str, Dict] = {} # قاموس لتخزين حالة الجلسات النشطة
|
| 406 |
|
|
@@ -591,6 +591,6 @@ def end_session(session_id: str):
|
|
| 591 |
return {"message": f"Session {session_id} ended."}
|
| 592 |
raise HTTPException(status_code=404, detail="Session not found.")
|
| 593 |
# ================== تشغيل الخادم ==================
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
|
|
|
| 400 |
)
|
| 401 |
|
| 402 |
# متغيرات عامة سيتم تهيئتها عند بدء التشغيل
|
| 403 |
+
MODEL: InterfuserModel = None
|
| 404 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 405 |
SESSIONS: Dict[str, Dict] = {} # قاموس لتخزين حالة الجلسات النشطة
|
| 406 |
|
|
|
|
| 591 |
return {"message": f"Session {session_id} ended."}
|
| 592 |
raise HTTPException(status_code=404, detail="Session not found.")
|
| 593 |
# ================== تشغيل الخادم ==================
|
| 594 |
+
if __name__ == "__main__":
|
| 595 |
+
import uvicorn
|
| 596 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|