Skip to content

Fix autoawq gemma convert#6704

Merged
ggerganov merged 3 commits intoggml-org:masterfrom
dengzheng-cloud:fix-awq-gemma-convert
Apr 16, 2024
Merged

Fix autoawq gemma convert#6704
ggerganov merged 3 commits intoggml-org:masterfrom
dengzheng-cloud:fix-awq-gemma-convert

Conversation

@dengzheng-cloud
Copy link
Copy Markdown
Contributor

when using autoawq to quantize gemma-2b-it model, output model-00001-of-00002.safetensors will include lm_head.weight, this pr could prevent convert error happening in

python convert-hf-to-gguf.py ${quantized_path} --outfile model.gguf

fix #6633

dengzheng-cloud and others added 2 commits April 15, 2024 23:44
using autoawq to quantize gemma model will include a lm_head.weight tensor in model-00001-of-00002.safetensors. it result in this situation that convert-hf-to-gguf.py can't map lm_head.weight. skip loading this tensor could prevent this error.
Comment thread convert-hf-to-gguf.py Outdated
Comment on lines +2282 to +2283
if "lm_head.weight" in name:
continue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to full string match and also print a short message that the tensor is being skipped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already done in a new commit

change code to full string match and print a short message to inform users that lm_head.weight has been skipped.
@ggerganov ggerganov merged commit facb8b5 into ggml-org:master Apr 16, 2024
@dengzheng-cloud dengzheng-cloud deleted the fix-awq-gemma-convert branch April 17, 2024 02:40
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
* fix autoawq quantized gemma model convert error

using autoawq to quantize gemma model will include a lm_head.weight tensor in model-00001-of-00002.safetensors. it result in this situation that convert-hf-to-gguf.py can't map lm_head.weight. skip loading this tensor could prevent this error.

* change code to full string match and print necessary message

change code to full string match and print a short message to inform users that lm_head.weight has been skipped.

---------

Co-authored-by: Zheng.Deng <32841220+CUGfred@users.noreply.github.com>
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
* fix autoawq quantized gemma model convert error

using autoawq to quantize gemma model will include a lm_head.weight tensor in model-00001-of-00002.safetensors. it result in this situation that convert-hf-to-gguf.py can't map lm_head.weight. skip loading this tensor could prevent this error.

* change code to full string match and print necessary message

change code to full string match and print a short message to inform users that lm_head.weight has been skipped.

---------

Co-authored-by: Zheng.Deng <32841220+CUGfred@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

llama.cpp + autoawq + gemma model get wrong answer

2 participants