Spaces:
Configuration error
Configuration error
ychanakya12 commited on
Commit Β·
185b1f3
1
Parent(s): c1cd746
Clamp score in inference.py [END] line and all graders - strictly (0.01, 0.99)
Browse files- inference.py +3 -1
inference.py
CHANGED
|
@@ -262,7 +262,9 @@ def run_task(client: OpenAI, task_id: str) -> float:
|
|
| 262 |
print(f" Reached max steps ({MAX_STEPS}).")
|
| 263 |
|
| 264 |
# ββ Grade βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 265 |
-
|
|
|
|
|
|
|
| 266 |
print(f"[END] Task: {task_id} | Score: {final_score:.4f} | Total Reward: {total_reward:.4f}")
|
| 267 |
return final_score
|
| 268 |
|
|
|
|
| 262 |
print(f" Reached max steps ({MAX_STEPS}).")
|
| 263 |
|
| 264 |
# ββ Grade βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 265 |
+
raw_score = env.grade()
|
| 266 |
+
# OpenEnv requirement: scores must be strictly in (0.0, 1.0)
|
| 267 |
+
final_score = max(0.01, min(0.99, raw_score))
|
| 268 |
print(f"[END] Task: {task_id} | Score: {final_score:.4f} | Total Reward: {total_reward:.4f}")
|
| 269 |
return final_score
|
| 270 |
|