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)
| 427 | |
| 428 | |
| 429 | def 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 |
nothing calls this directly
no outgoing calls
no test coverage detected