-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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: nudge towards do_sample=False
when temperature=0.0
#25722
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.
We could also just set do_sample = False
in case temperature = 0
. Will let you decide !
raise ValueError(f"`temperature` has to be a strictly positive float, but is {temperature}") | ||
except_msg = ( | ||
f"`temperature` (={temperature}) has to be a strictly positive float, otherwise your next token " | ||
"scores will be invalid." |
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.
do you mean that it will be nan
?
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.
depends on the value the user places here (e.g. a negative float will not generate nans, but make the scores enter uncharted territory), hence the vague message
I agree we should do that! But I'm going to leave that for the generate refactor, as it implies significant code changes to do it right :) |
What does this PR do?
Related issue: meta-llama/llama#687
Improves the error message when
temperature=0.0
, which asymptotically corresponds to greedy decoding... except that it results in numerical problems :Dtest run:
yields