File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -80,11 +80,14 @@ def test_kv_cache_static_quantization(model_id):
80
80
model .save_quantized (quantized_model_dir )
81
81
82
82
tensors = safetensors .torch .load_file (f"{ quantized_model_dir } /model.safetensors" )
83
- count_matches = 0
84
- for name , tensor in tensors .items ():
83
+ proj_linear_count = 0
84
+ output_scale_count = 0
85
+ for name , _ in tensors .items ():
86
+ if name .endswith ("k_proj" ) or name .endswith ("v_proj" ):
87
+ proj_linear_count += 1
85
88
if name .endswith ("k_proj.output_scale" ) or name .endswith ("v_proj.output_scale" ):
86
- count_matches += 1
87
- assert count_matches == 24
89
+ output_scale_count += 1
90
+ assert proj_linear_count == output_scale_count
88
91
89
92
# Measure checkpoint size and cleanup
90
93
model_size = os .path .getsize (f"{ quantized_model_dir } /model.safetensors" )
You can’t perform that action at this time.
0 commit comments