From 9c60fc4c785efe00d37138e07049c80d4761a3b0 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 25 Mar 2025 19:54:18 +0200 Subject: [PATCH] convert : fix squeeze for ssm_conv tensors --- convert_hf_to_gguf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index d9fa57027..04800a94e 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -3814,6 +3814,10 @@ class MambaModel(Model): logger.debug("A_log --> A ==> " + new_name) data_torch = -torch.exp(data_torch) + # [4 1 8192 1] -> [4 8192 1 1] + if new_name.endswith(".ssm_conv1d"): + data_torch = data_torch.squeeze() + # assuming token_embd.weight is seen before output.weight if self._tok_embd is not None and new_name == output_name: if torch.equal(self._tok_embd, data_torch):