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

fix: Ensure eval mode for TableReader model for predictions #3743

Merged
merged 2 commits into from
Jan 9, 2023

Conversation

sjrl
Copy link
Contributor

@sjrl sjrl commented Dec 22, 2022

Related Issues

  • fixes N/A

Proposed Changes:

I added a call to make sure to set the TableReader model to eval mode when running a prediction. Otherwise, currently, if the model is set to train mode the predictions become random due to layers like BatchNorm and dropout being present in the underlying model architecture. This is something we already do for some of our nodes like the DensePassageRetriever.

How did you test it?

I added a new unit test to make sure everything works. I did confirm that this unit test fails without the new changes.

Notes for the reviewer

This probably was not noticed before because the model is set to eval mode by default when loading it.

Checklist

@sjrl sjrl requested a review from a team as a code owner December 22, 2022 07:07
@sjrl sjrl requested review from vblagoje and removed request for a team December 22, 2022 07:07
@sjrl sjrl changed the title fix: Set TableReader model to eval mode for predictions fix: Ensure eval mode for TableReader model for predictions Dec 30, 2022
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

LGTM @sjrl

@sjrl sjrl merged commit 5b0b338 into main Jan 9, 2023
@sjrl sjrl deleted the add-model-eval branch January 9, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants