Skip to content

Commit

Permalink
fix documentation for CustomTrainer (huggingface#25635)
Browse files Browse the repository at this point in the history
fix doc
  • Loading branch information
minhtriet authored and parambharat committed Sep 26, 2023
1 parent a01e0f9 commit 331c5c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/en/main_classes/trainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ from transformers import Trainer

class CustomTrainer(Trainer):
def compute_loss(self, model, inputs, return_outputs=False):
labels = inputs.get("labels")
labels = inputs.pop("labels")
# forward pass
outputs = model(**inputs)
logits = outputs.get("logits")
Expand Down

0 comments on commit 331c5c6

Please sign in to comment.