Skip to content

Commit

Permalink
[Bugfix] Weight loading fix for OPT model (vllm-project#9042)
Browse files Browse the repository at this point in the history
Co-authored-by: dvres <dvres@fri.uni-lj.si>
Signed-off-by: Amit Garg <mitgarg17495@gmail.com>
  • Loading branch information
2 people authored and garg-amit committed Oct 28, 2024
1 parent e9546b8 commit 144bf34
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 144bf34

Please sign in to comment.