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.
Traineris possible by setting environment variables. A full list of W&B environment variables can be found here.
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.
initis below. For more details on how to use
wandb.init, check out the reference documentation.