-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
KeyError: lm_head.weight in GemmaForCausalLM.load_weights when loading finetuned Gemma 2B #3323
Comments
Same error occurs when using quantized gemma-7b by autoawq. |
After fine-tuning gemma-7b, the same error occurs. |
1 task
It should be relevant to this PR: 3050. I'm not sure if directly add the deleted two lines will break the loading of lora weights. |
fine-tuning gemma-7b, the same error occurs. +1 |
Same here I used axolotl and LoRa to finetune gemma-7b. +1. |
Thank you @taeminlee for sending the PR! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I finetuned Gemma 2B with Unsloth. It uses LoRA and merges the weights back into the base model.
When I try to load this model, it gives me the following error:
My
pytorch_model.bin.index.json
looks like this:I saw in a few of the other classes a similar check for
lm_head.weight
so I replicated it inload_weights
and the model loads correctly and works as intended. 1 2 3The modified load_weights function:
1333322
I'm not sure if this is an issue with vllm, or an issue with the output of Unsloth. The model works correctly when
load_weights
is modified. I don't know what the internals of the model should look like. Any help would be appreciated!I'm unsure if this is related to #2816
My model is Private, so unfortunately I can't share it. However I found this other model on huggingface that's trained with the same tool with the
lm_head.weight
in the index.If the modified
load_weights
function is the desired fix, I can submit a PR if that will help.Thank you for the help!
The text was updated successfully, but these errors were encountered: