mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-13 12:10:18 +00:00
tool-call
: fix grammar trigger crash
This commit is contained in:
parent
d983516f40
commit
8b2cf3509f
@ -1157,7 +1157,7 @@ struct server_context {
|
||||
// If there is a lazy grammar trigger word at stop_pos, enable the lazy grammar
|
||||
if (match.is_grammar_trigger && gpt_sampler_trigger_grammar(model, slot.smpl, match.pattern)) {
|
||||
is_grammar_trigger = true;
|
||||
length = pos + match.pos + match.matchLength;
|
||||
length = match.pos + match.matchLength;
|
||||
} else if (!match.is_grammar_trigger && match.pos != std::string::npos && !match.is_partial) {
|
||||
slot.stopped_word = true;
|
||||
slot.stopping_word = match.pattern;
|
||||
|
Loading…
Reference in New Issue
Block a user