wandblibrary and log in
WANDB_PROJECTenvironment variable to the name of your project. The
WandbCallbackwill pick up this project name environment variable and use it when setting up your run.
Trainertraining arguments, either inside your code or from the command line, set
"wandb"in order enable logging with Weights & Biases.
Traineryou 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=Trueis 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.
gradients: Log histograms of the gradients (default)
all: Log histograms of gradients and parameters
false: No gradient or parameter logging
trueto disable logging entirely (
trueto silence the output printed by wandb (
Traineruses will call
wandb.initunder the hood when
Traineris initialized. You can alternatively set up your runs manually by calling
Traineris initialized. This gives you full control over your W&B run configuration.