Shivappa commited on
Commit
82f2af5
Β·
1 Parent(s): f15c8b1

fix: always run all 3 task levels regardless of TASK_LEVEL env var

Browse files

Root cause: Dockerfile had ENV TASK_LEVEL=easy which caused inference.py
to only run the easy task β€” validator saw 1 task, needs 3.

- Dockerfile: remove ENV TASK_LEVEL=easy entirely
- inference.py: always run [easy, medium, hard] unconditionally;
TASK_LEVEL env var only affects the uvicorn server, not inference

Files changed (2) hide show
  1. Dockerfile +2 -1
  2. inference.py +3 -9
Dockerfile CHANGED
@@ -23,7 +23,8 @@ ENV PYTHONPATH=/app:/app/src
23
  ENV ENABLE_WEB_INTERFACE=true
24
 
25
  # ── Runtime config ────────────────────────────────────────────
26
- ENV TASK_LEVEL=easy
 
27
  ENV PORT=7860
28
 
29
  # ── Install only what the base image does NOT already provide ─
 
23
  ENV ENABLE_WEB_INTERFACE=true
24
 
25
  # ── Runtime config ────────────────────────────────────────────
26
+ # Do NOT set TASK_LEVEL β€” inference.py must run all 3 levels for the validator.
27
+ # The uvicorn server reads TASK_LEVEL at request time; leaving it unset is fine.
28
  ENV PORT=7860
29
 
30
  # ── Install only what the base image does NOT already provide ─
inference.py CHANGED
@@ -217,15 +217,9 @@ async def main() -> None:
217
 
218
  client = OpenAI(api_key=api_key, base_url=api_base_url)
219
 
220
- # Determine which task levels to run.
221
- # If TASK_LEVEL is set to a specific level, run only that one;
222
- # otherwise run ALL THREE so the validator sees 3 graded tasks.
223
- requested = os.environ.get("TASK_LEVEL", "").strip().lower()
224
- if requested in ("easy", "medium", "hard"):
225
- task_levels = [requested]
226
- else:
227
- task_levels = ["easy", "medium", "hard"]
228
-
229
  print(f"[DEBUG] Running task levels: {task_levels}", flush=True)
230
 
231
  if LOCAL_IMAGE_NAME:
 
217
 
218
  client = OpenAI(api_key=api_key, base_url=api_base_url)
219
 
220
+ # Always run all three task levels β€” the validator requires at least 3 graded tasks.
221
+ # TASK_LEVEL env var is intentionally ignored here; it only affects the uvicorn server.
222
+ task_levels = ["easy", "medium", "hard"]
 
 
 
 
 
 
223
  print(f"[DEBUG] Running task levels: {task_levels}", flush=True)
224
 
225
  if LOCAL_IMAGE_NAME: