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

Add temperature sanity check as 0 is invalid #1211

Merged
merged 4 commits into from
Feb 1, 2025

Conversation

RyanUnderhill
Copy link
Member

A user was passing 0 and this results in a divide by zero in the SoftMax calculation, which results in +INF/NaN floating point results that are not obviously caused by a zero temperature.

This lets users know at token selection time that the current temperature is invalid.

ajindal1
ajindal1 previously approved these changes Jan 31, 2025
@RyanUnderhill RyanUnderhill merged commit 9483f18 into main Feb 1, 2025
14 checks passed
@RyanUnderhill RyanUnderhill deleted the ryanunderhill/temperature_check branch February 1, 2025 01:30
baijumeswani pushed a commit that referenced this pull request Feb 3, 2025
A user was passing 0 and this results in a divide by zero in the SoftMax
calculation, which results in +INF/NaN floating point results that are
not obviously caused by a zero temperature.

This lets users know at token selection time that the current
temperature is invalid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants