| 43 | } |
| 44 | |
| 45 | std::string Llama3::apply_chat_template(nlohmann::ordered_json& messages, nlohmann::ordered_json tools) { |
| 46 | minja::chat_template_inputs inputs; |
| 47 | inputs.add_generation_prompt = true; |
| 48 | inputs.messages = messages; |
| 49 | inputs.extra_context = this->extra_context; |
| 50 | return this->chat_tmpl->apply(inputs); |
| 51 | } |
| 52 | |
| 53 | bool Llama3::insert(chat_meta_info_t& meta_info, lm_uniform_input_t& input, std::function<bool()> is_cancelled) { |
| 54 | // preprocess |