# core.trainers.dpo.trainer

`core.trainers.dpo.trainer`

DPO trainer for axolotl

## Classes

Name | Description
--- | ---
AxolotlDPOTrainer | Extend the base DPOTrainer for axolotl helpers

### AxolotlDPOTrainer

    core.trainers.dpo.trainer.AxolotlDPOTrainer(
        self,
        *args,
        dataset_tags=None,
        **kwargs,
    )

Extend the base DPOTrainer for axolotl helpers

#### Methods

Name | Description
--- | ---
evaluation_loop | Overriding built-in evaluation loop to store metrics for each batch.
push_to_hub | Overwrite the `push_to_hub` method in order to force-add the tags when pushing the

##### evaluation_loop

    core.trainers.dpo.trainer.AxolotlDPOTrainer.evaluation_loop(
        dataloader,
        description,
        prediction_loss_only=None,
        ignore_keys=None,
        metric_key_prefix='eval',
    )

Overriding built-in evaluation loop to store metrics for each batch. Prediction/evaluation loop, shared by `Trainer.evaluate()` and `Trainer.predict()`.

Works both with or without labels.

##### push_to_hub

    core.trainers.dpo.trainer.AxolotlDPOTrainer.push_to_hub(*args, **kwargs)

Overwrite the `push_to_hub` method in order to force-add the tags when pushing the model on the Hub. Please refer to `~transformers.Trainer.push_to_hub` for more details.