Commit ·
2103d91
1
Parent(s): bc8710c
Fix reward formatting in inference.py
Browse files- inference.py +2 -2
inference.py
CHANGED
|
@@ -75,12 +75,12 @@ def run_llm(task_id):
|
|
| 75 |
action_str = action.model_dump_json() if hasattr(action, 'model_dump_json') else json.dumps(action.__dict__)
|
| 76 |
action_str = action_str.replace(" ", "")
|
| 77 |
|
| 78 |
-
print(f"[STEP] step={i+1} action={action_str} reward={reward:.2f} done={str(done).lower()} error=null", flush=True)
|
| 79 |
if done:
|
| 80 |
break
|
| 81 |
|
| 82 |
score = grade_task(task, taken)
|
| 83 |
-
rewards_str = ",".join(f"{r:.2f}" for r in rewards)
|
| 84 |
success = score >= 0.5
|
| 85 |
print(f"[END] success={str(success).lower()} steps={len(taken)} score={score:.3f} rewards={rewards_str}", flush=True)
|
| 86 |
return score
|
|
|
|
| 75 |
action_str = action.model_dump_json() if hasattr(action, 'model_dump_json') else json.dumps(action.__dict__)
|
| 76 |
action_str = action_str.replace(" ", "")
|
| 77 |
|
| 78 |
+
print(f"[STEP] step={i+1} action={action_str} reward={reward.score:.2f} done={str(done).lower()} error=null", flush=True)
|
| 79 |
if done:
|
| 80 |
break
|
| 81 |
|
| 82 |
score = grade_task(task, taken)
|
| 83 |
+
rewards_str = ",".join(f"{r.score:.2f}" for r in rewards)
|
| 84 |
success = score >= 0.5
|
| 85 |
print(f"[END] success={str(success).lower()} steps={len(taken)} score={score:.3f} rewards={rewards_str}", flush=True)
|
| 86 |
return score
|