Spaces:
Sleeping
Sleeping
Commit ·
ee96328
1
Parent(s): 347bcc3
debugged the task validation error
Browse files- app/__pycache__/grader.cpython-313.pyc +0 -0
- app/__pycache__/main.cpython-313.pyc +0 -0
- app/__pycache__/models.cpython-313.pyc +0 -0
- app/main.py +11 -0
- app/models.py +2 -2
app/__pycache__/grader.cpython-313.pyc
CHANGED
|
Binary files a/app/__pycache__/grader.cpython-313.pyc and b/app/__pycache__/grader.cpython-313.pyc differ
|
|
|
app/__pycache__/main.cpython-313.pyc
CHANGED
|
Binary files a/app/__pycache__/main.cpython-313.pyc and b/app/__pycache__/main.cpython-313.pyc differ
|
|
|
app/__pycache__/models.cpython-313.pyc
CHANGED
|
Binary files a/app/__pycache__/models.cpython-313.pyc and b/app/__pycache__/models.cpython-313.pyc differ
|
|
|
app/main.py
CHANGED
|
@@ -14,6 +14,7 @@ from app.models import (
|
|
| 14 |
StepRequest,
|
| 15 |
StepResult,
|
| 16 |
)
|
|
|
|
| 17 |
|
| 18 |
app = FastAPI(
|
| 19 |
title="Synapse Code Auditor",
|
|
@@ -45,6 +46,16 @@ def metadata() -> dict[str, Any]:
|
|
| 45 |
"name": app.title,
|
| 46 |
"description": app.description,
|
| 47 |
"version": app.version,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
|
| 50 |
|
|
|
|
| 14 |
StepRequest,
|
| 15 |
StepResult,
|
| 16 |
)
|
| 17 |
+
from app.tasks import TASKS
|
| 18 |
|
| 19 |
app = FastAPI(
|
| 20 |
title="Synapse Code Auditor",
|
|
|
|
| 46 |
"name": app.title,
|
| 47 |
"description": app.description,
|
| 48 |
"version": app.version,
|
| 49 |
+
"task_count": len(TASKS),
|
| 50 |
+
"tasks": [
|
| 51 |
+
{
|
| 52 |
+
"task_id": task.id,
|
| 53 |
+
"task_type": task.task_type,
|
| 54 |
+
"has_grader": True,
|
| 55 |
+
"criteria_count": len(task.criteria),
|
| 56 |
+
}
|
| 57 |
+
for task in TASKS.values()
|
| 58 |
+
],
|
| 59 |
}
|
| 60 |
|
| 61 |
|
app/models.py
CHANGED
|
@@ -23,7 +23,7 @@ class Action(BaseModel):
|
|
| 23 |
|
| 24 |
|
| 25 |
class Reward(BaseModel):
|
| 26 |
-
score: float = Field(
|
| 27 |
matched_criteria: list[str]
|
| 28 |
missed_criteria: list[str]
|
| 29 |
penalties: dict[str, float]
|
|
@@ -75,7 +75,7 @@ class TaskDefinition(BaseModel):
|
|
| 75 |
|
| 76 |
|
| 77 |
class GradeResult(BaseModel):
|
| 78 |
-
score: float
|
| 79 |
matched_criteria: list[str]
|
| 80 |
missed_criteria: list[str]
|
| 81 |
penalties: dict[str, float]
|
|
|
|
| 23 |
|
| 24 |
|
| 25 |
class Reward(BaseModel):
|
| 26 |
+
score: float = Field(gt=0.0, lt=1.0)
|
| 27 |
matched_criteria: list[str]
|
| 28 |
missed_criteria: list[str]
|
| 29 |
penalties: dict[str, float]
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
class GradeResult(BaseModel):
|
| 78 |
+
score: float = Field(gt=0.0, lt=1.0)
|
| 79 |
matched_criteria: list[str]
|
| 80 |
missed_criteria: list[str]
|
| 81 |
penalties: dict[str, float]
|