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

[BugFix] skip loading lm_head for llama if word embeddings are tied #6796

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions vllm/model_executor/models/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):

break
else:
# if word embeddings are tied,
# lm_head will not be used.
# To prevent errors, skip loading lm_head.
if self.config.tie_word_embeddings and "lm_head" in name:
continue
# Skip loading extra bias for GPTQ models.
if name.endswith(".bias") and name not in params_dict:
continue
Expand Down
Loading