Skip to content

Commit 68d3134

Browse files
committed
Revert "chat: handle gpt-oss return/end token inconsistency (ggml-org#15421)"
This reverts commit 657b8a7.
1 parent e6bfc3f commit 68d3134

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

common/chat.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ struct templates_params {
147147
json extra_context;
148148
bool add_bos;
149149
bool add_eos;
150-
bool is_inference = true;
151150
};
152151

153152
common_chat_tool_choice common_chat_tool_choice_parse_oaicompat(const std::string & tool_choice) {
@@ -1337,17 +1336,6 @@ static common_chat_params common_chat_params_init_gpt_oss(const common_chat_temp
13371336
common_chat_params data;
13381337
auto prompt = apply(tmpl, inputs);
13391338

1340-
// Check if we need to replace the return token with end token during
1341-
// inference and without generation prompt. For more details see:
1342-
// https://github.com/ggml-org/llama.cpp/issues/15417
1343-
if (inputs.is_inference && !inputs.add_generation_prompt) {
1344-
static constexpr std::string_view return_token = "<|return|>";
1345-
static constexpr std::string_view end_token = "<|end|>";
1346-
if (size_t pos = prompt.rfind(return_token); pos != std::string::npos) {
1347-
prompt.replace(pos, return_token.length(), end_token);
1348-
}
1349-
}
1350-
13511339
data.prompt = prompt;
13521340
data.format = COMMON_CHAT_FORMAT_GPT_OSS;
13531341

0 commit comments

Comments
 (0)