-
Notifications
You must be signed in to change notification settings - Fork 11.6k
sampler
: fixes trigger tokens + lazy grammars (fix typo cast from token to string)
#12291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sampler
: fix typo in lazy grammar handling (fixes trigger tokens)
sampler
: fix typo in lazy grammar handling (fixes trigger tokens)sampler
: fixes trigger tokens + lazy grammars (fix typo cast from token to string)
@@ -384,7 +384,8 @@ struct server_task { | |||
SRV_DBG("Grammar trigger token: %d (`%s`)\n", token, word.c_str()); | |||
common_grammar_trigger trigger; | |||
trigger.type = COMMON_GRAMMAR_TRIGGER_TYPE_TOKEN; | |||
trigger.value = (llama_token) token; | |||
trigger.value = word; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to assign to value
here? I though that COMMON_GRAMMAR_TRIGGER_TYPE_TOKEN
means to use just the token
member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s only (very useful) for debug in the verbose json output
Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…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>
…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>
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)