Spaces:
Sleeping
Sleeping
ReverseCoder1 commited on
Commit ·
56be5a4
1
Parent(s): 512a43a
Add score 0 to 1 final
Browse files- inference.py +2 -2
- main.py +2 -2
inference.py
CHANGED
|
@@ -227,7 +227,7 @@ def run_task(
|
|
| 227 |
|
| 228 |
return {
|
| 229 |
"task_id": task_id,
|
| 230 |
-
"final_score": round(rewards[-1], 4) if rewards else 0.
|
| 231 |
"steps": step,
|
| 232 |
"rewards": rewards,
|
| 233 |
"actions": actions_taken,
|
|
@@ -261,7 +261,7 @@ def main():
|
|
| 261 |
print(f"[ERROR] Task {task_id} failed: {e}", file=sys.stderr)
|
| 262 |
all_results.append({
|
| 263 |
"task_id": task_id,
|
| 264 |
-
"final_score": 0.
|
| 265 |
"success": False,
|
| 266 |
"error": str(e)
|
| 267 |
})
|
|
|
|
| 227 |
|
| 228 |
return {
|
| 229 |
"task_id": task_id,
|
| 230 |
+
"final_score": round(rewards[-1], 4) if rewards else 0.0001,
|
| 231 |
"steps": step,
|
| 232 |
"rewards": rewards,
|
| 233 |
"actions": actions_taken,
|
|
|
|
| 261 |
print(f"[ERROR] Task {task_id} failed: {e}", file=sys.stderr)
|
| 262 |
all_results.append({
|
| 263 |
"task_id": task_id,
|
| 264 |
+
"final_score": 0.0001,
|
| 265 |
"success": False,
|
| 266 |
"error": str(e)
|
| 267 |
})
|
main.py
CHANGED
|
@@ -319,10 +319,10 @@ def submit_score(entry: Dict[str, Any]):
|
|
| 319 |
status_code=400,
|
| 320 |
detail=f"Missing field: {field}"
|
| 321 |
)
|
| 322 |
-
if not 0.0 <
|
| 323 |
raise HTTPException(
|
| 324 |
status_code=400,
|
| 325 |
-
detail="Score must be between 0.0 and 1.0"
|
| 326 |
)
|
| 327 |
leaderboard_data.append({
|
| 328 |
"model_name": entry["model_name"],
|
|
|
|
| 319 |
status_code=400,
|
| 320 |
detail=f"Missing field: {field}"
|
| 321 |
)
|
| 322 |
+
if not 0.0 < float(entry["score"]) < 1.0:
|
| 323 |
raise HTTPException(
|
| 324 |
status_code=400,
|
| 325 |
+
detail="Score must be strictly between 0.0 and 1.0 (not 0.0 or 1.0)"
|
| 326 |
)
|
| 327 |
leaderboard_data.append({
|
| 328 |
"model_name": entry["model_name"],
|