AzizBelaweid commited on
Commit
f770805
·
verified ·
1 Parent(s): 1ed562f

fix labels

Browse files
Files changed (1) hide show
  1. modeling_pharia.py +1 -1
modeling_pharia.py CHANGED
@@ -774,7 +774,7 @@ class PhariaForCausalLM(PhariaPreTrainedModel):
774
  if self.training and labels is not None:
775
  # Shift logits and labels for causal language modeling
776
  shift_logits = logits[..., :-1, :].contiguous()
777
- shift_labels = outputs['labels'][..., 1:].contiguous()
778
 
779
  # Flatten the tokens
780
  shift_logits = shift_logits.view(-1, shift_logits.size(-1))
 
774
  if self.training and labels is not None:
775
  # Shift logits and labels for causal language modeling
776
  shift_logits = logits[..., :-1, :].contiguous()
777
+ shift_labels = labels[..., 1:].contiguous()
778
 
779
  # Flatten the tokens
780
  shift_logits = shift_logits.view(-1, shift_logits.size(-1))