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

refactor evaluator base and task classes #185

Merged
merged 3 commits into from
Jul 15, 2022
Merged

refactor evaluator base and task classes #185

merged 3 commits into from
Jul 15, 2022

Conversation

lvwerra
Copy link
Member

@lvwerra lvwerra commented Jul 13, 2022

Refactored the evaluator base and task classes based on discussions in #178 to make them a bit more abstract for new tasks and draw a clearer separation between base and task classes.

Adding the performance should now be easy: measure inside call_pipeline and return an dict with which you can update the result dict inside the compute methods.

Also if a user wants to pass a custom prediction postprocessing (as suggested by @craffel) before passing to the metric we can just overwrite the predictions_processing method or wrap the custom function around it.

Let me know what you think @ola13 and @fxmarty.

@lvwerra lvwerra requested a review from ola13 July 13, 2022 17:03
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jul 13, 2022

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

@ola13
Copy link
Contributor

ola13 commented Jul 14, 2022

Hey, thanks for this! I posted a comment here #178 (comment) - can we discuss there for now since there's a bit more context there? :)

@ola13 ola13 mentioned this pull request Jul 14, 2022
@lvwerra
Copy link
Member Author

lvwerra commented Jul 14, 2022

Thanks for your feedback @ola13. I integrated the suggestion and think I found a way to keep the base class abstract enough that in most cases just the prediction_processor needs to be adapted.

I also added a PIPELINE_KWARGS and METRIC_KWARGS attribute to the class such that we can control the kwargs especially for the pipeline (truncation=True). That way if a user really wants they can adapt the runtime settings of those to classes. This also addresses #137.

Let me know what you think.

@fxmarty
Copy link
Contributor

fxmarty commented Jul 15, 2022

Looks fine to me!

Copy link
Contributor

@ola13 ola13 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@lvwerra lvwerra merged commit 90aa73d into main Jul 15, 2022
@lvwerra lvwerra deleted the evaluator-refactor branch July 15, 2022 12:07
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

4 participants