Unverified Commit 71cced8a authored by vfbd's avatar vfbd Committed by GitHub
Browse files

OPTForCausalLM lm_head input size should be config.word_embed_proj_dim (#17225)

parent 56f50590
...@@ -786,7 +786,7 @@ class OPTForCausalLM(OPTPreTrainedModel): ...@@ -786,7 +786,7 @@ class OPTForCausalLM(OPTPreTrainedModel):
self.model = OPTModel(config) self.model = OPTModel(config)
# the lm_head weight is automatically tied to the embed tokens weight # the lm_head weight is automatically tied to the embed tokens weight
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False) self.lm_head = nn.Linear(config.word_embed_proj_dim, config.vocab_size, bias=False)
# Initialize weights and apply final processing # Initialize weights and apply final processing
self.post_init() self.post_init()
......
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