MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / read_tensor_bytes

Function read_tensor_bytes

server/scripts/quantize_gemma_dflash_q8.py:70–74  ·  view source on GitHub ↗
(path: Path, header_size: int, info: dict)

Source from the content-addressed store, hash-verified

68 header_size = struct.unpack("<Q", f.read(8))[0]
69 header_json = f.read(header_size).decode("utf-8")
70 return header_size, json.loads(header_json)
71
72
73def read_tensor_bytes(path: Path, header_size: int, info: dict) -> bytes:
74 start, end = info["data_offsets"]
75 with open(path, "rb") as f:
76 f.seek(8 + header_size + start)
77 return f.read(end - start)

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected