fix: remove /think trigger, add back <think> in clean_text

- Removed /think trigger from prompt (model generates better without it)
- Added <think> and </think> back to clean_text (model uses plain text
  thinking tags, not special tokens)
This commit is contained in:
Asep Haryana
2026-07-26 16:03:18 +07:00
parent 254532458b
commit 495b9ed126
+4 -2
View File
@@ -89,8 +89,8 @@ pub fn build_prompt(messages: &[ChatMessage], tools: &Option<Vec<ToolDef>>) -> S
}
}
// Generation prompt: thinking mode (MiniCPM5 native)
prompt.push_str("<|im_start|>assistant\n/think\n\n");
// Generation prompt
prompt.push_str("<|im_start|>assistant\n");
prompt
}
@@ -187,6 +187,8 @@ pub fn clean_text(text: &str) -> String {
.replace("<|tool_call|>", "")
.replace("<|execute_start|>", "")
.replace("<|execute_end|>", "")
.replace("<think>", "")
.replace("</think>", "")
.replace("/think", "")
.replace("/no_think", "")
.trim()