Skip to content

Commit 0f63c32

Browse files
huzaifa-jawad367stevhliu
authored andcommitted
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 6d41365 commit 0f63c32

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
@@ -456,6 +456,8 @@ class TrainingArguments:
456456
Will eventually default to the list of argument names accepted by the model that contain the word "label",
457457
except if the model used is one of the `XxxForQuestionAnswering` in which case it will also include the
458458
`["start_positions", "end_positions"]` keys.
459+
460+
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).
459461
load_best_model_at_end (`bool`, *optional*, defaults to `False`):
460462
Whether or not to load the best model found during training at the end of training. When this option is
461463
enabled, the best checkpoint will always be saved. See

0 commit comments

Comments
 (0)