Draken1606 commited on
Commit
52c2c50
·
1 Parent(s): e8cd840

chore: update inference score clamp and env var handling

Browse files
Files changed (1) hide show
  1. inference.py +2 -2
inference.py CHANGED
@@ -42,7 +42,7 @@ def _load_dotenv() -> None:
42
 
43
 
44
  _load_dotenv()
45
-
46
  # Required environment variables
47
  HF_TOKEN = os.getenv('HF_TOKEN')
48
  API_BASE_URL = os.getenv('API_BASE_URL', 'https://api.openai.com/v1')
@@ -230,7 +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
- score = min(max(score, 0.01), 0.99)
234
 
235
  success = score >= SUCCESS_SCORE_THRESHOLD
236
 
 
42
 
43
 
44
  _load_dotenv()
45
+ API_KEY = os.getenv('API_KEY')
46
  # Required environment variables
47
  HF_TOKEN = os.getenv('HF_TOKEN')
48
  API_BASE_URL = os.getenv('API_BASE_URL', 'https://api.openai.com/v1')
 
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), 1)
234
 
235
  success = score >= SUCCESS_SCORE_THRESHOLD
236