integrations#

class VisualDLCallback(vdl_writer=None)[source]#

Bases: TrainerCallback

A [TrainerCallback] that sends the logs to [VisualDL](https://www.paddlepaddle.org.cn/paddle/visualdl). :param vdl_writer: The writer to use. Will instantiate one if not set. :type vdl_writer: LogWriter, optional

on_train_begin(args, state, control, **kwargs)[source]#

Event called at the beginning of training.

on_log(args, state, control, logs=None, **kwargs)[source]#

Event called after logging the last logs.

on_train_end(args, state, control, **kwargs)[source]#

Event called at the end of training.

class TensorBoardCallback(tb_writer=None)[source]#

Bases: TrainerCallback

A [TrainerCallback] that sends the logs to [TensorBoard](https://www.tensorflow.org/tensorboard).

Parameters:

tb_writer (SummaryWriter, optional) – The writer to use. Will instantiate one if not set.

on_train_begin(args, state, control, **kwargs)[source]#

Event called at the beginning of training.

on_log(args, state, control, logs=None, **kwargs)[source]#

Event called after logging the last logs.

on_train_end(args, state, control, **kwargs)[source]#

Event called at the end of training.

class WandbCallback[source]#

Bases: TrainerCallback

A [TrainerCallback] that logs metrics, media, model checkpoints to [Weight and Biases](https://www.wandb.com/).

setup(args, state, model, **kwargs)[source]#

Setup the optional Weights & Biases (wandb) integration.

One can subclass and override this method to customize the setup if needed. variables: Environment: - WANDB_LOG_MODEL (str, optional, defaults to "false"):

Whether to log model and checkpoints during training. Can be "end", "checkpoint" or "false". If set to "end", the model will be uploaded at the end of training. If set to "checkpoint", the checkpoint will be uploaded every args.save_steps . If set to "false", the model will not be uploaded. Use along with [TrainingArguments.load_best_model_at_end] to upload best model.

  • WANDB_WATCH (str, optional defaults to "false"):

    Can be "gradients", "all", "parameters", or "false". Set to "all" to log gradients and parameters.

  • WANDB_PROJECT (str, optional, defaults to "PaddleNLP"):

    Set this to a custom string to store results in a different project.

  • WANDB_DISABLED (bool, optional, defaults to False):

    Whether to disable wandb entirely. Set WANDB_DISABLED=true to disable.

on_train_begin(args, state, control, model=None, **kwargs)[source]#

Event called at the beginning of training.

on_train_end(args, state, control, model=None, tokenizer=None, **kwargs)[source]#

Event called at the end of training.

on_log(args, state, control, model=None, logs=None, **kwargs)[source]#

Event called after logging the last logs.

on_save(args, state, control, **kwargs)[source]#

Event called after a checkpoint save.

class AutoNLPCallback[source]#

Bases: TrainerCallback

A [TrainerCallback] that sends the logs to [Ray Tune] for [AutoNLP]

on_evaluate(args, state, control, **kwargs)[source]#

Event called after an evaluation phase.