Skip to content

Fix autoawq gemma convert #6704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

dengzheng-cloud
Copy link
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 on lines 2282 to 2283
if "lm_head.weight" in name:
continue
Copy link
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
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
tybalex pushed a commit to rubra-ai/tools.cpp that referenced this pull request Apr 17, 2024
* 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 <[email protected]>
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