Repository navigation
Conversation
`IterableDataset.shuffle` grew a `max_buffer_input_shards` argument in huggingface#8194 and the dict wrapper was not updated, so calling it on the result of `load_dataset(..., streaming=True)` raises TypeError. The same argument's docstring entry states the default as 101000; the signature says 10, and the streaming docs say 10.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
load_dataset(..., streaming=True)without a split returns anIterableDatasetDict, and shuffling it cannot reach the shard-interleaving control:#8194 added
max_buffer_input_shardstoIterableDataset.shuffleand updateddocs/source/stream.mdx, but notdataset_dict.py, so the per-split method has the argument and the dict wrapper silently does not. Every otherIterableDatasetDict.shuffleargument is forwarded.Second, smaller thing in the same argument
Its docstring entry in
iterable_dataset.pyreadsThe signature says
max_buffer_input_shards: int = 10, andstream.mdxsays "default is 10".101000is the10and the neighbouringbuffer_sizedefault of1000run together.The change
Accept the argument on
IterableDatasetDict.shufflewith the same default, document it with the same wording, and pass it to each split. Fix the stated default in theIterableDataset.shuffledocstring.Test
test_iterable_dataset_dict_shuffle_forwards_max_buffer_input_shardsintests/test_iterable_dataset.py, next to the existingtest_iterable_dataset_shuffle_buffer_uses_multiple_input_shardsand using its assertion: withmax_buffer_input_shards=1the first ten examples must come from at most two shards, which only holds if the argument reaches the split.ruff checkandruff format --checkare clean on the three files.