Download analysis/split6.py from tresbientech/skinsuit-behavioral-tests: direct link, hf CLI and curl.
- Browser
- Download file 829 Bytes
-
https://huggingface.co/datasets/tresbientech/skinsuit-behavioral-tests/resolve/main/analysis/split6.py
- Command line
-
hf download hf://datasets/tresbientech/skinsuit-behavioral-tests/analysis/split6.py
-
curl -L -o split6.py https://huggingface.co/datasets/tresbientech/skinsuit-behavioral-tests/resolve/main/analysis/split6.py
829 Bytes
| """Split round6/results.jsonl into round6-old (cases B) and round6-new (cases W), and check the counts.""" | |
| import collections | |
| import json | |
| import pathlib | |
| S = pathlib.Path(__file__).resolve().parent | |
| rows = [json.loads(line) for line in (S / "round6" / "results.jsonl").read_text(encoding="utf-8").splitlines()] | |
| keys = collections.Counter((r["arm"], r["model"], r["case"], r["run"]) for r in rows) | |
| print(len(rows), collections.Counter(r["arm"] for r in rows), "duplicates", sum(v > 1 for v in keys.values())) | |
| for name, prefix in (("round6-old", "B"), ("round6-new", "W")): | |
| out = S / name | |
| out.mkdir(exist_ok=True) | |
| kept = [r for r in rows if r["case"].startswith(prefix)] | |
| (out / "results.jsonl").write_text("".join(json.dumps(r, ensure_ascii=False) + "\n" for r in kept), encoding="utf-8") | |
| print(name, len(kept)) | |