-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Generate: fix ExponentialDecayLengthPenalty
doctest
#27485
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing, the investigation and description!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks a lot !
The failing test
is known on doctest CI, so good for me to merge. I already ping @sanchit-gandhi on slack. |
@amyeroberts would you be able to merge this PR, as the failure is unrelated? (different doctest on the same file) :) |
I can do it, but maybe wait @amyeroberts this time (so she knows I can 😄 without surprise) |
I can merge! cc @sanchit-gandhi as the failing doctest is a whisper one. |
What does this PR do?
The doctest was failing... but the root cause for the failure in
transformers.generation.logits_process.ExponentialDecayLengthPenalty
is the transition fromtorch==2.0
totorch==2.1
(i.e. installingtorch==2.0
fixes it).I couldn’t find any related reference in the release notes, but I know they touched
torch.multinomial
after the 2.0 release -- it was sampling things with probability=0.0. This change may impact this doctest, as it is sample-based and it may induce probabilities=0.0.As such, the fix consists of updating the test's outputs. I took the opportunity to improve the example as well :)