Spaces:
Sleeping
Sleeping
Dev Shah commited on
Commit ·
f4c15b1
1
Parent(s): da62f9f
fix: update inference.py output markers to match strict OpenEnv parser format and add flush=True
Browse files- inference.py +3 -3
inference.py
CHANGED
|
@@ -103,7 +103,7 @@ def run_task(task: int, max_steps: int = 40, verbose: bool = True) -> float:
|
|
| 103 |
obs = env.reset()
|
| 104 |
|
| 105 |
# --- Hackathon output marker ---
|
| 106 |
-
print("[START]")
|
| 107 |
|
| 108 |
if verbose:
|
| 109 |
print(f"Task {task} | Model: {MODEL_NAME} | Endpoint: {API_BASE_URL}")
|
|
@@ -196,7 +196,7 @@ def run_task(task: int, max_steps: int = 40, verbose: bool = True) -> float:
|
|
| 196 |
result = env.step(action)
|
| 197 |
|
| 198 |
# --- Hackathon output marker ---
|
| 199 |
-
print("[STEP]")
|
| 200 |
|
| 201 |
if verbose:
|
| 202 |
print(f" Env: [{result.observation.status}] {result.observation.message} reward={result.reward:+.2f}")
|
|
@@ -215,7 +215,7 @@ def run_task(task: int, max_steps: int = 40, verbose: bool = True) -> float:
|
|
| 215 |
final_score = env.score()
|
| 216 |
|
| 217 |
# --- Hackathon output marker ---
|
| 218 |
-
print("[END]")
|
| 219 |
|
| 220 |
if verbose:
|
| 221 |
print(f"Final score: {final_score:.2f} / 1.00 (steps used: {step})")
|
|
|
|
| 103 |
obs = env.reset()
|
| 104 |
|
| 105 |
# --- Hackathon output marker ---
|
| 106 |
+
print(f"[START] task={task}", flush=True)
|
| 107 |
|
| 108 |
if verbose:
|
| 109 |
print(f"Task {task} | Model: {MODEL_NAME} | Endpoint: {API_BASE_URL}")
|
|
|
|
| 196 |
result = env.step(action)
|
| 197 |
|
| 198 |
# --- Hackathon output marker ---
|
| 199 |
+
print(f"[STEP] step={step+1} reward={result.reward}", flush=True)
|
| 200 |
|
| 201 |
if verbose:
|
| 202 |
print(f" Env: [{result.observation.status}] {result.observation.message} reward={result.reward:+.2f}")
|
|
|
|
| 215 |
final_score = env.score()
|
| 216 |
|
| 217 |
# --- Hackathon output marker ---
|
| 218 |
+
print(f"[END] task={task} score={final_score} steps={step}", flush=True)
|
| 219 |
|
| 220 |
if verbose:
|
| 221 |
print(f"Final score: {final_score:.2f} / 1.00 (steps used: {step})")
|