-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Add Jinja template support #11016
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
Add Jinja template support #11016
Changes from 1 commit
abd274a
e5113e8
80138d9
06b5159
ce48584
389d79b
238b968
cb72cf1
78861a3
1aac99a
7c84ebc
18f257b
8dd4f33
c04c50e
a6afb27
b4083e4
b7e2171
a57bb94
4daae0b
1b3bb7e
3ed670b
b75d062
40db789
81c0d43
d5fa351
ee1e10e
e63520f
33322e8
5074e6f
fc60802
0e74c9d
e3c475c
cc50356
153e852
db9dd0c
c9e8fdd
8c84aef
154bfaa
099f983
54a669e
8348c60
ee475d2
8a7c89e
8347da9
ff2cce5
9d8ebd6
cbb9b81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1825,8 +1825,8 @@ std::string common_chat_format_example(const struct llama_model * model, | |
llama_chat_templates llama_chat_templates_from_model(const struct llama_model * model, const std::string & chat_template_override) | ||
{ | ||
auto vocab = llama_model_get_vocab(model); | ||
auto bos_token = common_token_to_piece(vocab, llama_token_bos(vocab), true); | ||
auto eos_token = common_token_to_piece(vocab, llama_token_eos(vocab), true); | ||
auto bos_token = common_token_to_piece(vocab, llama_vocab_bos(vocab), true); | ||
auto eos_token = common_token_to_piece(vocab, llama_vocab_eos(vocab), true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this handle missing BOS/EOS tokens? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah we should, thanks! Defaulting to empty string + emitting warning if they're (likely) referenced from the jinja template.
ochafik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
std::string default_template_src = chat_template_override; | ||
std::string tool_use_template_src = chat_template_override; | ||
if (chat_template_override.empty()) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.