Skip to content

Commit 8993982

Browse files
committed
convert : fix conversion from FP8 for Deepseek-V3.1-Base
1 parent 1ae6ab7 commit 8993982

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
@@ -254,6 +254,8 @@ def dequant_simple(weight: Tensor, scale: Tensor) -> Tensor:
254254
# TODO: make sure it's a list of integers
255255
for i, size in enumerate(weight_block_size):
256256
scale = scale.repeat_interleave(size, i)
257+
# unpad the scale (e.g. when the tensor size isn't a multiple of the block size)
258+
scale = scale[tuple(slice(0, size) for size in weight.shape)]
257259

258260
return weight.float() * scale
259261

0 commit comments

Comments
 (0)