Skip to content
Repo

HarborDataset

from modal_training_gym.common.dataset import HarborDataset

A dataset loaded from Harbor tasks.

Attributes

dataset_id str

Dataset ID. Default: ""

input_key str

Prompt column name. Default: ""

label_key str

Ground-truth column name. Default: ""

output_format str

On-disk format written by prepare(), either parquet or jsonl. Default: "parquet"

apply_chat_template bool

Apply the model's chat template. Default: True

always_prepare bool

Rerun prepare() when the output path exists. Default: False

writes_eval_paths bool

Whether prepare() must materialize every eval_paths entry. Default: True

dataset_name str

Harbor dataset ID. Default: ""

path str | None

Local Harbor dataset path.

task_root str

Local directory containing Harbor tasks. Default: ""

task_glob str

Glob used to select task directories. Default: "*"

task_names list[str] | None

Explicit task directory names to select.

instruction_path str

Relative path to each task instruction. Default: "instruction.md"

label_metadata_path str | None

Relative JSON or TOML metadata path.

test_data_dir str | None

Relative directory containing test data.

prompt_template str

Template applied to each task instruction. Default: "{instruction}"

system_prompt str

System message added to each prompt. Default: ""

train_size int | None

Number of tasks in the training split.

eval_size int | None

Number of tasks in the evaluation split.

train_repeats int

Repetitions of each training row. Default: 1

eval_repeats int

Repetitions of each evaluation row. Default: 1

shuffle_tasks bool

Shuffle tasks before splitting. Default: False

shuffle_seed int

Seed used to shuffle tasks. Default: 0

load(split: Literal['all', 'train', 'eval'] = 'all') -> Any

Load raw examples, optionally filtered by split.

Returns

Raw examples for split.

name: str
prepare(path: str, eval_paths: dict[str, str] | None = None) -> None

Materialize training data at path and evaluation data at eval_paths.

to_pandas(*, formatted: bool = False)
validate_prepared(path: str) -> None

Validate the prepared file format and required columns.