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

Question about the shape of lm_head.weight #1850

Open
Jay-zzcoder opened this issue Mar 12, 2025 · 0 comments
Open

Question about the shape of lm_head.weight #1850

Jay-zzcoder opened this issue Mar 12, 2025 · 0 comments

Comments

@Jay-zzcoder
Copy link

Jay-zzcoder commented Mar 12, 2025

Question

I found that if I don't pass the BitsAndBytesConfig args in LlavaLlamaForCausalLM.from_pretrained() like this:
model = LlavaLlamaForCausalLM.from_pretrained( tokenizer_path, torch_dtype=torch.bfloat16 , #**bnb_model_from_pretrained_args )
the shape of lm_head.weight is torch.Size([32000, 5120])

But if I pass BitsAndBytesConfig args in LlavaLlamaForCausalLM.from_pretrained() like:
model = LlavaLlamaForCausalLM.from_pretrained( tokenizer_path, torch_dtype=torch.bfloat16 , **bnb_model_from_pretrained_args )
the shape of lm_head.weight will change and become torch.Size([81920000, 1])

Why the shape of lm_head.weight changes?

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

No branches or pull requests

1 participant