Spaces:
Sleeping
Sleeping
I766446 commited on
Commit ·
f4683b4
1
Parent(s): f1e8d43
final2
Browse files
server.py
CHANGED
|
@@ -293,36 +293,20 @@ async def get_state_root():
|
|
| 293 |
|
| 294 |
@app.get("/tasks")
|
| 295 |
async def list_tasks():
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
grader
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
),
|
| 311 |
-
"n_scenarios": len(task),
|
| 312 |
-
"scenario_ids": [s["id"] for s in task.get_all_scenarios()],
|
| 313 |
-
"grader": f"tasks.{difficulty}.grader.grade",
|
| 314 |
-
"grader_fn": f"tasks.{difficulty}.grader.grade",
|
| 315 |
-
"score_range": [0.0, 1.0],
|
| 316 |
-
"grader_weights": {
|
| 317 |
-
"decision": grader.W_DECISION,
|
| 318 |
-
"evidence": grader.W_EVIDENCE,
|
| 319 |
-
"reasoning": grader.W_REASONING,
|
| 320 |
-
"efficiency": grader.W_EFFICIENCY,
|
| 321 |
-
},
|
| 322 |
-
})
|
| 323 |
-
except Exception as exc:
|
| 324 |
-
result.append({"id": difficulty, "error": str(exc)})
|
| 325 |
-
return result
|
| 326 |
|
| 327 |
|
| 328 |
@app.post("/collect", response_model=CollectResponse)
|
|
|
|
| 293 |
|
| 294 |
@app.get("/tasks")
|
| 295 |
async def list_tasks():
|
| 296 |
+
return [
|
| 297 |
+
{
|
| 298 |
+
"id": "easy",
|
| 299 |
+
"grader": "tasks.easy.grader.grade_episode"
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"id": "medium",
|
| 303 |
+
"grader": "tasks.medium.grader.grade_episode"
|
| 304 |
+
},
|
| 305 |
+
{
|
| 306 |
+
"id": "hard",
|
| 307 |
+
"grader": "tasks.hard.grader.grade_episode"
|
| 308 |
+
}
|
| 309 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
|
| 311 |
|
| 312 |
@app.post("/collect", response_model=CollectResponse)
|