Skip to content

Commit 8708917

Browse files
authored
[Phi] bias should be True (#35650)
bias should be True
1 parent 91f14f1 commit 8708917

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
@@ -727,7 +727,7 @@ def __init__(self, config):
727727
super().__init__(config)
728728
self.model = PhiModel(config)
729729
self.vocab_size = config.vocab_size
730-
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
730+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=True)
731731

732732
# Initialize weights and apply final processing
733733
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)