From 2838d6b38e1e37b303b01f2af0a9ddee2dd66f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Vre=C5=A1?= <56541137+domenVres@users.noreply.github.com> Date: Fri, 4 Oct 2024 01:53:29 +0200 Subject: [PATCH] [Bugfix] Weight loading fix for OPT model (#9042) Co-authored-by: dvres --- 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 88d2bcb9..47bc8adc 100644 --- a/vllm/model_executor/models/opt.py +++ b/vllm/model_executor/models/opt.py @@ -353,7 +353,7 @@ class OPTForCausalLM(nn.Module): ] 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