Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sovereign-intelligence/blob/main/tools/adapter/reference.py # sovereign-intelligence Front door to Drake Stapleton's sovereign stack. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `sovereign-intelligence / tools / adapter / reference.py` 35 lines ยท 1271 bytes Raw Blame History 1 """Independent GGUF directory reader and numeric oracle. Test dependency: gguf==0.17.1.""" 2 import hashlib 3 import pathlib 4 import struct 5 import sys 6 7 from gguf import GGUFReader 8 9 10 def inspect(path): 11 reader = GGUFReader(path) 12 def field(name): 13 return reader.get_field(name).contents() 14 tensor = next(t for t in reader.tensors if t.name == "blk.0.attn_q.weight") 15 assert tensor.tensor_type.name == "Q8_0" 16 width = int(tensor.shape[0]) 17 assert width % 32 == 0 18 length = width // 32 * 34 19 with open(path, "rb") as stream: 20 stream.seek(tensor.data_offset) 21 row = stream.read(length) 22 # Integral activations and signed bytes give exact integer block sums. 23 total = 0.0 24 for start in range(0, length, 34): 25 scale, *weights = struct.unpack_from("