-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Fixes #15247 | Update chat.cpp to support (at least) qwen3 reasoning + tool_choice = required #15248
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
base: master
Are you sure you want to change the base?
Fixes #15247 | Update chat.cpp to support (at least) qwen3 reasoning + tool_choice = required #15248
Conversation
|
All am I sure is that it fixes issues with Qwen3 + reasoning (enabled or disabled)+ tool calling. CC hermes2 contributor : @ochafik |
|
Back at the office on tuesday, re-reading the PR i might reconsider the logic around thinking_forced_open |
…already opened grammar)
…r accepting piece:`
|
For a future PR, the following functions needs the same kind of patch :
ready for review @ggerganov Not sure exactly who I should ping as ochafik seems to be busy this week |
|
Not sure who I should ping |
|
Same comment as #15019 (comment) This is a smaller change, so I can take a look and merge this, but prefer if we have someone who would take over this part of the code. |
|
Got it, thanks for keeping me updated ! |
|
If you are being held hostage, blink twice @ochafik |
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.
Thanks @ExtReMLapin ! Looks very promising :-)
Could you add some tests in test-chat.cpp (will need to force git add models/templates/qwen3-something.jinja, see models/templates/README.md )
|
So I added two sets of tests, one in test-chat.cpp (100% ai generated, but tested) and I'm less that meh-ly conviced of their point. I would have much more liked some kind of grammar check that filter/accepts/prune the reasoning part. And this is why I added another test inside test_tool_call.py of the server tool, which is in my opinion not the perfect place because chat.cpp is not only used in the server, but it's an e2e test and much more straighforward at checking if things works. Test results before this PR : After :
|
There was this issue that we would not use tool_choice at
requiredwith reasoning because of forced tool call imposed by grammar.Grammar now allows the model to think first.
Reasoning = big brain
Tool calling = strong arms
Now you can be very smart and very strong
Fixes #15247