Download validate.py from blazeofchi/system-one-eval: direct link, hf CLI and curl.
- Browser
- Download file 874 Bytes
-
https://huggingface.co/datasets/blazeofchi/system-one-eval/resolve/main/validate.py
- Command line
-
hf download hf://datasets/blazeofchi/system-one-eval/validate.py
-
curl -L -o validate.py https://huggingface.co/datasets/blazeofchi/system-one-eval/resolve/main/validate.py
874 Bytes
| """Validate the public dataset structure and answer keys.""" | |
| import json | |
| from pathlib import Path | |
| path = Path(__file__).resolve().parent / "test.jsonl" | |
| rows = [json.loads(line) for line in path.read_text().splitlines()] | |
| assert len(rows) == 60 and len({row["task_id"] for row in rows}) == 60 | |
| assert sum(row["question_count"] for row in rows) == 70 | |
| for row in rows: | |
| state = json.loads(row["state_json"]) | |
| questions = json.loads(row["questions_json"]) | |
| gold = json.loads(row["gold_json"]) | |
| assert isinstance(state, dict) and set(questions) == set(gold) | |
| assert row["question_count"] == len(questions) | |
| for qid, spec in questions.items(): | |
| if spec["type"] == "choice": | |
| assert gold[qid] in spec["criteria"] | |
| else: | |
| assert spec["type"] == "noul" and isinstance(gold[qid], bool) | |
| print("Validated 60 tasks and 70 questions") | |