Download eval.py from bbkdevops/cass-vibe-security-bench: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/datasets/bbkdevops/cass-vibe-security-bench/resolve/main/eval.py
- Command line
-
hf download hf://datasets/bbkdevops/cass-vibe-security-bench/eval.py
-
curl -L -o eval.py https://huggingface.co/datasets/bbkdevops/cass-vibe-security-bench/resolve/main/eval.py
579 Bytes
| """Recompute scoreboard numbers from this dataset (needs cass/ package).""" | |
| import json | |
| import sys | |
| sys.path.insert(0, ".") | |
| from cass.vibe import security_scan as sec | |
| from cass.teachers import calibration as cal | |
| ok = se = n = 0 | |
| for line in open("data/truth20.jsonl", encoding="utf-8"): | |
| r = json.loads(line) | |
| f = sec.scan_file(r["case"] + ".py", r["code"]) | |
| sv, p = cal.calibrated_verdict(f) | |
| ok += (bool(sv) == bool(r["truth"])) | |
| se += (p - float(r["truth"])) ** 2 | |
| n += 1 | |
| print(f"truth20: acc {ok/n:.3f} brier {se/n:.4f} (expect 1.000 0.0368)") | |