Download code/probes/pair_cmp.py from slava-research/slava-rollouts: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/datasets/slava-research/slava-rollouts/resolve/main/code/probes/pair_cmp.py
- Command line
-
hf download hf://datasets/slava-research/slava-rollouts/code/probes/pair_cmp.py
-
curl -L -o pair_cmp.py https://huggingface.co/datasets/slava-research/slava-rollouts/resolve/main/code/probes/pair_cmp.py
1.47 kB
| import json, glob | |
| ref = json.load(open(glob.glob("/root/ref_eval_smolvla_spatial/**/eval_info.json", recursive=True)[0])) | |
| ref_succ = {} | |
| for t in ref["per_task"]: | |
| for i, s in enumerate(t["metrics"]["successes"]): | |
| ref_succ[(t["task_id"], i)] = bool(s) | |
| ours = [json.loads(l) for l in open("/root/SLAVA_dev/rollouts/dumps/smolvla_en/all.jsonl")] | |
| ours = [r for r in ours if r["suite"] == "libero_spatial"] | |
| both = [(r, ref_succ[(r["task_id"], r["init_state_id"])]) | |
| for r in ours if (r["task_id"], r["init_state_id"]) in ref_succ] | |
| print(f"наших эпизодов libero_spatial: {len(ours)}") | |
| print(f"наши init_state_id: {sorted({r['init_state_id'] for r in ours})}") | |
| print(f"пересечение с эталоном (init 0-9): {len(both)} эпизодов") | |
| if both: | |
| a = sum(1 for r, _ in both if r["success"]) | |
| b = sum(1 for _, s in both if s) | |
| agree = sum(1 for r, s in both if bool(r["success"]) == s) | |
| print(f"на ОДНИХ И ТЕХ ЖЕ сценах: наш {a}/{len(both)} = {100*a/len(both):.1f}%, " | |
| f"эталон {b}/{len(both)} = {100*b/len(both):.1f}%") | |
| print(f"совпало поэпизодно: {agree}/{len(both)} = {100*agree/len(both):.1f}%") | |
| outside = [r for r in ours if (r["task_id"], r["init_state_id"]) not in ref_succ] | |
| if outside: | |
| c = sum(1 for r in outside if r["success"]) | |
| print(f"наши сцены ВНЕ эталона (init>9): {c}/{len(outside)} = {100*c/len(outside):.1f}%") | |