From 81c0d437a5f10c6ef8777183efe9437ab84e5a00 Mon Sep 17 00:00:00 2001 From: ochafik Date: Sat, 18 Jan 2025 00:56:19 +0000 Subject: [PATCH] Attempt to fix linkage of LLAMA_CHATML_TEMPLATE --- common/common.cpp | 4 ++-- common/common.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 03128d8d5..8dd8912e5 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -74,14 +74,14 @@ #endif #define LLAMA_CURL_MAX_URL_LENGTH 2084 // Maximum URL Length in Chrome: 2083 -const char * LLAMA_CHATML_TEMPLATE = R"( +const std::string LLAMA_CHATML_TEMPLATE(R"( {%- for message in messages -%} {{- "<|im_start|>" + message.role + "\n" + message.content + "<|im_end|>\n" -}} {%- endfor -%} {%- if add_generation_prompt -%} {{- "<|im_start|>assistant\n" -}} {%- endif -%} -)"; +)"); // // CURL utils diff --git a/common/common.h b/common/common.h index 977819459..04e1272d6 100644 --- a/common/common.h +++ b/common/common.h @@ -26,7 +26,7 @@ #define DEFAULT_MODEL_PATH "models/7B/ggml-model-f16.gguf" -extern const char * LLAMA_CHATML_TEMPLATE; +extern const std::string LLAMA_CHATML_TEMPLATE; struct common_adapter_lora_info { std::string path;