convert : fix conversion from FP8 for Deepseek-V3.1-Base

This commit is contained in:
Francis Couture-Harpin
2025-08-19 17:27:59 -04:00
parent 1ae6ab7601
commit 899398277d

View File

@@ -254,6 +254,8 @@ class ModelBase:
# TODO: make sure it's a list of integers # TODO: make sure it's a list of integers
for i, size in enumerate(weight_block_size): for i, size in enumerate(weight_block_size):
scale = scale.repeat_interleave(size, i) scale = scale.repeat_interleave(size, i)
# unpad the scale (e.g. when the tensor size isn't a multiple of the block size)
scale = scale[tuple(slice(0, size) for size in weight.shape)]
return weight.float() * scale return weight.float() * scale