Skip to content

fix(predict): handle temperature=0 correctly instead of treating it as unset#12

Open
isaacbmiller wants to merge 1 commit intomainfrom
fix/predict-temperature-zero
Open

fix(predict): handle temperature=0 correctly instead of treating it as unset#12
isaacbmiller wants to merge 1 commit intomainfrom
fix/predict-temperature-zero

Conversation

@isaacbmiller
Copy link
Copy Markdown

temperature=0 is a valid and common setting for deterministic generation,
but the or operator treats 0 as falsy. This causes the user's explicit
temperature=0 to be silently dropped and replaced with the LM's default.

When num_generations > 1, this leads to the temperature being overridden
to 0.7, giving random outputs when the user explicitly requested
deterministic generation.

Fix: use explicit None check instead of or.

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.

1 participant