Skip to content

Add Dataset.from_generator#4957

Merged
mariosasko merged 15 commits into
mainfrom
add-from-generator
Sep 16, 2022
Merged

Add Dataset.from_generator#4957
mariosasko merged 15 commits into
mainfrom
add-from-generator

Conversation

@mariosasko

Copy link
Copy Markdown
Collaborator

Add Dataset.from_generator to the API to allow creating datasets from data larger than RAM. The implementation relies on a packaged module not exposed in load_dataset to tie this method with datasets' caching mechanism.

Closes #4417

@lhoestq

lhoestq commented Sep 13, 2022

Copy link
Copy Markdown
Member

I restarted the builder PR job just in case

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Sep 13, 2022

Copy link
Copy Markdown

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

@mariosasko

Copy link
Copy Markdown
Collaborator Author

CI is now green. huggingface/doc-builder#296 explains why it failed.

@mariosasko mariosasko requested a review from lhoestq September 14, 2022 13:36

@lhoestq lhoestq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome thank you !

Maybe let's open an issue to also add IterableDataset.from_generator ?

Comment thread docs/source/loading.mdx Outdated
Comment thread src/datasets/packaged_modules/generator/generator.py
Comment thread src/datasets/arrow_dataset.py Outdated
@mariosasko mariosasko merged commit 55f53a2 into main Sep 16, 2022
@mariosasko mariosasko deleted the add-from-generator branch September 16, 2022 14:44
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.

how to convert a dict generator into a huggingface dataset.

3 participants