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>
  • Loading branch information
2 people authored and liuyanyi committed Oct 6, 2024
1 parent 983687b commit 69b11fa
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 69b11fa

Please sign in to comment.