anugrah55 commited on
Commit
e5bfb2e
·
verified ·
1 Parent(s): a88e3ae

Score range fix (0, 1)

Browse files
Files changed (1) hide show
  1. inference.py +1 -0
inference.py CHANGED
@@ -53,6 +53,7 @@ def log_step(step: int, action: str, reward: float, done: bool, error: Optional[
53
  )
54
 
55
  def log_end(success: bool, steps: int, score: float, rewards: List[float]) -> None:
 
56
  rewards_str = ",".join(f"{r:.2f}" for r in rewards)
57
  print(f"[END] success={str(success).lower()} steps={steps} score={score:.2f} rewards={rewards_str}", flush=True)
58
 
 
53
  )
54
 
55
  def log_end(success: bool, steps: int, score: float, rewards: List[float]) -> None:
56
+ score = max(0.01, min(0.99, float(score)))
57
  rewards_str = ",".join(f"{r:.2f}" for r in rewards)
58
  print(f"[END] success={str(success).lower()} steps={steps} score={score:.2f} rewards={rewards_str}", flush=True)
59