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

Weird-ish: Not creating unique caches for different phases #186

Closed
zphang opened this issue May 23, 2020 · 2 comments
Closed

Weird-ish: Not creating unique caches for different phases #186

zphang opened this issue May 23, 2020 · 2 comments

Comments

@zphang
Copy link

zphang commented May 23, 2020

Sample code:

import nlp
dataset = nlp.load_dataset('boolq')

def func1(x):
    return x

def func2(x):
    return None

train_output = dataset["train"].map(func1)
valid_output = dataset["validation"].map(func1)
print()
print(len(train_output), len(valid_output))
# Output: 9427 9427

The map method in both cases seem to be pointing to the same cache, so the latter call based on the validation data will return the processed train data cache.

What's weird is that the following doesn't seem to be an issue:

train_output = dataset["train"].map(func2)
valid_output = dataset["validation"].map(func2)
print()
print(len(train_output), len(valid_output))
# 9427 3270
@lhoestq
Copy link
Member

lhoestq commented May 23, 2020

Looks like a duplicate of #120.
This is already fixed on master. We'll do a new release on pypi soon

@zphang
Copy link
Author

zphang commented May 23, 2020

Good catch, it looks fixed.

@zphang zphang closed this as completed May 23, 2020
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

No branches or pull requests

2 participants