Skip to content

Commit be36bde

Browse files
committed
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.
1 parent c8c8401 commit be36bde

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/diffusers/quantizers/gguf/gguf_quantizer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def check_quantized_param_shape(self, param_name, current_param, loaded_param):
8484
inferred_shape = _quant_shape_from_byte_shape(loaded_param_shape, type_size, block_size)
8585
if inferred_shape != current_param_shape:
8686
raise ValueError(
87-
f"{param_name} has an expected quantized shape of: {inferred_shape}, but received shape: {loaded_param_shape}"
87+
f"{param_name} has an expected shape of: {current_param_shape}, but the loaded GGUF weight decodes "
88+
f"to shape: {inferred_shape}"
8889
)
8990

9091
return True

0 commit comments

Comments
 (0)