Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- check_yaml.py +8 -0
- run_10_real_episodes.py +58 -0
check_yaml.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import yaml
|
| 2 |
+
|
| 3 |
+
with open('openenv.yaml') as f:
|
| 4 |
+
d = yaml.safe_load(f)
|
| 5 |
+
|
| 6 |
+
for t in d.get("tasks", []):
|
| 7 |
+
g = t.get("grader")
|
| 8 |
+
print(f"{t['id']}: grader type = {type(g).__name__}, value = {g}")
|
run_10_real_episodes.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run 10 real SupportDesk episodes and stream inference logs.
|
| 2 |
+
|
| 3 |
+
This does not fabricate output. It simply invokes `inference.py` repeatedly
|
| 4 |
+
with real task ids from the registry so stdout contains valid `[START]`,
|
| 5 |
+
`[STEP]`, and `[END]` lines for each completed run.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
from __future__ import annotations
|
| 9 |
+
|
| 10 |
+
import os
|
| 11 |
+
import subprocess
|
| 12 |
+
import sys
|
| 13 |
+
from itertools import cycle, islice
|
| 14 |
+
|
| 15 |
+
from tasks import list_task_ids
|
| 16 |
+
|
| 17 |
+
TOTAL_RUNS = 10
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def main() -> int:
|
| 21 |
+
base_env = os.environ.copy()
|
| 22 |
+
task_ids = list(list_task_ids())
|
| 23 |
+
|
| 24 |
+
if not task_ids:
|
| 25 |
+
print("No tasks registered.", file=sys.stderr)
|
| 26 |
+
return 1
|
| 27 |
+
|
| 28 |
+
# Repeat the real task ids until we have 10 actual runs.
|
| 29 |
+
run_plan = list(islice(cycle(task_ids), TOTAL_RUNS))
|
| 30 |
+
|
| 31 |
+
for idx, task_id in enumerate(run_plan, start=1):
|
| 32 |
+
env = base_env.copy()
|
| 33 |
+
env["SUPPORTDESK_TASK_ID"] = task_id
|
| 34 |
+
env.setdefault("PYTHONUTF8", "1")
|
| 35 |
+
|
| 36 |
+
print(
|
| 37 |
+
f"# run {idx}/{TOTAL_RUNS} task={task_id}",
|
| 38 |
+
file=sys.stderr,
|
| 39 |
+
flush=True,
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
completed = subprocess.run(
|
| 43 |
+
[sys.executable, "inference.py"],
|
| 44 |
+
env=env,
|
| 45 |
+
check=False,
|
| 46 |
+
)
|
| 47 |
+
if completed.returncode != 0:
|
| 48 |
+
print(
|
| 49 |
+
f"Run {idx} failed for task {task_id} with exit code {completed.returncode}.",
|
| 50 |
+
file=sys.stderr,
|
| 51 |
+
)
|
| 52 |
+
return completed.returncode
|
| 53 |
+
|
| 54 |
+
return 0
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
if __name__ == "__main__":
|
| 58 |
+
raise SystemExit(main())
|