Spaces:
Sleeping
Sleeping
Commit ·
e8cd840
1
Parent(s): 6f90d54
fix: enforce strict score bounds in inference fallback path
Browse files- inference.py +2 -1
inference.py
CHANGED
|
@@ -195,7 +195,7 @@ async def run_episode(url: str, difficulty: str = 'medium', use_llm: bool = Fals
|
|
| 195 |
|
| 196 |
rewards: List[float] = []
|
| 197 |
steps_taken = 0
|
| 198 |
-
score = 0.
|
| 199 |
success = False
|
| 200 |
|
| 201 |
try:
|
|
@@ -230,6 +230,7 @@ async def run_episode(url: str, difficulty: str = 'medium', use_llm: bool = Fals
|
|
| 230 |
state_resp = json.loads(await ws.recv())
|
| 231 |
state = state_resp.get('data', {})
|
| 232 |
score = float(state.get('score', obs.get('score', 0.5)))
|
|
|
|
| 233 |
|
| 234 |
success = score >= SUCCESS_SCORE_THRESHOLD
|
| 235 |
|
|
|
|
| 195 |
|
| 196 |
rewards: List[float] = []
|
| 197 |
steps_taken = 0
|
| 198 |
+
score = 0.5
|
| 199 |
success = False
|
| 200 |
|
| 201 |
try:
|
|
|
|
| 230 |
state_resp = json.loads(await ws.recv())
|
| 231 |
state = state_resp.get('data', {})
|
| 232 |
score = float(state.get('score', obs.get('score', 0.5)))
|
| 233 |
+
score = min(max(score, 0.01), 0.99)
|
| 234 |
|
| 235 |
success = score >= SUCCESS_SCORE_THRESHOLD
|
| 236 |
|