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

added from_generator method to IterableDataset class. #5052

Merged

Conversation

hamid-vakilzadeh
Copy link
Contributor

Hello,

This resolves issues #4988.

I added a method from_generator to class IterableDataset.

I modified the read method of input stream generator to also return Iterable_dataset.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 3, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@mariosasko mariosasko left a comment

Choose a reason for hiding this comment

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

Great job, thanks!

Besides my comment below, we also need a test (let me know if you need help with that), and then we can merge.

src/datasets/io/generator.py Outdated Show resolved Hide resolved
@mariosasko mariosasko linked an issue Oct 3, 2022 that may be closed by this pull request
@mariosasko
Copy link
Contributor

I added a test and moved the streaming param from read to __init_. Then, I also decided to update the read method of the rest of the packaged modules to account for this param.

@hamid-vakilzadeh Are you OK with these changes?

@hamid-vakilzadeh
Copy link
Contributor Author

@mariosasko these all look great! Thanks for the updates.

Copy link
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.

Love it ! Thanks :)

src/datasets/io/abc.py Outdated Show resolved Hide resolved
@mariosasko mariosasko merged commit 6ad430b into huggingface:main Oct 5, 2022
@hamid-vakilzadeh hamid-vakilzadeh deleted the add_generator_iterable branch October 5, 2022 12:51
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.

Add IterableDataset.from_generator to the API
4 participants