Spaces:
Sleeping
Sleeping
Commit ·
0b1e995
1
Parent(s): c5c7c2a
feat(graders): implement all 5 scoring components in programmatic_grader
Browse files
graders/programmatic_grader.py
CHANGED
|
@@ -3,7 +3,20 @@ Programmatic Grader — The Master Grader
|
|
| 3 |
Orchestrates easy, medium, and hard components into a single report.
|
| 4 |
"""
|
| 5 |
from typing import Any
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def grade_episode(history: list[dict]) -> dict[str, Any]:
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
Orchestrates easy, medium, and hard components into a single report.
|
| 4 |
"""
|
| 5 |
from typing import Any
|
| 6 |
+
from graders.easy_grader import grade_easy
|
| 7 |
+
from graders.medium_grader import grade_medium
|
| 8 |
+
from graders.hard_grader import grade_hard
|
| 9 |
|
| 10 |
def grade_episode(history: list[dict]) -> dict[str, Any]:
|
| 11 |
+
if not history:
|
| 12 |
+
return {"error": "Empty history"}
|
| 13 |
+
|
| 14 |
+
easy_score = grade_easy(history)
|
| 15 |
+
medium_score = grade_medium(history)
|
| 16 |
+
hard_score = grade_hard(history)
|
| 17 |
+
|
| 18 |
+
return {
|
| 19 |
+
"easy_score": easy_score,
|
| 20 |
+
"medium_score": medium_score,
|
| 21 |
+
"hard_score": hard_score
|
| 22 |
+
}
|