shank commited on
Commit ·
cd968e7
1
Parent(s): 2a482a5
Fix: precaution to prevent infinite loop
Browse files178 unmodified lines17918018118218318418318518618718818919019154 unmodified lines246247248244249250251252178 unmodified lines last_result = {"reward": {"grader_score": 0.0, "cumulative_reward": 0.0}, "observation": obs} action = {}
max_steps = obs.get("max_steps",25) step_count = 0 while not done: # Get LLM action using the robust helper step_count+=1 if(step_count>max_steps+5): print(f"[!] Safety limit reached, breaking loop") break try: raw = get_completion(messages) if not raw:54 unmodified lines print(f"Env: {ENV_BASE_URL}") if not has_token and "openai.com" in API_BASE_URL: print("WARNING: HF_TOKEN is missing but using default OpenAI endpoint. This may fail.") print("WARNING: HF_TOKEN is missing. API calls will likely fail.") print("=" * 55)
inference.py+7-2