Repository navigation
fix: pass current logits to stopping criteria - #2440
Open
remote-controlled-man wants to merge 4 commits into
Open
remote-controlled-man wants to merge 4 commits into
remote-controlled-man wants to merge 4 commits into
Conversation
This branch has not been deployed
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.
Stopping criteria receive unrelated scores: the Python scores buffer is not populated with the default
logits_all=False, and thelogits_all=Truepath indexes the wrong row instead of the position being sampled.Use the stored logits at the sampled position when all logits are retained, and read the current native logits otherwise.
Completion and streaming completion now use the generator's actual termination to report
finish_reason="stop", instead of invoking the callback again with stale state.Added real-model regression coverage for both logits settings, prompt lookup on/off,
generate, completion and streaming, immediate stopping, stopping after several tokens, and the token-limit control.The checks compare callback logits with a separate model evaluated one token at a time, verify accepted prefixes and output, and confirm that evaluated draft suffixes were exercised.
Validation:
make test: 62 passed, including all 36 regression casesmake lint: Ruff lint and formatting checks passed (29 files)Environment: macOS 26.7.3 arm64, Python 3.12.14, CPU inference with bundled llama.cpp
f5e6915c2, built withGGML_NATIVE=OFF(CPU/Accelerate and Metal enabled).Other platforms and acceleration backends were not run locally.
After syncing with upstream
mainat77fbb5d, I reranmake test(62 passed, including all 36 stopping-criteria cases) andmake lint(Ruff lint and format checks passed).