# tinker_cookbook.supervised.ChatDatasetBuilder

## _class_ [**tinker_cookbook.supervised.ChatDatasetBuilder**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/types.py#L100) (_[SupervisedDatasetBuilder](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/supervised/superviseddatasetbuilder/)_)

Build a chat dataset that uses a renderer to tokenise message lists.

Subclasses must implement `__call__` to return the concrete datasets.

**Fields:**

- [**common_config**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/types.py#L110) (_[ChatDatasetBuilderCommonConfig](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/supervised/chatdatasetbuildercommonconfig/)_)

### [**__call__**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/types.py#L112)()

Build and return (train_dataset, eval_dataset).

**Returns:** _tuple[ [SupervisedDataset](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/supervised/superviseddataset/), [SupervisedDataset](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/supervised/superviseddataset/) | None]_ – Training dataset and an optional evaluation dataset.

### _property_ [**tokenizer**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/types.py#L122)

Get the tokenizer for this dataset's model.

**Returns:** _Tokenizer_

### _property_ [**renderer**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/supervised/types.py#L127)

Get the renderer for this dataset's model.

**Returns:** _renderers. [Renderer](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/renderers/renderer/)_

## Referenced by

- [tinker_cookbook.preference.Config](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/preference/config/)
- [tinker_cookbook.supervised.FromConversationFileBuilder](https://tinker-docs.thinking-machines-lab/tinker-cookbook/api-reference/supervised/fromconversationfilebuilder/)
