Skip to content
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

internlm2-1.8b微调报错 #395

Closed
deep-practice opened this issue Jul 24, 2024 · 2 comments
Closed

internlm2-1.8b微调报错 #395

deep-practice opened this issue Jul 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@deep-practice
Copy link

使用internlm2-1.8b进行微调的时候,会报AttributeError: 'InternLM2ForCausalLM' object has no attribute 'lm_head'。但是使用internlm2-1.8b增量预训练又没有报错。

@deep-practice deep-practice added the bug Something isn't working label Jul 24, 2024
@deep-practice deep-practice changed the title internlm2-1.8b chat微调报错 internlm2-1.8b微调报错 Jul 24, 2024
@deep-practice
Copy link
Author

在代码里面加上:
if getattr(config, "model_type", None) == "internlm2":
setattr(model, "lm_head", model.output)
setattr(model, "_keys_to_ignore_on_save", ["lm_head.weight"])

shibing624 added a commit that referenced this issue Jul 25, 2024
@shibing624
Copy link
Owner

thanks,fixed。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants