Skip to content

fix low but large example indexerror#7912

Merged
lhoestq merged 1 commit intohuggingface:mainfrom
CloseChoice:fix-error
Jan 9, 2026
Merged

fix low but large example indexerror#7912
lhoestq merged 1 commit intohuggingface:mainfrom
CloseChoice:fix-error

Conversation

@CloseChoice
Copy link
Copy Markdown
Contributor

Fixes #7911.

This PR simply implements the approach outlined in the corresponding issue, that if we have large examples, the number of shards should never be more than the number of samples. This is an absolute edge case, but can happen for image data.

Copy link
Copy Markdown
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :)

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

@lhoestq lhoestq merged commit 6a1bc35 into huggingface:main Jan 9, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexError when saving few large examples to disk

3 participants