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

[seq2seq Examples] Use _step instead of generate for val, test #7004

Conversation

setu4993
Copy link
Contributor

@setu4993 setu4993 commented Sep 8, 2020

Addresses a workaround I proposed in #6589 for limiting the memory consumption in .generate steps.

@sshleifer

num_beams=self.eval_beams,
)
loss_tensors, logits = self._step(batch)
if self.eval_beams == 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO would be better to add an explicit argument like predict_with_generate to decide weather to use generate or not, this will also align it with #6769. Setting eval_beams to 0 , will cause this assert to fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@patil-suraj : I updated that assertion above :).

Good point on creating an additional arg, though. I was veering on the side of fewer args, but this might also be something that's useful as an explicit arg than a hidden one. I don't have a strong opinion either way.

Copy link
Contributor

Choose a reason for hiding this comment

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

aah right, I missed the updated assertion .

Right, not super important. Just a nit

@setu4993
Copy link
Contributor Author

@sshleifer : Does it make sense to still add this? If yes, I can rebase and update based on Suraj's comments earlier. If not, will close.

@sshleifer
Copy link
Contributor

Let's hold off for now. I think passing --eval_num_beams=1 is close enough to equivalent.
Thanks for trying!

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.

3 participants