MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / apply_chat_template

Method apply_chat_template

src/common/AutoModel/modeling_lfm2.cpp:47–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47std::string LFM2::apply_chat_template(nlohmann::ordered_json& messages, nlohmann::ordered_json tools) {
48 minja::chat_template_inputs inputs;
49 minja::chat_template_options opt;
50 opt.polyfill_tool_responses = false;
51 inputs.add_generation_prompt = true;
52 inputs.messages = messages;
53 inputs.extra_context = this->extra_context;
54 // inputs.tools = tools;
55 return this->chat_tmpl->apply(inputs, opt);
56}
57
58bool LFM2::insert(chat_meta_info_t& meta_info, lm_uniform_input_t& input, std::function<bool()> is_cancelled) {
59 // preprocess

Callers 1

insertMethod · 0.95

Calls 1

applyMethod · 0.80

Tested by

no test coverage detected