Download source/scripts/build_dataset_v6.py from rca-umb/five-desks-collapse: direct link, hf CLI and curl.
- Browser
- Download file 2.45 kB
-
https://huggingface.co/datasets/rca-umb/five-desks-collapse/resolve/main/source/scripts/build_dataset_v6.py
- Command line
-
hf download hf://datasets/rca-umb/five-desks-collapse/source/scripts/build_dataset_v6.py
-
curl -L -o build_dataset_v6.py https://huggingface.co/datasets/rca-umb/five-desks-collapse/resolve/main/source/scripts/build_dataset_v6.py
2.45 kB
| """Assemble the Hugging Face dataset folder for Five Desks v6 (hard collapse test on the Five Desks Terminal tasks). | |
| Usage: .venv/bin/python scripts/build_dataset_v6.py (writes dataset_v6_collapse/) | |
| """ | |
| import json | |
| import shutil | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT)) | |
| from termdesk.environment import build, parse_task_id # noqa: E402 | |
| def main(): | |
| request = json.loads((ROOT / "submission_v6_candidate.json").read_text()) | |
| out = ROOT / "dataset_v6_collapse" | |
| shutil.rmtree(out, ignore_errors=True) | |
| (out / "calibration").mkdir(parents=True) | |
| with open(out / "tasks.jsonl", "w") as f: | |
| for task in request["tasks"]: | |
| tid = task["task_id"] | |
| fam, level = parse_task_id(tid) | |
| t = build(tid, 0, "/root") | |
| f.write(json.dumps({"task_id": tid, "domain": fam.DOMAIN, "level": level, "submitted_for_training": True, | |
| "limits": {k: v for k, v in task.items() if k not in ("task_id", "split")}, | |
| "input_files": sorted(t.files), "example_instruction": t.instruction}) + "\n") | |
| for src, dst in [("reports/eval-source/FINDINGS.md", "eval-source.md"), ("reports/run-v5/RESULT.md", "run-v5-result.md"), | |
| ("reports/termdesk/replay-collapse.json", "replay-collapse.json"), ("reports/lottery-analysis-2026-10-12.md", | |
| "lottery-analysis.md")]: | |
| if (ROOT / src).exists(): | |
| shutil.copy(ROOT / src, out / "calibration" / dst) | |
| src = out / "source" | |
| skip = shutil.ignore_patterns("__pycache__", "*.pyc", "*.log") | |
| for item in ["termdesk", "tests/test_termdesk.py", "scripts/replay_terminal.py", "scripts/wsclient.py", | |
| "scripts/build_dataset_v6.py", "requirements.in", "requirements.lock", ".dockerignore", "CHANGELOG.md"]: | |
| path = ROOT / item | |
| (src / item).parent.mkdir(parents=True, exist_ok=True) | |
| if path.is_dir(): | |
| shutil.copytree(path, src / item, ignore=skip) | |
| elif path.exists(): | |
| shutil.copy(path, src / item) | |
| shutil.copy(ROOT / "card_v6_collapse.md", out / "README.md") | |
| shutil.copy(ROOT / "submission_v6_candidate.json", out / "submission_request.json") | |
| print("dataset at", out, sorted(p.name for p in out.iterdir())) | |
| if __name__ == "__main__": | |
| main() | |