tool-call: allow --chat-template chatml w/ --jinja, default to chatml upon parsing issue, avoid double bos#11616
Merged
ochafik merged 7 commits intoggml-org:masterfrom Feb 3, 2025
Merged
Conversation
tool-call: allow --chat-template chatml when --jinja enabledtool-call: allow --chat-template chatml w/ --jinja, default to chatml upon parsing issue, avoid double bos
Collaborator
Author
|
Sorry somehow had forgotten half of the changes when I undrafted, should look better now. |
ngxson
approved these changes
Feb 3, 2025
| LOG_ERR("%s: failed to parse chat template: %s\n", __func__, e.what()); | ||
| return { | ||
| has_explicit_template, | ||
| std::make_unique<minja::chat_template>(CHATML_TEMPLATE_SRC, token_bos, token_eos), |
Contributor
There was a problem hiding this comment.
I think at some point we should no longer fallback to chatml. The fallback to chatml was a temporary solution when chat templates was not a common thing.
For example, in such case, we can return an error message like: Chat template is not supported, you must specify a custom template using --chat-template ... when user uses /chat/completions endpoint.
Collaborator
Author
There was a problem hiding this comment.
either way, it's surprising all the things we can have chatml do with a few "polyfills" (in minja)
3 tasks
orca-zhang
pushed a commit
to orca-zhang/llama.cpp
that referenced
this pull request
Feb 26, 2025
…chatml upon parsing issue, avoid double bos (ggml-org#11616) * tool-call: allow `--jinja --chat-template chatml` * fix double bos issue (drop bos/eos tokens from jinja template) * add missing try catch around jinja parsing to default to chatml * Simplify default chatml logic
arthw
pushed a commit
to arthw/llama.cpp
that referenced
this pull request
Feb 26, 2025
…chatml upon parsing issue, avoid double bos (ggml-org#11616) * tool-call: allow `--jinja --chat-template chatml` * fix double bos issue (drop bos/eos tokens from jinja template) * add missing try catch around jinja parsing to default to chatml * Simplify default chatml logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Couple of fixes in common_chat_templates_from_model
--chat-template chatmlwhen--jinjaenabled:model, not anassistant; testing other models w/ it in slow tool call server tests).b4524breaks serving ofgranite-codemodels #11500) and default to chatml