Skip to content

Commit c818c40

Browse files
authored
convert-llama-hf-to-gguf.py : fix attn_q permute
1 parent 58bde5c commit c818c40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

convert-llama-hf-to-gguf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ def count_model_parts(dir_model: str) -> int:
264264
data = data.squeeze().numpy()
265265

266266
# reverse permute these
267-
if name.endswith(".q_proj.weight") or name.endswith(".k_proj.weight"):
267+
if name.endswith(".q_proj.weight"):
268+
data = reverse_hf_permute(data, head_count)
269+
if name.endswith(".k_proj.weight"):
268270
data = reverse_hf_permute(data, head_count, head_count_kv)
269271

270272
# map tensor names

0 commit comments

Comments
 (0)