-
Notifications
You must be signed in to change notification settings - Fork 731
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
Failed to load the finetuned model with AutoModelForCausalLM.from_pretrained(name, state_dict=state_dict)
#1362
Comments
I can load the weight using the |
Thanks for raising that. Maybe it's a HF thing. I will have to investigate. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I fine-tuned llama3-8b with Lora and followed the tutorial in the repository to convert the final result into
model.pth
. However, when I try to load the fine-tuned weights into the model usingAutoModelForCausalLM.from_pretrained
, I am unable to do so correctly. Below is my test:But I found that the
state_dict
oftorch.load
doesn't equal to themodel.state_dict()
, as shown following:torch.load:
model.state_dict()
I noticed that even though I passed the
state_dict
,from_pretrained
still returns the weights of the model loaded by name. Did I make any mistakes in my code, and how can I solve this? Thanks!The text was updated successfully, but these errors were encountered: