Skip to content

Commit 0b3d27b

Browse files
authored
Merge branch 'kvcache-ai:main' into main
2 parents c22621f + dcba29b commit 0b3d27b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ktransformers/util/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def load_cur_state_dict(module: nn.Module, gguf_loader: ModelLoader, prefix: str
130130
attn_k_b = attn_k_b.transpose(1, 2).contiguous()
131131
attn_v_b = load_dequantized_tensor(translated_key.replace("self_attn.kv_b_proj", "attn_v_b"), device=device).to(dtype=target_dtype)
132132
kv_b_proj = torch.cat((attn_k_b, attn_v_b), dim=1)
133+
kv_b_proj = kv_b_proj.contiguous() if kv_b_proj.ndim == 2 else kv_b_proj.flatten(0, 1).contiguous()
133134
set_param(module, name, kv_b_proj)
134135
del attn_k_b
135136
del attn_v_b

0 commit comments

Comments
 (0)