Skip to content

Commit

Permalink
update to not(endswith(loss))
Browse files Browse the repository at this point in the history
  • Loading branch information
miivanov90 committed May 30, 2024
1 parent 5e5c4d6 commit 7bac7a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transformers/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ class TrainingArguments:
Use in conjunction with `load_best_model_at_end` and `metric_for_best_model` to specify if better models
should have a greater metric or not. Will default to:
- `True` if `metric_for_best_model` is set to a value that isn't `"loss"` or `"eval_loss"`.
- `False` if `metric_for_best_model` is not set, or set to `"loss"` or `"eval_loss"`.
- `True` if `metric_for_best_model` is set to a value that doesn't end in `"loss"`.
- `False` if `metric_for_best_model` is not set, or set to a value that ends in `"loss"`.
ignore_data_skip (`bool`, *optional*, defaults to `False`):
When resuming training, whether or not to skip the epochs and batches to get the data loading at the same
stage as in the previous training. If set to `True`, the training will begin faster (as that skipping step
Expand Down Expand Up @@ -1582,7 +1582,7 @@ def __post_init__(self):
) and self.metric_for_best_model is None:
self.metric_for_best_model = "loss"
if self.greater_is_better is None and self.metric_for_best_model is not None:
self.greater_is_better = self.metric_for_best_model not in ["loss", "eval_loss"]
self.greater_is_better = not(self.metric_for_best_model.endswith("loss"))
if self.run_name is None:
self.run_name = self.output_dir
if self.framework == "pt" and is_torch_available():
Expand Down

0 comments on commit 7bac7a8

Please sign in to comment.