# core.trainers.base

`core.trainers.base`

Module for customized trainers

## Classes

Name | Description
--- | ---
AxolotlTrainer | Extend the base Trainer for axolotl helpers

### AxolotlTrainer

    core.trainers.base.AxolotlTrainer(
        *_args,
        bench_data_collator=None,
        eval_data_collator=None,
        dataset_tags=None,
        **kwargs,
    )

Extend the base Trainer for axolotl helpers

#### Methods

Name | Description
--- | ---
log | Log `logs` on the various objects watching training, including stored metrics.
push_to_hub | Overwrite the `push_to_hub` method in order to force-add the tags when pushing the
store_metrics | Store metrics with specified reduction type.

##### log

    core.trainers.base.AxolotlTrainer.log(logs, start_time=None)

Log `logs` on the various objects watching training, including stored metrics.

###### Parameters

Name | Type | Description | Default
--- | --- | --- | ---
logs | dict[str, float] | The values to log. | required
start_time | float | None | The start of training. | `None`

##### push_to_hub

    core.trainers.base.AxolotlTrainer.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.

##### store_metrics

    core.trainers.base.AxolotlTrainer.store_metrics(
        metrics,
        train_eval='train',
        reduction='mean',
    )

Store metrics with specified reduction type.

###### Parameters

Name | Type | Description | Default
--- | --- | --- | ---
metrics | dict[str, float] | dict[str, tuple[int | float, str]] | Dictionary of metric names to values, or metric names to (value, reduction_type) tuples. | required
train_eval | Literal['train', 'eval'] | Whether this is for training or evaluation. | `'train'`