Datasets

class lighteval.data.DynamicBatchDataset

< >

( requests: list num_dataset_splits: int )

get_original_order

< >

( new_arr: list ) list

Parameters

  • newarr (list) — Array containing any kind of data that needs to be reset in the original order.

Returns

list

new_arr in the original order.

Get the original order of the data.

get_split_start_end

< >

( split_id: int ) tuple

Parameters

  • split_id (int) — The ID of the split.

Returns

tuple

A tuple containing the start and end indices of the split.

Get the start and end indices of a dataset split.

splits_start_end_iterator

< >

( ) tuple

Yields

tuple

Iterator that yields the start and end indices of each dataset split. Also updates the starting batch size for each split (trying to double the batch every time we move to a new split).

class lighteval.data.LoglikelihoodDataset

< >

( requests: list num_dataset_splits: int )

class lighteval.data.LoglikelihoodSingleTokenDataset

< >

( requests: list num_dataset_splits: int )

class lighteval.data.GenerativeTaskDataset

< >

( requests: list num_dataset_splits: int )

init_split_limits

< >

( num_dataset_splits ) type

Parameters

  • num_dataset_splits (type) — description

Returns

type

description

Initialises the split limits based on generation parameters. The splits are used to estimate time remaining when evaluating, and in the case of generative evaluations, to group similar samples together.

For generative tasks, self._sorting_criteria outputs:

In the current function, we create evaluation groups by generation parameters (logits and eos), so that samples with similar properties get batched together afterwards. The samples will then be further organised by length in each split.

class lighteval.data.GenerativeTaskDatasetNanotron

< >

( requests: list num_dataset_splits: int )

class lighteval.data.GenDistributedSampler

< >

( dataset: Dataset num_replicas: typing.Optional[int] = None rank: typing.Optional[int] = None shuffle: bool = True seed: int = 0 drop_last: bool = False )

A distributed sampler that copy the last element only when drop_last is False so we keep a small padding in the batches as our samples are sorted by length.

< > Update on GitHub