[GH-ISSUE #4823] I encountered this error when converting the Tongyi-Finance-14B-Chat-Int4-AWQ model #65084

Open
opened 2026-05-03 19:43:16 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @wangkai111111 on GitHub (Jun 5, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4823

What is the issue?

(.venv) [root@bastion ollama]# python llm/llama.cpp/convert-hf-to-gguf.py ./model --outtype f16 --outfile converted.bin INFO:hf-to-gguf:Loading model: model INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only INFO:hf-to-gguf:Set model parameters INFO:hf-to-gguf:Set model tokenizer Traceback (most recent call last): File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2865, in <module> main() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2850, in main model_instance.set_vocab() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 1592, in set_vocab self._set_vocab_qwen() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 530, in _set_vocab_qwen assert len(merged) == 2 AssertionError

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.1.41

Originally created by @wangkai111111 on GitHub (Jun 5, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4823 ### What is the issue? `(.venv) [root@bastion ollama]# python llm/llama.cpp/convert-hf-to-gguf.py ./model --outtype f16 --outfile converted.bin INFO:hf-to-gguf:Loading model: model INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only INFO:hf-to-gguf:Set model parameters INFO:hf-to-gguf:Set model tokenizer Traceback (most recent call last): File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2865, in <module> main() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2850, in main model_instance.set_vocab() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 1592, in set_vocab self._set_vocab_qwen() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 530, in _set_vocab_qwen assert len(merged) == 2 AssertionError ` ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.1.41
GiteaMirror added the bug label 2026-05-03 19:43:16 -05:00
Author
Owner

@wangkai111111 commented on GitHub (Jun 5, 2024):

I changedlen(merged) == 2tolen(merged) >= 2This error appeared again. Please help.

`(.venv) [root@bastion ollama]# python llm/llama.cpp/convert-hf-to-gguf.py ./model --outtype f16 --outfile converted.bin

INFO:hf-to-gguf:Loading model: model
INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only
INFO:hf-to-gguf:Set model parameters
INFO:hf-to-gguf:Set model tokenizer
INFO:gguf.vocab:Adding 153463 merge(s).
INFO:gguf.vocab:Setting special token type bos to 153719
INFO:gguf.vocab:Setting special token type eos to 153719
INFO:gguf.vocab:Setting special token type unk to 153719
INFO:hf-to-gguf:Exporting model to 'converted.bin'
INFO:hf-to-gguf:gguf: loading model part 'model.safetensors'
INFO:hf-to-gguf:output.weight, torch.bfloat16 --> F16, shape = {5120, 154112}
INFO:hf-to-gguf:blk.0.attn_qkv.bias, torch.float16 --> F32, shape = {15360}
Traceback (most recent call last):
File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2865, in
main()
File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2859, in main
model_instance.write()
File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 325, in write
self.write_tensors()
File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 262, in write_tensors
for new_name, data in ((n, d.squeeze().numpy()) for n, d in self.modify_tensors(data_torch, name, bid)):
File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 229, in modify_tensors
return [(self.map_tensor_name(name), data_torch)]
File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 180, in map_tensor_name
raise ValueError(f"Can not map tensor {name!r}")
ValueError: Can not map tensor 'transformer.h.0.attn.c_attn.qweight'
`

<!-- gh-comment-id:2148748974 --> @wangkai111111 commented on GitHub (Jun 5, 2024): I changed`len(merged) == 2`to`len(merged) >= 2`This error appeared again. Please help. `(.venv) [root@bastion ollama]# python llm/llama.cpp/convert-hf-to-gguf.py ./model --outtype f16 --outfile converted.bin INFO:hf-to-gguf:Loading model: model INFO:gguf.gguf_writer:gguf: This GGUF file is for Little Endian only INFO:hf-to-gguf:Set model parameters INFO:hf-to-gguf:Set model tokenizer INFO:gguf.vocab:Adding 153463 merge(s). INFO:gguf.vocab:Setting special token type bos to 153719 INFO:gguf.vocab:Setting special token type eos to 153719 INFO:gguf.vocab:Setting special token type unk to 153719 INFO:hf-to-gguf:Exporting model to 'converted.bin' INFO:hf-to-gguf:gguf: loading model part 'model.safetensors' INFO:hf-to-gguf:output.weight, torch.bfloat16 --> F16, shape = {5120, 154112} INFO:hf-to-gguf:blk.0.attn_qkv.bias, torch.float16 --> F32, shape = {15360} Traceback (most recent call last): File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2865, in <module> main() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 2859, in main model_instance.write() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 325, in write self.write_tensors() File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 262, in write_tensors for new_name, data in ((n, d.squeeze().numpy()) for n, d in self.modify_tensors(data_torch, name, bid)): File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 229, in modify_tensors return [(self.map_tensor_name(name), data_torch)] File "/root/model/ollama/llm/llama.cpp/convert-hf-to-gguf.py", line 180, in map_tensor_name raise ValueError(f"Can not map tensor {name!r}") ValueError: Can not map tensor 'transformer.h.0.attn.c_attn.qweight' `
Author
Owner

@pdevine commented on GitHub (Jun 5, 2024):

@wangkai111111 I don't recognize that tensor name, so I'm not sure that architecture is supported. You may want to check w/ the llama.cpp folks to see if they are planning to support it.

<!-- gh-comment-id:2150925970 --> @pdevine commented on GitHub (Jun 5, 2024): @wangkai111111 I don't recognize that tensor name, so I'm not sure that architecture is supported. You may want to check w/ the llama.cpp folks to see if they are planning to support it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65084