Skip to content

Commit ad89166

Browse files
committed
Trailing whitespaces
1 parent e725519 commit ad89166

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

common/chat.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,11 +1188,11 @@ static common_chat_params common_chat_params_init_llama_3_x(const common_chat_te
11881188

11891189
static common_chat_params common_chat_params_init_nemotron_v2(const common_chat_template & tmpl, const struct templates_params & inputs) {
11901190
common_chat_params data;
1191-
1191+
11921192
// Generate the prompt using the apply() function with the template
11931193
data.prompt = apply(tmpl, inputs);
11941194
data.format = COMMON_CHAT_FORMAT_NEMOTRON_V2;
1195-
1195+
11961196
// Handle thinking tags appropriately based on inputs.enable_thinking
11971197
if (string_ends_with(data.prompt, "<think>\n")) {
11981198
if (!inputs.enable_thinking) {
@@ -1201,7 +1201,7 @@ static common_chat_params common_chat_params_init_nemotron_v2(const common_chat_
12011201
data.thinking_forced_open = true;
12021202
}
12031203
}
1204-
1204+
12051205
// When tools are present, build grammar for the <TOOLCALL> format
12061206
if (!inputs.tools.is_null() && inputs.tools.is_array() && !inputs.tools.empty()) {
12071207
data.grammar_lazy = inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_REQUIRED;
@@ -1212,7 +1212,7 @@ static common_chat_params common_chat_params_init_nemotron_v2(const common_chat_
12121212
std::string name = function.at("name");
12131213
auto parameters = function.at("parameters");
12141214
builder.resolve_refs(parameters);
1215-
1215+
12161216
// Build tool call rule for Nemotron format
12171217
tool_rules.push_back(builder.add_rule(name + "-call", builder.add_schema(name + "-args", {
12181218
{"type", "object"},
@@ -1223,17 +1223,17 @@ static common_chat_params common_chat_params_init_nemotron_v2(const common_chat_
12231223
{"required", json::array({"name", "arguments"})},
12241224
})));
12251225
});
1226-
1226+
12271227
// Create tool call rule - Nemotron uses <TOOLCALL>[...] format
12281228
auto tool_call = builder.add_rule("tool_call", string_join(tool_rules, " | "));
12291229
auto tool_list = builder.add_rule("tool_list", "\"[\" space " + tool_call + " (\",\" space " + tool_call + ")* space \"]\"");
1230-
1230+
12311231
// Grammar rule for <TOOLCALL> format
12321232
builder.add_rule("root",
12331233
std::string(data.thinking_forced_open ? "( \"\" space )? " : "") +
12341234
"\"<TOOLCALL>\" space " + tool_list + " \"</TOOLCALL>\"");
12351235
});
1236-
1236+
12371237
// Define triggers for <TOOLCALL> token
12381238
data.grammar_triggers.push_back({
12391239
COMMON_GRAMMAR_TRIGGER_TYPE_WORD,
@@ -1248,7 +1248,7 @@ static common_chat_params common_chat_params_init_nemotron_v2(const common_chat_
12481248
});
12491249
}
12501250
}
1251-
1251+
12521252
// Set preserved tokens for all special tokens
12531253
data.preserved_tokens = {
12541254
"<think>",
@@ -1260,7 +1260,7 @@ static common_chat_params common_chat_params_init_nemotron_v2(const common_chat_
12601260
"<AVAILABLE_TOOLS>",
12611261
"</AVAILABLE_TOOLS>"
12621262
};
1263-
1263+
12641264
return data;
12651265
}
12661266
static void common_chat_parse_llama_3_1(common_chat_msg_parser & builder, bool with_builtin_tools = false) {

common/chat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ enum common_chat_format {
113113
COMMON_CHAT_FORMAT_GPT_OSS,
114114
COMMON_CHAT_FORMAT_SEED_OSS,
115115
COMMON_CHAT_FORMAT_NEMOTRON_V2,
116-
116+
117117
COMMON_CHAT_FORMAT_COUNT, // Not a format, just the # formats
118118
};
119119

0 commit comments

Comments
 (0)