Dataset
PyTorch-compatible dataset class for rLLM.Constructor
List of dictionaries containing dataset examples.
Optional name for the dataset.
Optional split name (e.g., “train”, “test”, “val”).
Methods
len
Get the number of examples.getitem
Get an item by index.get_data
Get the raw dataset list.repeat
Repeat the dataset n times.Number of times to repeat the dataset.
shuffle
Shuffle the dataset.Random seed for reproducibility.
select
Select a subset of the dataset.Indices to select.
load_data
Load dataset from a file.Path to dataset file (.json, .jsonl, .parquet).
DatasetRegistry
Global registry for managing datasets.Methods
register_dataset
Register a dataset.Dataset name.
Split name (“train”, “test”, “val”).
Absolute path to dataset file.
load_dataset
Load a registered dataset.Dataset name.
Split name.
Loaded dataset, or None if not found.
list_datasets
List all registered datasets.Dictionary mapping dataset names to splits and paths.

