| 80 | } |
| 81 | |
| 82 | std::string Phi4::apply_chat_template(nlohmann::ordered_json& messages, nlohmann::ordered_json tools) { |
| 83 | minja::chat_template_inputs inputs; |
| 84 | inputs.add_generation_prompt = true; |
| 85 | inputs.messages = messages; |
| 86 | inputs.extra_context = this->extra_context; |
| 87 | return this->chat_tmpl->apply(inputs); |
| 88 | } |
| 89 | |
| 90 | bool Phi4::insert(chat_meta_info_t& meta_info, lm_uniform_input_t& input, std::function<bool()> is_cancelled) { |
| 91 | // preprocess |