File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ common_chat_templates_ptr common_chat_templates_init(
411411 token_bos = get_token (llama_vocab_bos (vocab), " BOS" , " bos_token" );
412412 token_eos = get_token (llama_vocab_eos (vocab), " EOS" , " eos_token" );
413413 }
414- common_chat_templates_ptr tmpls (new common_chat_templates (), common_chat_templates_free );
414+ common_chat_templates_ptr tmpls (new common_chat_templates ());
415415 tmpls->has_explicit_template = has_explicit_template;
416416 try {
417417 tmpls->template_default = std::make_unique<minja::chat_template>(default_template_src, token_bos, token_eos);
Original file line number Diff line number Diff line change @@ -85,9 +85,11 @@ struct common_chat_params {
8585// Check if the template supplied via "--chat-template" is supported or not. Returns true if it's valid
8686bool common_chat_verify_template (const std::string & tmpl, bool use_jinja);
8787
88-
8988void common_chat_templates_free (struct common_chat_templates * tmpls);
90- typedef std::unique_ptr<struct common_chat_templates , decltype (&common_chat_templates_free)> common_chat_templates_ptr;
89+
90+ struct common_chat_templates_deleter { void operator ()(common_chat_templates * tmpls) { common_chat_templates_free (tmpls); } };
91+
92+ typedef std::unique_ptr<struct common_chat_templates , common_chat_templates_deleter> common_chat_templates_ptr;
9193
9294common_chat_templates_ptr common_chat_templates_init (
9395 const struct llama_model * model,
Original file line number Diff line number Diff line change @@ -1806,8 +1806,6 @@ struct server_context {
18061806
18071807 common_chat_templates_ptr chat_templates;
18081808
1809- server_context () : chat_templates(nullptr , nullptr ) {}
1810-
18111809 ~server_context () {
18121810 // Clear any sampling context
18131811 for (server_slot & slot : slots) {
You can’t perform that action at this time.
0 commit comments