From 66d6f52670d32f95a25befa75170908e488330ed Mon Sep 17 00:00:00 2001 From: dvres Date: Thu, 3 Oct 2024 13:30:31 +0200 Subject: [PATCH] Fixed load_weights for models with untied embeddings --- vllm/model_executor/models/opt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/model_executor/models/opt.py b/vllm/model_executor/models/opt.py index 88d2bcb9f0c9..47bc8adc3bc1 100644 --- a/vllm/model_executor/models/opt.py +++ b/vllm/model_executor/models/opt.py @@ -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