shank commited on
Commit ·
212d2d9
1
Parent(s): cd968e7
Update: Dockerfile and inference.py
Browse filesFiles changed (2)
- Dockerfile+1-1
- inference.py+5-5
11234FROM python:3.10-slimFROM python:3.10.14-slim-bookworm
WORKDIR /app
81 unmodified lines82838485858687881 unmodified line90919293939495969797989910065 unmodified lines16616716816916917017117228 unmodified lines20120220320420420520620781 unmodified lines return completion.choices[0].message.content except (RateLimitError, APIConnectionError, APITimeoutError) as e: if attempt == max_retries - 1: raise e return "" wait_time = (2 ** attempt) + random.random() print(f" [!] API Error ({type(e).__name__}). Retrying in {wait_time:.1f}s... (Attempt {attempt+1}/{max_retries})") time.sleep(wait_time)1 unmodified line # For general API errors, log and potentially retry if it's a 5xx print(f" [!] OpenAI API Error: {e}") if attempt == max_retries - 1: raise e return "" time.sleep(2) except Exception as e: print(f" [!] Unexpected error during completion: {e}") raise e return "" return ""
65 unmodified lines """Run one complete debugging episode. Returns result dict."""
# Reset environment reset_resp = requests.post(f"{ENV_BASE_URL}/reset", json={"task_id": task_id}) reset_resp = requests.post(f"{ENV_BASE_URL}/reset", json={"task_id": task_id}, timeout=60) reset_resp.raise_for_status() obs = reset_resp.json()
28 unmodified lines raw = json.dumps(action)
# Submit action to environment step_resp = requests.post(f"{ENV_BASE_URL}/step", json=action) step_resp = requests.post(f"{ENV_BASE_URL}/step", json=action, timeout=60) step_resp.raise_for_status() result = step_resp.json()
Dockerfile+1-1
inference.py+5-5