Skip to content
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

Bug with filtered indices #5112

Closed
albertvillanova opened this issue Oct 14, 2022 · 3 comments · Fixed by #5113
Closed

Bug with filtered indices #5112

albertvillanova opened this issue Oct 14, 2022 · 3 comments · Fixed by #5113
Assignees
Labels
bug Something isn't working

Comments

@albertvillanova
Copy link
Member

albertvillanova commented Oct 14, 2022

Describe the bug

As reported by @partiallytyped (and by @Muennighoff):

There is an issue with the indices of a filtered dataset.

Steps to reproduce the bug

ds = Dataset.from_dict({"num": [0, 1, 2, 3]})
ds = ds.filter(lambda num: num % 2 == 0, input_columns="num", batch_size=2)
assert all(item["num"] % 2 == 0 for item in ds)

Expected results

The indices of the filtered dataset should correspond to the examples with "language" equals to "english".

Actual results

Indices to items with other languages are included in the filtered dataset indices

Preliminar investigation

It seems a bug introduced by:

@albertvillanova
Copy link
Member Author

The issue is here:

for i, batch in enumerate(pbar):

@albertvillanova
Copy link
Member Author

@partiallytyped, @Muennighoff: the issue is fixed.

We are planning to make a patch release today.

@m-rph
Copy link

m-rph commented Oct 14, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants