Skip to content

Fix new line issue with chat template, disable template when in-prefix/suffix is set#8203

Merged
ngxson merged 3 commits intoggml-org:masterfrom
ngxson:xsn/main_tmpl_preserve_nl
Jun 30, 2024
Merged

Fix new line issue with chat template, disable template when in-prefix/suffix is set#8203
ngxson merged 3 commits intoggml-org:masterfrom
ngxson:xsn/main_tmpl_preserve_nl

Conversation

@ngxson
Copy link
Copy Markdown
Contributor

@ngxson ngxson commented Jun 29, 2024

Re comment: #8198 (comment)

I ended up modifying llama_chat_format_single because changing llama_chat_apply_template will make it unnecessarily complicated (i.e. many templates will need to be patched)

Also, when --in-prefix or --in-suffix is set, we will disable chat template. That will allow users to use custom chat template.


@ngxson ngxson added the Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix label Jun 29, 2024
@ngxson ngxson requested a review from slaren June 29, 2024 09:05
@github-actions github-actions Bot added testing Everything test related examples labels Jun 29, 2024
@ngxson ngxson merged commit 9ef0780 into ggml-org:master Jun 30, 2024
Nexesenex pushed a commit to Nexesenex/croco.cpp that referenced this pull request Jun 30, 2024
…x/suffix is set (ggml-org#8203)

* preserve new line llama_chat_format_single

* disable chat template if in-prefix/suffix is set

* remove redundant change
MagnusS0 pushed a commit to MagnusS0/llama.cpp-normistral-tokenizer that referenced this pull request Jul 1, 2024
…x/suffix is set (ggml-org#8203)

* preserve new line llama_chat_format_single

* disable chat template if in-prefix/suffix is set

* remove redundant change
Nexesenex pushed a commit to Nexesenex/croco.cpp that referenced this pull request Jul 1, 2024
…x/suffix is set (ggml-org#8203)

* preserve new line llama_chat_format_single

* disable chat template if in-prefix/suffix is set

* remove redundant change
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
…x/suffix is set (ggml-org#8203)

* preserve new line llama_chat_format_single

* disable chat template if in-prefix/suffix is set

* remove redundant change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants