dockyard_rl.data.processors¶
Contains data processors for training and evaluation.
Module Contents¶
Functions¶
Process a HelpSteer3 preference datum into a DatumSpec for GRPO training. |
|
Process a datum dictionary for SFT training. |
|
Process a datum dictionary for RM/DPO training. |
|
Tokenize a single text prompt into a DatumSpec for evaluation rollouts. |
|
Process a datum dictionary (directly loaded from dataset) into a DatumSpec for the Math Environment. |
|
Process a datum dictionary (directly loaded from data/hf_datasets/openmathinstruct2.py) into a DatumSpec for the Reward Model Environment. |
|
Process a datum dictionary (directly loaded from response_datasets/<dataset_name>.py) into a DatumSpec for the VLM Environment. |
|
Process a datum dictionary (directly loaded from dataset) into a DatumSpec for multiple-choice problems. |
|
Process a SWE-bench row (from |
|
Process a SWE-bench Pro row (from |
|
Process a Terminal-Bench row (from |
|
Process a ProgramBench row (from |
|
Process an HLE row (from |
|
Process a GDPval row (from |
|
Process a GDPval agentic row (from |
|
Process a datum dictionary (directly loaded from dataset) into a DatumSpec for Gym. |
|
Data¶
API¶
- dockyard_rl.data.processors.TokenizerType¶
None
- dockyard_rl.data.processors.helpsteer3_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a HelpSteer3 preference datum into a DatumSpec for GRPO training.
This function converts HelpSteer3 preference data to work with GRPO by:
Using the context as the prompt
Using the preferred completion as the target response
Creating a reward signal based on preference scores
- dockyard_rl.data.processors.sft_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer, max_seq_length: int, idx: int, add_bos: bool = True, add_eos: bool = True, add_generation_prompt: bool = False) dockyard_rl.data.interfaces.DatumSpec¶
Process a datum dictionary for SFT training.
- dockyard_rl.data.processors.preference_preprocessor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer, max_seq_length: int, idx: int) dockyard_rl.data.interfaces.PreferenceDatumSpec¶
Process a datum dictionary for RM/DPO training.
- dockyard_rl.data.processors.text_preprocessor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_input_seq_length: int, idx: int = 0) dockyard_rl.data.interfaces.DatumSpec¶
Tokenize a single text prompt into a DatumSpec for evaluation rollouts.
The prompt text is
datum_dict["input"]; the optionaldatum_dict["ground_truth"]is threaded intoextra_env_infoso the scoring environment can verify the generated answer. Mirrors the prompt construction ofmath_data_processorso eval samples collate and roll out identically to training samples.
- dockyard_rl.data.processors.math_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a datum dictionary (directly loaded from dataset) into a DatumSpec for the Math Environment.
- dockyard_rl.data.processors.math_hf_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a datum dictionary (directly loaded from data/hf_datasets/openmathinstruct2.py) into a DatumSpec for the Reward Model Environment.
- dockyard_rl.data.processors.vlm_hf_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, processor: transformers.AutoProcessor, max_seq_length: int, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a datum dictionary (directly loaded from response_datasets/<dataset_name>.py) into a DatumSpec for the VLM Environment.
- dockyard_rl.data.processors.multichoice_qa_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a datum dictionary (directly loaded from dataset) into a DatumSpec for multiple-choice problems.
- dockyard_rl.data.processors.swe_bench_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a SWE-bench row (from
SWEBenchDataset.format_data) into a DatumSpec.The prompt is the system + user message log with no answer turn (the agent generates the fix at rollout time). The held-out test metadata is routed into
extra_env_infoso the reward function can verify the solution.
- dockyard_rl.data.processors.swe_bench_pro_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a SWE-bench Pro row (from
SWEBenchProDataset.format_data).The prompt is the system + user message log with no answer turn. The held-out scoring inputs — the per-instance image, harness scripts, the gold test checkout command, the selected test files, the named fail/pass tests, and the gold test/fix diffs — are routed into
extra_env_infoso the image-mode reward can score the solution without exposing them to the agent.
- dockyard_rl.data.processors.terminal_bench_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a Terminal-Bench row (from
TerminalBenchDataset._build_row).The prompt is the system + user message log with no answer turn. Everything the multi-turn environment needs — the image/Dockerfile + build context, the held-out
tests/(injected only at finish), the verifier command/mount/ result paths, timeouts, container env, network policy, and turn budget — is routed intoextra_env_info. The dict-valued fields are carried as JSON strings in the dataset row (Arrow cannot hold variable-key structs) and decoded back here.
- dockyard_rl.data.processors.program_bench_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a ProgramBench row (from
ProgramBenchDataset._build_row).The prompt is the system + user message log with no answer turn. The image ref, the held-out test branches (base64 tars + expected node IDs, carried as a JSON string since Arrow cannot hold variable-key structs), language, and the per-episode budgets are routed into
extra_env_infofor the multi-turn environment and the clean-rebuild grading reward.
- dockyard_rl.data.processors.hle_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process an HLE row (from
HLEDataset.format_data) into a DatumSpec.The prompt is the system (HLE response format) + user (question) message log with no answer turn. The gold answer, the question (needed by the LLM judge), and the answer type/category are routed into
extra_env_infofor the HLE verifier environment.
- dockyard_rl.data.processors.gdpval_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a GDPval row (from
GDPvalDataset.format_data) into a DatumSpec.The prompt is the system (text-deliverable instructions) + user (task prompt) message log with no answer turn. The task prompt and
rubric_json(needed by the rubric judge) plus occupation/sector are routed intoextra_env_info.
- dockyard_rl.data.processors.gdpval_agentic_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a GDPval agentic row (from
GDPvalAgenticDataset.format_data).The prompt is the system (tool-use instructions) + user (task prompt) message log with no answer turn. Everything the multi-turn file-producing environment needs — the container image, the deliverable/reference dirs, the turn/exec budgets, the task prompt and
rubric_jsonfor the judge, and any base64 reference files (carried as a JSON string since Arrow cannot hold variable-key structs) — is routed intoextra_env_info.
- dockyard_rl.data.processors.gym_data_processor(datum_dict: dict[str, Any], task_data_spec: dockyard_rl.data.interfaces.TaskDataSpec, tokenizer: dockyard_rl.data.processors.TokenizerType, max_seq_length: int | None, idx: int) dockyard_rl.data.interfaces.DatumSpec¶
Process a datum dictionary (directly loaded from dataset) into a DatumSpec for Gym.
Note: this processor is kept for registry compatibility but Gym integration is not a Dockyard target. The processor is deferred-importable without side effects.
- dockyard_rl.data.processors.PROCESSOR_REGISTRY: Dict[str, dockyard_rl.data.interfaces.TaskDataProcessFnCallable]¶
‘cast(…)’
- dockyard_rl.data.processors.register_processor(processor_name: str, processor_function: dockyard_rl.data.interfaces.TaskDataProcessFnCallable) None¶