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

Evaluator column loading #200

Merged
merged 5 commits into from
Jul 25, 2022
Merged

Evaluator column loading #200

merged 5 commits into from
Jul 25, 2022

Conversation

lvwerra
Copy link
Member

@lvwerra lvwerra commented Jul 24, 2022

Instead of loading the pipeline inputs into memory this PR just wraps the original dataset in a DatasetColumn class. This allows to evaluate on huge datasets (e.g. ImageNet) without OOM errors.

cc @fxmarty

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 24, 2022

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

@fxmarty
Copy link
Contributor

fxmarty commented Jul 24, 2022

Great I'll test tomorrow morning!

@@ -119,7 +121,8 @@ def prepare_data(self, data: Union[str, Dataset], input_column: str, label_colum
references = data[label_column]

metric_inputs = {"references": references}
pipeline_inputs = [join_by.join(element) for element in data[input_column]]
data = data.map(lambda x: {input_column: join_by.join(x[input_column])})
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity: is this faster than a list comprehension?

Copy link
Member Author

@lvwerra lvwerra Jul 25, 2022

Choose a reason for hiding this comment

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

I don't think so, but it will not load the data into memory.

@lvwerra lvwerra merged commit 4a78290 into main Jul 25, 2022
@lvwerra lvwerra deleted the evaluator-column-loading branch July 25, 2022 09:21
mathemakitten pushed a commit that referenced this pull request Aug 3, 2022
* add `DatasetColumn` class

* add __iter__

* make style

* adapt QA

* adapt NER
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.

None yet

3 participants