bbkdevops's picture
Upload folder using huggingface_hub
5f67a1f verified
Raw History Blame Contribute Delete
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)")