Skip to content

Commit 20b256e

Browse files
committed
convert : match ssm_conv tensors by type
1 parent 9c60fc4 commit 20b256e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3803,8 +3803,6 @@ def set_gguf_parameters(self):
38033803
_tok_embd = None
38043804

38053805
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
3806-
del bid # unused
3807-
38083806
output_name = self.format_tensor_name(gguf.MODEL_TENSOR.OUTPUT)
38093807
tok_embd_name = self.format_tensor_name(gguf.MODEL_TENSOR.TOKEN_EMBD)
38103808

@@ -3815,7 +3813,7 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
38153813
data_torch = -torch.exp(data_torch)
38163814

38173815
# [4 1 8192 1] -> [4 8192 1 1]
3818-
if new_name.endswith(".ssm_conv1d"):
3816+
if self.match_model_tensor_name(new_name, gguf.MODEL_TENSOR.SSM_CONV1D, bid):
38193817
data_torch = data_torch.squeeze()
38203818

38213819
# assuming token_embd.weight is seen before output.weight

0 commit comments

Comments
 (0)