sampler: fixes trigger tokens + lazy grammars (fix typo cast from token to string)#12291
Merged
ochafik merged 2 commits intoggml-org:masterfrom Mar 10, 2025
Merged
sampler: fixes trigger tokens + lazy grammars (fix typo cast from token to string)#12291ochafik merged 2 commits intoggml-org:masterfrom
sampler: fixes trigger tokens + lazy grammars (fix typo cast from token to string)#12291ochafik merged 2 commits intoggml-org:masterfrom
Conversation
sampler: fix typo in lazy grammar handling (fixes trigger tokens)
This was referenced Mar 10, 2025
sampler: fix typo in lazy grammar handling (fixes trigger tokens)sampler: fixes trigger tokens + lazy grammars (fix typo cast from token to string)
ggerganov
reviewed
Mar 10, 2025
| common_grammar_trigger trigger; | ||
| trigger.type = COMMON_GRAMMAR_TRIGGER_TYPE_TOKEN; | ||
| trigger.value = (llama_token) token; | ||
| trigger.value = word; |
Member
There was a problem hiding this comment.
Do we need to assign to value here? I though that COMMON_GRAMMAR_TRIGGER_TYPE_TOKEN means to use just the token member.
Collaborator
Author
There was a problem hiding this comment.
It’s only (very useful) for debug in the verbose json output
ggerganov
approved these changes
Mar 10, 2025
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
mtmcp
referenced
this pull request
in mtmcp/llama.cpp
Mar 10, 2025
arthw
pushed a commit
to arthw/llama.cpp
that referenced
this pull request
Mar 19, 2025
…oken to string) (ggml-org#12291) * Fix typo in lazy grammar handling (fixes trigger tokens) Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
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.
Fixes regression introduced in #12034 (which got trigger tokens to just be... ignored)
Likely fixes #12256
Note: this is hard to test against, short of exposing the triggered status of lazy grammars all the way to the server API (maybe limiting to verbose mode)