Skip to content

Fix index out of bound error with original_shard_lengths.#7987

Closed
jonathanasdf wants to merge 1 commit intohuggingface:mainfrom
jonathanasdf:patch-1
Closed

Fix index out of bound error with original_shard_lengths.#7987
jonathanasdf wants to merge 1 commit intohuggingface:mainfrom
jonathanasdf:patch-1

Conversation

@jonathanasdf
Copy link
Copy Markdown

I have gotten the following error

    original_shard_lengths[original_shard_id] += 1
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Not sure what causes it, but this fixes the error. This may not be the proper fix for the root cause though.

I have gotten the following error

```
    original_shard_lengths[original_shard_id] += 1
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
```

Not sure what causes it, but this fixes the error. This may not be the proper fix for the root cause though.
@lhoestq
Copy link
Copy Markdown
Member

lhoestq commented Mar 9, 2026

this was fixed in #8023, sorry I didn't see your PR and took the liberty of fixing this bug as part of this improvement for from_generator

@lhoestq lhoestq closed this Mar 9, 2026
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.

2 participants