CompressedGemma commited on
Commit
766f12c
Β·
verified Β·
1 Parent(s): e9294cc

Upload 3 files

Browse files
Files changed (1) hide show
  1. hexstate_requantize.py +9 -2
hexstate_requantize.py CHANGED
@@ -277,14 +277,14 @@ TYPE_NAME = {
277
  13: "Q5_K", 14: "Q6_K", 15: "Q8_K", 30: "BF16",
278
  }
279
 
280
- # Block sizes and byte sizes for each type
281
  TYPE_BLOCK_SIZE = {
282
  0: 1, 1: 1, 2: 32, 3: 32, 6: 32, 7: 32,
283
  8: 32, 9: 32, 10: 256, 11: 256, 12: 256,
284
  13: 256, 14: 256, 15: 256, 30: 1,
285
  }
286
  TYPE_BLOCK_BYTES = {
287
- 0: 4, 1: 2, 2: 18, 3: 20, 6: 20, 7: 22,
288
  8: 34, 9: 36, 10: 84, 11: 110, 12: 144,
289
  13: 176, 14: 210, 15: 292, 30: 2,
290
  }
@@ -967,6 +967,13 @@ def main():
967
  out_data_offset += out_size
968
  out_data_offset = align_offset(out_data_offset)
969
 
 
 
 
 
 
 
 
970
  # ── Update KV pairs ──
971
  updated_kv = []
972
  if keep_metadata:
 
277
  13: "Q5_K", 14: "Q6_K", 15: "Q8_K", 30: "BF16",
278
  }
279
 
280
+ # Block sizes and byte sizes for each type (from ggml.c)
281
  TYPE_BLOCK_SIZE = {
282
  0: 1, 1: 1, 2: 32, 3: 32, 6: 32, 7: 32,
283
  8: 32, 9: 32, 10: 256, 11: 256, 12: 256,
284
  13: 256, 14: 256, 15: 256, 30: 1,
285
  }
286
  TYPE_BLOCK_BYTES = {
287
+ 0: 4, 1: 2, 2: 18, 3: 20, 6: 22, 7: 24,
288
  8: 34, 9: 36, 10: 84, 11: 110, 12: 144,
289
  13: 176, 14: 210, 15: 292, 30: 2,
290
  }
 
967
  out_data_offset += out_size
968
  out_data_offset = align_offset(out_data_offset)
969
 
970
+ # ── Detect Architecture ──
971
+ arch = 'llama'
972
+ for key, vtype, val in kv_pairs:
973
+ if key == 'general.architecture' and vtype == 8:
974
+ arch = val.decode('utf-8', errors='ignore')
975
+ break
976
+
977
  # ── Update KV pairs ──
978
  updated_kv = []
979
  if keep_metadata: