Skip to content

Commit 2838d6b

Browse files
domenVresdvres
and
dvres
authored
[Bugfix] Weight loading fix for OPT model (#9042)
Co-authored-by: dvres <dvres@fri.uni-lj.si>
1 parent 91add85 commit 2838d6b

File tree

1 file changed

+1
-1
lines changed
  • vllm/model_executor/models

1 file changed

+1
-1
lines changed

vllm/model_executor/models/opt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]):
353353
]
354354
params_dict = dict(self.named_parameters(remove_duplicate=False))
355355
for name, loaded_weight in weights:
356-
if "lm_head.weight" in name:
356+
if "lm_head.weight" in name and self.config.tie_word_embeddings:
357357
continue
358358
if name.startswith("decoder."):
359359
name = "model." + name

0 commit comments

Comments
 (0)