Dataset
PyTorch-compatible dataset class for rLLM.Constructor
list[dict[str, Any]]
List of dictionaries containing dataset examples.
str | None
Optional name for the dataset.
str | None
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.int
Number of times to repeat the dataset.
shuffle
Shuffle the dataset.int | None
Random seed for reproducibility.
select
Select a subset of the dataset.list[int] | range
Indices to select.
load_data
Load dataset from a file.str
Path to dataset file (.json, .jsonl, .parquet).
DatasetRegistry
Global registry for managing datasets.Methods
register_dataset
Register a dataset.str
Dataset name.
str
Split name (“train”, “test”, “val”).
str
Absolute path to dataset file.
load_dataset
Load a registered dataset.str
Dataset name.
str
Split name.
Dataset | None
Loaded dataset, or None if not found.
list_datasets
List all registered datasets.dict
Dictionary mapping dataset names to splits and paths.

