MCPcopy Create free account
hub / github.com/OpenSparseLLMs/MoM / create_iterator

Function create_iterator

lm-eval-harness/lm_eval/utils.py:429–435  ·  view source on GitHub ↗

Method for creating a (potentially) sliced and limited iterator from a raw document iterator. Used for splitting data among ranks in multigpu setting or only pulling a sample of documents

(raw_iterator, rank, world_size, limit=None)

Source from the content-addressed store, hash-verified

427
428
429def create_iterator(raw_iterator, rank, world_size, limit=None):
430 """
431 Method for creating a (potentially) sliced and limited
432 iterator from a raw document iterator. Used for splitting data
433 among ranks in multigpu setting or only pulling a sample of documents
434 """
435 return islice(raw_iterator, rank, limit, world_size)
436
437
438# Multi-token stopping criteria

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected