Skip to content

Commit 8365f70

Browse files
DOCS: Clarification on the use of label_names as an argument to TrainingArguments (#40353)
* Update trainer.md * Update trainer.md Removed the detail about label_names argument usage from the tip/ warning section * Update training_args.py Added the label_names usage clarification in the docstring * Update trainer.md --------- Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
1 parent 7c1169e commit 8365f70

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/transformers/training_args.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ class TrainingArguments:
453453
Will eventually default to the list of argument names accepted by the model that contain the word "label",
454454
except if the model used is one of the `XxxForQuestionAnswering` in which case it will also include the
455455
`["start_positions", "end_positions"]` keys.
456+
457+
You should only specify `label_names` if you're using custom label names or if your model's `forward` consumes multiple label tensors (e.g., extractive QA).
456458
load_best_model_at_end (`bool`, *optional*, defaults to `False`):
457459
Whether or not to load the best model found during training at the end of training. When this option is
458460
enabled, the best checkpoint will always be saved. See

0 commit comments

Comments
 (0)