Spaces:
Paused
Paused
HanningChen
commited on
Commit
·
5c95a37
1
Parent(s):
eb5ae20
Fix bug
Browse files- webui/app.py +18 -0
webui/app.py
CHANGED
|
@@ -210,6 +210,24 @@ def index(request: Request):
|
|
| 210 |
def root():
|
| 211 |
return {"ok": True, "message": "Backend is running. Use POST /api/run and open /docs."}
|
| 212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
@app.post("/api/run")
|
| 214 |
async def api_run(
|
| 215 |
request: Request,
|
|
|
|
| 210 |
def root():
|
| 211 |
return {"ok": True, "message": "Backend is running. Use POST /api/run and open /docs."}
|
| 212 |
|
| 213 |
+
@app.get("/api/meta")
|
| 214 |
+
def api_meta():
|
| 215 |
+
task_ids = runner.list_task_ids()
|
| 216 |
+
task_items = [(tid, runner.id2task_name.get(str(tid), f"task_{tid}")) for tid in task_ids]
|
| 217 |
+
return {
|
| 218 |
+
"vlm_choices": VLM_CHOICES,
|
| 219 |
+
"od_choices": OD_CHOICES,
|
| 220 |
+
"hdv_dims": HDV_DIMS,
|
| 221 |
+
"score_funcs": SCORE_FUNCS,
|
| 222 |
+
"defaults": {
|
| 223 |
+
"vlm": DEFAULT_VLM,
|
| 224 |
+
"od": DEFAULT_OD,
|
| 225 |
+
"hdv_dim": DEFAULT_HDV,
|
| 226 |
+
"score_func": DEFAULT_SCORE_FUNC,
|
| 227 |
+
},
|
| 228 |
+
"task_items": task_items,
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
@app.post("/api/run")
|
| 232 |
async def api_run(
|
| 233 |
request: Request,
|