mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-08-14 20:29:41 -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,
|
role: msg.role,
|
||||||
content:
|
content:
|
||||||
msg.role === 'assistant'
|
msg.role === 'assistant'
|
||||||
? contentStr.split('</think>').at(-1)!.trim()
|
? contentStr
|
||||||
|
.split(
|
||||||
|
/<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
|
||||||
|
)
|
||||||
|
.at(-1)!
|
||||||
|
.trim()
|
||||||
: contentStr,
|
: contentStr,
|
||||||
} as APIMessage;
|
} as APIMessage;
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user