-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Eval bug: bizarre Jinja bug when trying to fix Qwen3 tool calling #13516
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
Comments
Ah, I had this same problem. I made a PR here: #13521 Summary is, in some recent commit(?) llama.cpp server stopped accepting requests that had messages where the "content" property is missing entirely. But it should accept such messages, because there is no "content" value required during a tool request message. A recent PR partially fixed the issue to allow null/empty values for "content", but did not allow scenarios where "content" is missing entirely. |
Thanks @andysalerno , can confirm this is caused by regression introduced in 33eff40 |
@pwilkin This might be related too - https://www.reddit.com/r/LocalLLaMA/comments/1klltt4/the_qwen3_chat_template_is_still_bugged/ |
Given that I'm the author of that thread, yeah, it probably is 😆 This bug report is what happened after I fixed all the issues in the template described there. |
Name and Version
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 3080, compute capability 8.6, VMM: yes
version: 5361 (cf0a43b)
built with cc (Ubuntu 14.2.0-4ubuntu2) 14.2.0 for x86_64-linux-gnu
Operating systems
Linux
GGML backends
CUDA
Hardware
i7 9700K + GTX 3080 10GB VRAM
Models
Qwen3 14B (Q4_K_S)
Problem description & steps to reproduce
I've ran into some problems with the Qwen3 chat templates that prevent the proper usage of tools (more on that here: https://www.reddit.com/r/LocalLLaMA/comments/1klltt4/the_qwen3_chat_template_is_still_bugged/
I tweaked the template to make it work (or so I thought). However, I am still encountering a complely bizarre bug in my test case when using Qwen3 14B.
qwen3-jinja.txt
Even with the template being so careful about potential "content" blocks, I am still getting an error with the following conversation:
Any ideas what could be going on here? All Jinja2 online parsers that I've tested parse this one OK (i.e. https://j2live.ttl255.com/ or https://nebula.packetcoders.io/j2-render/). I can't seem to figure out what's going on here. Is there any easy way to expose just the Jinja templater as a commandline tool so I could debug it?
First Bad Commit
33eff402
Relevant log output
The text was updated successfully, but these errors were encountered: