View on GitHub
"```python\nfrom modal_training_gym.common.dataset import DatasetConfig\n```\n\nDataset configuration shared across training frameworks.\n\nDescribes *what* the data is. Where it gets written on disk is decided\nby the recipe/launcher layer, not by the dataset itself.\n\n## Fields\n\n| Field | Type | Default | Description |\n|-------|------|---------|-------------|\n| `dataset_id` | `str` | `\"\"` | |\n| `input_key` | `str` | `\"\"` | |\n| `label_key` | `str` | `\"\"` | |\n| `apply_chat_template` | `bool` | `True` | |\n| `always_prepare` | `bool` | `False` | |\n| `writes_eval_paths` | `bool` | `True` | |\n\n## Methods\n\n### `load(self, split: \"Literal['all', 'train', 'eval']\" = 'all') -> 'Any'`\n\nLoad raw examples, optionally filtered by split.\n\n### `prepare(self, path: 'str', eval_paths: 'dict[str, str] | None' = None) -> 'None'`\n\nMaterialize training data to `path` (and eval splits to `eval_paths`).\n\n### `validate_prepared(self, path: 'str') -> 'None'`\n\nSniff what `prepare()` wrote and confirm the columns the framework will index.\n\n## Related Tutorials\n\n- [Multi-turn number-guessing RL with custom generate and reward functions](/tutorials/rl/002_multiturn/)\n\n**Source:** [`modal_training_gym/common/dataset.py`](https://github.com/modal-projects/training-gym/blob/main/modal_training_gym/common/dataset.py)\n"
DatasetConfig
Dataset configuration shared across training frameworks.
from modal_training_gym.common.dataset import DatasetConfigDataset configuration shared across training frameworks.
Describes what the data is. Where it gets written on disk is decided by the recipe/launcher layer, not by the dataset itself.
Fields
Section titled “Fields”| Field | Type | Default | Description |
|---|---|---|---|
dataset_id | str | "" | |
input_key | str | "" | |
label_key | str | "" | |
apply_chat_template | bool | True | |
always_prepare | bool | False | |
writes_eval_paths | bool | True |
Methods
Section titled “Methods”load(self, split: "Literal['all', 'train', 'eval']" = 'all') -> 'Any'
Section titled “load(self, split: "Literal['all', 'train', 'eval']" = 'all') -> 'Any'”Load raw examples, optionally filtered by split.
prepare(self, path: 'str', eval_paths: 'dict[str, str] | None' = None) -> 'None'
Section titled “prepare(self, path: 'str', eval_paths: 'dict[str, str] | None' = None) -> 'None'”Materialize training data to path (and eval splits to eval_paths).
validate_prepared(self, path: 'str') -> 'None'
Section titled “validate_prepared(self, path: 'str') -> 'None'”Sniff what prepare() wrote and confirm the columns the framework will index.