Skip to content

Commit 0d372f4

Browse files
committed
Add code to handle non-thinking mode.
1 parent 6223c1c commit 0d372f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/chat.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,13 @@ static common_chat_params common_chat_params_init_deepseek_v3_1(const common_cha
13191319
auto prompt = apply(tmpl, inputs);
13201320
data.prompt = prompt;
13211321
data.format = COMMON_CHAT_FORMAT_DEEPSEEK_V3_1;
1322+
if (string_ends_with(data.prompt, "<think>\n")) {
1323+
if (!inputs.enable_thinking) {
1324+
data.prompt += "</think>";
1325+
} else {
1326+
data.thinking_forced_open = true;
1327+
}
1328+
}
13221329
return data;
13231330
}
13241331

0 commit comments

Comments
 (0)