Preserve unlimited token sentinel in text generation CLI - #269
Open
sylvesterkaczmarek wants to merge 2 commits into
Open
Preserve unlimited token sentinel in text generation CLI#269sylvesterkaczmarek wants to merge 2 commits into
sylvesterkaczmarek wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pass the generation CLI's documented unlimited-token sentinel to the selected backend unchanged.
--limit 0is the default and is documented as disabling the token limit, butgpt_oss.generatecurrently converts 0 toNone. The Torch and Triton generators implement unlimited generation with integer0and comparenum_generated_tokens < max_tokens, soNonecan cause aTypeError. The vLLM generator also accepts 0 and converts it internally for vLLM.Fixes #268.
Fix
Pass
args.limitdirectly asmax_tokens.Regression coverage
Adds a backend-stub test around
main()verifying that the default/unlimitedlimit=0reaches the token generator as integer 0 without requiring a checkpoint, GPU, or inference dependency.Finite positive limits, stop tokens, temperature, logprob behavior, and backend selection are unchanged.