Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/transformers/integrations/integration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,14 @@ def setup(self, args, state, model, **kwargs):
if trial_name is not None:
init_args["name"] = trial_name
init_args["group"] = args.run_name
else:
if not (args.run_name is None or args.run_name == args.output_dir):
init_args["name"] = args.run_name
elif args.run_name is not None:
init_args["name"] = args.run_name
Copy link
Contributor

@parambharat parambharat Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @qubvel : One suggestion. Since this is changing the expectation for some W&B users can we add the following warning?

self._wandb.termwarn("Please set `TrainingArguments.run_name` to specify the W&B run name. If unset, `TrainingArguments.output_dir` will be used by default.", repeat=False)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, added with a bit different wording:

self._wandb.termwarn(
   "The `run_name` is currently set to the same value as `TrainingArguments.output_dir`. If this was "
   "not intended, please specify a different run name by setting the `TrainingArguments.run_name` parameter.",
   repeat=False,
)

if args.run_name == args.output_dir:
self._wandb.termwarn(
"The `run_name` is currently set to the same value as `TrainingArguments.output_dir`. If this was "
"not intended, please specify a different run name by setting the `TrainingArguments.run_name` parameter.",
repeat=False,
)

if self._wandb.run is None:
self._wandb.init(
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ class TrainingArguments:
the past hidden states for their predictions. If this argument is set to a positive int, the `Trainer` will
use the corresponding output (usually index 2) as the past state and feed it to the model at the next
training step under the keyword argument `mems`.
run_name (`str`, *optional*):
run_name (`str`, *optional*, defaults to `output_dir`):
A descriptor for the run. Typically used for [wandb](https://www.wandb.com/) and
[mlflow](https://www.mlflow.org/) logging.
[mlflow](https://www.mlflow.org/) logging. If not specified, will be the same as `output_dir`.
disable_tqdm (`bool`, *optional*):
Whether or not to disable the tqdm progress bars and table of metrics produced by
[`~notebook.NotebookTrainingTracker`] in Jupyter Notebooks. Will default to `True` if the logging level is
Expand Down