Skip to content

Commit bdfc241

Browse files
compiladedanbev
authored andcommitted
convert : fix conversion from FP8 for Deepseek-V3.1-Base
1 parent 3af93da commit bdfc241

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ def dequant_simple(weight: Tensor, scale: Tensor) -> Tensor:
261261
# TODO: make sure it's a list of integers
262262
for i, size in enumerate(weight_block_size):
263263
scale = scale.repeat_interleave(size, i)
264+
# unpad the scale (e.g. when the tensor size isn't a multiple of the block size)
265+
scale = scale[tuple(slice(0, size) for size in weight.shape)]
264266

265267
return weight.float() * scale
266268

0 commit comments

Comments
 (0)