Spaces:
Sleeping
Sleeping
Pranav Dhiran commited on
Commit ·
f9cce06
1
Parent(s): 0ece8e9
final 2 5
Browse files- app/environment.py +1 -1
- app/models.py +2 -1
- app/tasks/base.py +1 -1
- inference.py +3 -2
app/environment.py
CHANGED
|
@@ -66,7 +66,7 @@ class EnvironmentManager:
|
|
| 66 |
self._sessions: Dict[str, Session] = {}
|
| 67 |
|
| 68 |
@staticmethod
|
| 69 |
-
def _clamp_score_strict(score: float, eps: float = 1e-
|
| 70 |
"""
|
| 71 |
Hackathon validator requirement: task scores must be strictly within (0, 1).
|
| 72 |
We clamp away from exact endpoints to avoid returning 0.0 or 1.0.
|
|
|
|
| 66 |
self._sessions: Dict[str, Session] = {}
|
| 67 |
|
| 68 |
@staticmethod
|
| 69 |
+
def _clamp_score_strict(score: float, eps: float = 1e-3) -> float:
|
| 70 |
"""
|
| 71 |
Hackathon validator requirement: task scores must be strictly within (0, 1).
|
| 72 |
We clamp away from exact endpoints to avoid returning 0.0 or 1.0.
|
app/models.py
CHANGED
|
@@ -163,7 +163,8 @@ class GraderResponse(BaseModel):
|
|
| 163 |
"""Response from /grader endpoint."""
|
| 164 |
session_id: str
|
| 165 |
task_id: str
|
| 166 |
-
|
|
|
|
| 167 |
breakdown: Dict[str, float]
|
| 168 |
episode_complete: bool
|
| 169 |
steps_taken: int
|
|
|
|
| 163 |
"""Response from /grader endpoint."""
|
| 164 |
session_id: str
|
| 165 |
task_id: str
|
| 166 |
+
# Hackathon validator requires strictly within (0, 1).
|
| 167 |
+
score: float = Field(..., gt=0.0, lt=1.0)
|
| 168 |
breakdown: Dict[str, float]
|
| 169 |
episode_complete: bool
|
| 170 |
steps_taken: int
|
app/tasks/base.py
CHANGED
|
@@ -122,7 +122,7 @@ class BaseTask(ABC):
|
|
| 122 |
...
|
| 123 |
|
| 124 |
@staticmethod
|
| 125 |
-
def clamp_score_strict(score: float, eps: float = 1e-
|
| 126 |
"""
|
| 127 |
Hackathon validator requirement: scores must be strictly within (0, 1).
|
| 128 |
Use this at the end of task graders to avoid returning exactly 0.0 or 1.0.
|
|
|
|
| 122 |
...
|
| 123 |
|
| 124 |
@staticmethod
|
| 125 |
+
def clamp_score_strict(score: float, eps: float = 1e-3) -> float:
|
| 126 |
"""
|
| 127 |
Hackathon validator requirement: scores must be strictly within (0, 1).
|
| 128 |
Use this at the end of task graders to avoid returning exactly 0.0 or 1.0.
|
inference.py
CHANGED
|
@@ -128,7 +128,7 @@ def emit_block(tag: str, payload: dict):
|
|
| 128 |
safe_print(f"[{tag}] {line}")
|
| 129 |
|
| 130 |
|
| 131 |
-
def clamp_score_strict(score: float, eps: float = 1e-
|
| 132 |
"""
|
| 133 |
Hackathon validator requirement: scores must be strictly within (0, 1).
|
| 134 |
Clamp away from endpoints to avoid returning exactly 0.0 or 1.0.
|
|
@@ -662,7 +662,8 @@ def main():
|
|
| 662 |
"environment": "sre-incident-response",
|
| 663 |
"results": results,
|
| 664 |
"summary": {
|
| 665 |
-
|
|
|
|
| 666 |
"tasks_passed": passed,
|
| 667 |
"total_tasks": len(results),
|
| 668 |
"elapsed_seconds": round(elapsed, 1),
|
|
|
|
| 128 |
safe_print(f"[{tag}] {line}")
|
| 129 |
|
| 130 |
|
| 131 |
+
def clamp_score_strict(score: float, eps: float = 1e-3) -> float:
|
| 132 |
"""
|
| 133 |
Hackathon validator requirement: scores must be strictly within (0, 1).
|
| 134 |
Clamp away from endpoints to avoid returning exactly 0.0 or 1.0.
|
|
|
|
| 662 |
"environment": "sre-incident-response",
|
| 663 |
"results": results,
|
| 664 |
"summary": {
|
| 665 |
+
# Avoid rounding to 0.0/1.0; validator requires strict (0,1).
|
| 666 |
+
"mean_score": clamp_score_strict(mean_score),
|
| 667 |
"tasks_passed": passed,
|
| 668 |
"total_tasks": len(results),
|
| 669 |
"elapsed_seconds": round(elapsed, 1),
|