Spaces:
Sleeping
Sleeping
Shivappa commited on
Commit Β·
82f2af5
1
Parent(s): f15c8b1
fix: always run all 3 task levels regardless of TASK_LEVEL env var
Browse filesRoot 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
- Dockerfile +2 -1
- 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 |
-
|
|
|
|
| 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 |
-
#
|
| 221 |
-
#
|
| 222 |
-
|
| 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:
|