Skip to content

Commit 612bfd0

Browse files
committed
[Phi] bias should be True (#35650)
bias should be True
1 parent 6bc0fbc commit 612bfd0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/transformers/models/phi/modeling_phi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ def __init__(self, config):
724724
super().__init__(config)
725725
self.model = PhiModel(config)
726726
self.vocab_size = config.vocab_size
727-
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
727+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=True)
728728

729729
# Initialize weights and apply final processing
730730
self.post_init()

src/transformers/models/phi/modular_phi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,9 @@ def forward(
284284

285285

286286
class PhiForCausalLM(LlamaForCausalLM):
287-
pass
287+
def __init__(self, config):
288+
super().__init__(config)
289+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=True)
288290

289291

290292
class PhiForSequenceClassification(LlamaForSequenceClassification):

0 commit comments

Comments
 (0)