Skip to content

Commit 07f9d4c

Browse files
authored
only enable prompt formatting if explicitly enabled
1 parent f99d9d1 commit 07f9d4c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/main/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ int main(int argc, char ** argv) {
277277
};
278278

279279
{
280+
const bool explicit_chat_template = params.enable_chat_template && (params.use_jinja || !params.chat_template.empty());
280281
std::string prompt = params.enable_chat_template ? params.system_prompt : "";
281282

282283
if (params.enable_chat_template && !prompt.empty()) {
@@ -285,7 +286,7 @@ int main(int argc, char ** argv) {
285286
}
286287

287288
if (!params.conversation_mode) {
288-
if (params.enable_chat_template && !params.prompt.empty()) {
289+
if (explicit_chat_template && !params.prompt.empty()) {
289290
// format and append the user prompt
290291
prompt += chat_add_and_format("user", params.prompt);
291292
} else {

0 commit comments

Comments
 (0)