Skip to content

Commit 9c60fc4

Browse files
committed
convert : fix squeeze for ssm_conv tensors
1 parent 053b3f9 commit 9c60fc4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3814,6 +3814,10 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
38143814
logger.debug("A_log --> A ==> " + new_name)
38153815
data_torch = -torch.exp(data_torch)
38163816

3817+
# [4 1 8192 1] -> [4 8192 1 1]
3818+
if new_name.endswith(".ssm_conv1d"):
3819+
data_torch = data_torch.squeeze()
3820+
38173821
# assuming token_embd.weight is seen before output.weight
38183822
if self._tok_embd is not None and new_name == output_name:
38193823
if torch.equal(self._tok_embd, data_torch):

0 commit comments

Comments
 (0)