diff --git a/scripts/derive-protected-experts.py b/scripts/derive-protected-experts.py index d343540..4a3503b 100755 --- a/scripts/derive-protected-experts.py +++ b/scripts/derive-protected-experts.py @@ -37,6 +37,7 @@ NAME_RE = re.compile(r"^gram\.r(\d)\.blk\.(\d+)\.ffn_down_exps\.(\d+)\.bin$") def read_gram(path): """(k, rank, rows, trace) from a RADGRAM2 file (full matrix on disk).""" with open(path, "rb") as f: + hdr = f.read(32) magic, k, rank, rows, domain = struct.unpack("<8sIIQI", hdr[:28]) if magic != b"RADGRAM2": raise SystemExit(f"not a RADGRAM2 file: {path}")