Skip to content

tool-call: fix non-tool-calling grammar crashes w/ Qwen / Hermes 2 templates #12900

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

Merged
merged 2 commits into from
Apr 11, 2025

Conversation

ochafik
Copy link
Collaborator

@ochafik ochafik commented Apr 11, 2025

Adds missing fence of tool call support logic for hermes 2 / qwen format (+ missing tests that ensure the tool call logic is only triggered when expected; for a few models it's always, e.g. R1, CR7B, Functionary v3.2)

This fixes the empty grammar stack crash reported in #12379

cc/ @edmcman

@github-actions github-actions bot added the testing Everything test related label Apr 11, 2025
@ochafik ochafik marked this pull request as ready for review April 11, 2025 17:14
@ochafik ochafik changed the title tool-call: don't call common_chat_params_init_hermes_2_pro when there's no tools tool-call: fix non-tool-calling grammar crashes w/ Qwen / Hermes 2 templates Apr 11, 2025
@ochafik ochafik requested a review from ngxson April 11, 2025 17:24
@ochafik ochafik added the bugfix fixes an issue or bug label Apr 11, 2025
@ngxson ngxson merged commit b6930eb into ggml-org:master Apr 11, 2025
51 checks passed
@JohannesGaessler
Copy link
Collaborator

I encountered this problem while evaluating Gemma 3 it 12b over the MMLU test set, this PR seems to have fixed the issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix fixes an issue or bug testing Everything test related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants