Skip to content

Commit 70d5844

Browse files
committed
More Stop token patch for GLM41VChatHandler
1 parent eecb701 commit 70d5844

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llama_cpp/llama_chat_format.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3770,7 +3770,8 @@ class GLM41VChatHandler(Llava15ChatHandler):
37703770

37713771
def __call__(self, **kwargs):
37723772
self.extra_template_arguments["GLM41V_EOS_TOKEN"] = self.GLM41V_EOS_TOKEN
3773-
stop_tokens = [self.GLM41V_EOS_TOKEN, "</answer>"] # Stop token patch
3773+
# https://huggingface.co/zai-org/GLM-4.1V-9B-Thinking/blob/main/generation_config.json
3774+
stop_tokens = [self.GLM41V_EOS_TOKEN, "<|user|>", "<|observation|>", "</answer>"] # Stop token patch
37743775
kwargs['stop'] = stop_tokens
37753776

37763777
llama = kwargs['llama']

0 commit comments

Comments
 (0)