mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-08 10:07:01 +00:00
gpt-oss: implement harmony parsing (#15181)
* model : add harmony parser for gpt-oss * gpt-oss : fix grammar trigger from causing empty stack * gpt-oss: tweak the grammar trigger again * gpt-oss : add support for recipient in role header * gpt-oss : fix ungrouped tool calls in grammar * gpt-oss : loosen function name matching during parse * gpt-oss : clean up workarounds * gpt-oss : add template tests * gpt-oss : simulate thinking and tool call tags * gpt-oss : undo think tags when reasoning_format is none * gpt-oss : set special tokens back to user defined * gpt-oss : update openai-gpt-oss template * server : filter out harmony thought messages * gpt-oss : simplify parsing
This commit is contained in:
@@ -131,9 +131,7 @@ export function filterThoughtFromMsgs(messages: APIMessage[]) {
|
||||
content:
|
||||
msg.role === 'assistant'
|
||||
? contentStr
|
||||
.split(
|
||||
/<\/think>|<\|start\|>assistant<\|channel\|>final<\|message\|>/
|
||||
)
|
||||
.split(/<\/think>|<\|end\|>/)
|
||||
.at(-1)!
|
||||
.trim()
|
||||
: contentStr,
|
||||
|
||||
Reference in New Issue
Block a user