wandb
library and log inWANDB_PROJECT
environment variable to the name of your project. The WandbCallback
will pick up this project name environment variable and use it when setting up your run.Trainer
.Trainer
training arguments, either inside your code or from the command line, set report_to
to "wandb"
in order enable logging with Weights & Biases.run_name
argument.Trainer
for the TensorFlow TFTrainer
.wandb.finish()
.WANDB_LOG_MODEL
to true
.run-{run_name}
.Trainer
you initialize from now on will upload models to your W&B project. Your model file will be viewable through the W&B Artifacts UI. See the Weights & Biases' Artifacts guide for more about how to use Artifacts for model and dataset versioning.load_best_model_at_end=True
is passed to Trainer
, then W&B will save the best performing model checkpoint to Artifacts instead of the final checkpoint.WANDB_LOG_MODEL
, you can download your model weights for additional training or to run inference. You just load them back into the same Hugging Face architecture that you used before.Trainer
is possible by setting environment variables. A full list of W&B environment variables can be found here.WANDB_PROJECT
WANDB_LOG_MODEL
false
by default)WANDB_WATCH
gradients
: Log histograms of the gradients (default)all
: Log histograms of gradients and parametersfalse
: No gradient or parameter loggingWANDB_DISABLED
true
to disable logging entirely (false
by default)WANDB_SILENT
true
to silence the output printed by wandb (false
by default)wandb.init
WandbCallback
that Trainer
uses will call wandb.init
under the hood when Trainer
is initialized. You can alternatively set up your runs manually by calling wandb.init
before theTrainer
is initialized. This gives you full control over your W&B run configuration.init
is below. For more details on how to use wandb.init
, check out the reference documentation.Trainer
is taken care of by the WandbCallback
(reference documentation) in the Transformers library. If you need to customize your Hugging Face logging you can modify this callback.