Add chatml fallback for cpp llama_chat_apply_template#8160
Merged
ngxson merged 2 commits intoggml-org:masterfrom Jun 27, 2024
Merged
Add chatml fallback for cpp llama_chat_apply_template#8160ngxson merged 2 commits intoggml-org:masterfrom
llama_chat_apply_template#8160ngxson merged 2 commits intoggml-org:masterfrom
Conversation
fairydreaming
approved these changes
Jun 27, 2024
Collaborator
fairydreaming
left a comment
There was a problem hiding this comment.
DeepSeek-V2-Lite no longer crashes with these fixes, but I think there's one unnecessary llama_chat_apply_template() call that can be removed.
common/common.cpp
Outdated
Comment on lines
+2647
to
+2650
| if (fallback) { | ||
| res = llama_chat_apply_template(nullptr, "chatml", chat.data(), chat.size(), add_ass, buf.data(), buf.size()); | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
Is this really necessary? I mean you already called llama_chat_apply_template(nullptr, "chatml", ...) in else above, so why do you call it again?
Collaborator
Author
There was a problem hiding this comment.
Yeah that's right, I forgot to delete the line inside else condition
Collaborator
Author
There was a problem hiding this comment.
I deleted this line of code (keep the line in else branch). I've tested it once more time and confirmed that it's still working.
This will be merged once CI passed.
Nexesenex
pushed a commit
to Nexesenex/croco.cpp
that referenced
this pull request
Jun 28, 2024
* add chatml fallback for cpp `llama_chat_apply_template` * remove redundant code
Nexesenex
pushed a commit
to Nexesenex/croco.cpp
that referenced
this pull request
Jun 28, 2024
* add chatml fallback for cpp `llama_chat_apply_template` * remove redundant code
MagnusS0
pushed a commit
to MagnusS0/llama.cpp-normistral-tokenizer
that referenced
this pull request
Jul 1, 2024
* add chatml fallback for cpp `llama_chat_apply_template` * remove redundant code
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.
Fix problem with DeepSeek V2 chat model: #8068 (comment) (cc @fairydreaming )
DeepSeek is no longer crash now, but it's using chatml (not ideal). We can add template for deepseek later.
Demo: