mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-08-14 12:19:48 -04:00
server : filter out harmony thought messages (#15278)
This commit is contained in:
Binary file not shown.
@@ -130,7 +130,12 @@ export function filterThoughtFromMsgs(messages: APIMessage[]) {
|
||||
role: msg.role,
|
||||
content:
|
||||
msg.role === 'assistant'
|
||||
? contentStr.split('</think>').at(-1)!.trim()
|
||||
? contentStr
|
||||
.split(
|
||||
/<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
|
||||
)
|
||||
.at(-1)!
|
||||
.trim()
|
||||
: contentStr,
|
||||
} as APIMessage;
|
||||
});
|
||||
|
Reference in New Issue
Block a user