".github/vscode:/vscode.git/clone" did not exist on "0d7c4790235ac00b4524b492bc2a680dcc5cf6b0"
Unverified Commit fe3be159 authored by ylying's avatar ylying Committed by GitHub
Browse files

Add qwen2 tie word embedding (#630)

parent 0aa189f1
...@@ -313,6 +313,8 @@ class Qwen2ForCausalLM(nn.Module): ...@@ -313,6 +313,8 @@ class Qwen2ForCausalLM(nn.Module):
param = params_dict[name] param = params_dict[name]
weight_loader = getattr(param, "weight_loader", default_weight_loader) weight_loader = getattr(param, "weight_loader", default_weight_loader)
weight_loader(param, loaded_weight) weight_loader(param, loaded_weight)
if self.config.tie_word_embeddings and name=="model.embed_tokens.weight":
weight_loader(params_dict["lm_head.weight"], loaded_weight)
EntryClass = Qwen2ForCausalLM EntryClass = Qwen2ForCausalLM
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment