Skip to content
SurogateSurogateDocs
↑↓ to move↵ to openesc to close

Local datasets and column mapping

This example shows how to train on your own local files, even when their columns don’t match the default names. mixed.yaml combines two local training files and a separate validation file. All paths are relative to the repository root:

bash
surogate tokenize examples/datasets/mixed.yaml --debug
surogate sft examples/datasets/mixed.yaml
  • instructions.jsonl: maps task, context, and answer to instruction/input/output and supplies a fixed system prompt.
  • conversations.jsonl: maps the dialog column to chat messages.
  • validation.jsonl: a separate held-out example, so the training data isn’t split again for validation.

The small fixtures show data shapes and token masking; replace them for real training. sample_packing: false keeps the tiny samples separate so you can inspect them (--debug prints each token with its label); most model recipes enable packing. The tokenizer formats instruction and conversation data for you and, under the default loss scale, masks every token that isn’t from the assistant. Raw type: text data is shown in pretraining, type: preference in DPO, and automatic dataset detection in the model recipes.

For chat datasets split into prompt and completion message arrays, use messages_field: prompt and completion_field: completion, as in the reverse-text recipe. Conversation datasets may also set system_field, tools_field, and message_property_mappings; see the dataset guide for their expected shapes.

Next: the config reference lists every dataset option, including packing and validation splits.