slava-rollouts / code /abl_summary.py
AlexKarachun's picture
Upload code/abl_summary.py with huggingface_hub
1667d33 verified
Raw History Blame Contribute Delete
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}")