Download code/abl_summary.py from slava-research/slava-rollouts: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/slava-research/slava-rollouts/resolve/main/code/abl_summary.py
- Command line
-
hf download hf://datasets/slava-research/slava-rollouts/code/abl_summary.py
-
curl -L -o abl_summary.py https://huggingface.co/datasets/slava-research/slava-rollouts/resolve/main/code/abl_summary.py
1.05 kB
| import json, collections, os | |
| ARMS = [("все поправки", "gv_r1_native"), ("без системы координат", "gv_r1_noframe"), | |
| ("без бинаризации схвата", "gv_r1_nobin"), ("без перевода углов", "gv_r1_noeuler"), | |
| ("без открытости схвата", "gv_r1_noopen")] | |
| TASKS = ["widowx_stack_cube", "widowx_carrot_on_plate", | |
| "widowx_spoon_on_towel", "widowx_put_eggplant_in_basket"] | |
| print(f"{'вариант':<26}{'итого':>11} " + "".join(t.replace('widowx_', '')[:13].rjust(15) for t in TASKS)) | |
| for label, d in ARMS: | |
| p = f"/root/SLAVA_dev/rollouts/dumps/{d}/shard0.jsonl" | |
| if not os.path.exists(p): | |
| continue | |
| rows = [json.loads(l) for l in open(p)] | |
| t, c = collections.Counter(), collections.Counter() | |
| for r in rows: | |
| k = r["task_name"]; t[k] += 1; c[k] += bool(r["success"]) | |
| ok, n = sum(c.values()), sum(t.values()) | |
| cells = "".join(f"{c[k]}/{t[k]}".rjust(15) for k in TASKS) | |
| print(f"{label:<26}{ok:>4}/{n:<6}{cells}") | |