Skip to content

fix: validate generation temperature - #1589

Open
ryanL1100 wants to merge 1 commit into
deepseek-ai:mainfrom
ryanL1100:fix/generation-temperature-validation
Open

fix: validate generation temperature#1589
ryanL1100 wants to merge 1 commit into
deepseek-ai:mainfrom
ryanL1100:fix/generation-temperature-validation

Conversation

@ryanL1100

Copy link
Copy Markdown

Summary

  • reject negative and non-finite generation temperatures before sampling
  • preserve temperature=0 greedy decoding behavior

Tests

  • PYTHONPYCACHEPREFIX=/tmp/deepseek-v3-pycache python3 -m py_compile inference/generate.py
  • git diff --check

@qingkong66

Copy link
Copy Markdown

@ryanL1100

Thank you for this — it's a focused follow-up to #1586.

Validating generation temperature before sampling is the kind of edge-case handling that prevents silent failures. Rejecting negative and non-finite values early, before they reach the sampling path, saves time that would otherwise be spent debugging opaque errors.

The fact that temperature=0 greedy decoding behavior is preserved is also worth noting — this is about rejecting invalid inputs, not changing behavior for valid ones.

It's good to see this pattern of incremental edge-case validation continuing.

I'll include this in the summary under inference stability, alongside #1586.

— qingkong66

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.

2 participants