integrations#

class VisualDLCallback(vdl_writer=None)[源代码]#

基类: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)[源代码]#

Event called at the beginning of training.

on_log(args, state, control, logs=None, **kwargs)[源代码]#

Event called after logging the last logs.

on_train_end(args, state, control, **kwargs)[源代码]#

Event called at the end of training.

class TensorBoardCallback(tb_writer=None)[源代码]#

基类:TrainerCallback

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

参数:

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

on_train_begin(args, state, control, **kwargs)[源代码]#

Event called at the beginning of training.

on_log(args, state, control, logs=None, **kwargs)[源代码]#

Event called after logging the last logs.

on_train_end(args, state, control, **kwargs)[源代码]#

Event called at the end of training.

class WandbCallback[源代码]#

基类:TrainerCallback

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

setup(args, state, model, **kwargs)[源代码]#

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)[源代码]#

Event called at the beginning of training.

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

Event called at the end of training.

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

Event called after logging the last logs.

on_save(args, state, control, **kwargs)[源代码]#

Event called after a checkpoint save.

class AutoNLPCallback[源代码]#

基类:TrainerCallback

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

on_evaluate(args, state, control, **kwargs)[源代码]#

Event called after an evaluation phase.