File size: 595 Bytes
c41f7a6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import json
rows = [json.loads(l) for l in open("/root/measure_identity.jsonl")]
print(f"n={len(rows)}")
print(f"{'sample':<48} {'king KL':>9} {'chal KL':>9} {'same':>6}")
allsame = True
maxdiff = 0.0
for r in rows:
    sid = r.get("sample_id") or r.get("id") or "?"
    k = (r.get("king") or {}).get("kl")
    c = (r.get("challenger") or {}).get("kl")
    same = k == c
    allsame &= same
    if k is not None and c is not None:
        maxdiff = max(maxdiff, abs(k - c))
    print(f"{sid[:48]:<48} {k!s:>9} {c!s:>9} {str(same):>6}")
print("ALL IDENTICAL:", allsame, "| max |diff|:", maxdiff)