1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-10-29 11:12:00 +03:00

fix(gguf): correct mismatched-shape error message in check_quantized_param_shape (#13504)

fix(gguf): correct mismatched-shape error message

check_quantized_param_shape compares inferred_shape against
current_param_shape, but the error message printed inferred_shape
vs loaded_param_shape — and inferred_shape is derived from
loaded_param_shape, so the reported mismatch was effectively
self-referential and gave no signal about the model's expected shape.

Print current_param_shape (what the model expected) vs inferred_shape
(what the quantized weight decodes to) so the two sides of the
comparison are actually visible.

Noted by @Vargol in #13001.
This commit is contained in:
Ricardo-M-L
2026-05-21 06:03:10 +08:00
committed by GitHub
parent 0b8c0c0bc8
commit 6a65a3735b

View File

@@ -85,7 +85,8 @@ class GGUFQuantizer(DiffusersQuantizer):
inferred_shape = _quant_shape_from_byte_shape(loaded_param_shape, type_size, block_size)
if inferred_shape != current_param_shape:
raise ValueError(
f"{param_name} has an expected quantized shape of: {inferred_shape}, but received shape: {loaded_param_shape}"
f"{param_name} has an expected shape of: {current_param_shape}, but the loaded GGUF weight decodes "
f"to shape: {inferred_shape}"
)
return True