Spaces:
Sleeping
Sleeping
Commit ·
f787811
1
Parent(s): a9c6a15
fix: add main() to server/app.py
Browse files- server/app.py +7 -4
server/app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
"""
|
| 2 |
-
|
| 3 |
-
Endpoints: POST /reset, POST /step, GET /state, GET /health, GET /tasks
|
| 4 |
"""
|
| 5 |
|
| 6 |
import sys
|
|
@@ -9,7 +8,6 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
| 9 |
|
| 10 |
from fastapi import FastAPI, Request, HTTPException
|
| 11 |
from fastapi.middleware.cors import CORSMiddleware
|
| 12 |
-
from pydantic import BaseModel
|
| 13 |
from typing import Optional
|
| 14 |
import uvicorn
|
| 15 |
|
|
@@ -99,5 +97,10 @@ def root():
|
|
| 99 |
"tasks": list(TASK_CONFIGS.keys()),
|
| 100 |
}
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
if __name__ == "__main__":
|
| 103 |
-
|
|
|
|
| 1 |
"""
|
| 2 |
+
server/app.py - OpenEnv entry point for multi-mode deployment.
|
|
|
|
| 3 |
"""
|
| 4 |
|
| 5 |
import sys
|
|
|
|
| 8 |
|
| 9 |
from fastapi import FastAPI, Request, HTTPException
|
| 10 |
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
| 11 |
from typing import Optional
|
| 12 |
import uvicorn
|
| 13 |
|
|
|
|
| 97 |
"tasks": list(TASK_CONFIGS.keys()),
|
| 98 |
}
|
| 99 |
|
| 100 |
+
|
| 101 |
+
def main():
|
| 102 |
+
uvicorn.run("server.app:app", host="0.0.0.0", port=7860, reload=False)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
if __name__ == "__main__":
|
| 106 |
+
main()
|