-
Notifications
You must be signed in to change notification settings - Fork 3k
Support downloading specific splits in load_dataset
#7858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CloseChoice
wants to merge
13
commits into
huggingface:main
Choose a base branch
from
CloseChoice:single-split-download-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support downloading specific splits in load_dataset
#7858
CloseChoice
wants to merge
13
commits into
huggingface:main
from
CloseChoice:single-split-download-support
Conversation
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
…lit-download-support
lhoestq
reviewed
Nov 10, 2025
Member
lhoestq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great ! Will try to review this asap :)
@ArjunJagdale you should check this out
Contributor
|
@CloseChoice This looks great! You're absolutely right about the missing comparison - that's a critical bug I missed. |
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.
This is PR builds on top of #7706 to revive the unfinished #6832 but isn't just cleaning up things, here are some important changes:
download_mode="FORCE_REDOWNLOAD"is interpreted as always creating a clean slate, that means that even if we already did:This makes sure that only the train dataset is available after executing both. This was different in the original PR, which proposed that train and test would be available.
download_mode="REUSE_DATASET_IF_EXISTS"is interpreted as only ever adding new data, never redownloading OR deleting other splits. This was different in the original PR, whereresulted in only the train data being available, which I deem very unintuitive and probably not what users want. Also I argue that this is just the first step to a more user friendly partial loading when specifying percentages (or maybe even single instances) via the ReadInstructions, and then doing
should result IMO in the whole dataset being cached locally without redownloads.
Furthermore this PR fixes a couple issues with the previous PR, e.g. a missing comparison and adding tests for the proposed changes in behaviour, which would both fail on @ArjunJagdale's original PR.
Todo:
Future outlook (just my opinions and up for debate):
As mentioned before, I would see this as just a step towards the feature of partial percentage loading (though how the API should behave in that case is not entirely clear for me now) and maybe we could introduce another
download_mode="FORCE_REDOWNLOAD_SPLIT", which makes sure that even if a split is specified, only the referenced split is redownloaded and everything else left unchanged, this would then allow users more granular control over what they want to redownload.@lhoestq very curious to get your opinion on this.