Skip to content

Commit

Permalink
[Bugfix] Weight loading fix for OPT model (#9042)
Browse files Browse the repository at this point in the history
Co-authored-by: dvres <[email protected]>
  • Loading branch information
domenVres and dvres authored Oct 3, 2024
1 parent 91add85 commit 2838d6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vllm/model_executor/models/opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
]
params_dict = dict(self.named_parameters(remove_duplicate=False))
for name, loaded_weight in weights:
if "lm_head.weight" in name:
if "lm_head.weight" in name and self.config.tie_word_embeddings:
continue
if name.startswith("decoder."):
name = "model." + name
Expand Down

0 comments on commit 2838d6b

Please sign in to comment.