]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
`server`: fix tool-call of DeepSeek R1 Qwen, return reasoning_content (Command 7RB...
authorOlivier Chafik <redacted>
Thu, 13 Feb 2025 10:05:16 +0000 (10:05 +0000)
committerGitHub <redacted>
Thu, 13 Feb 2025 10:05:16 +0000 (10:05 +0000)
commitc7f460ab882065ec5696e3d51e24dbf67b539287
tree2b3d8da6aa66358f9fa478e2b1a4e6c3ef5fdc20
parent27e8a23300e30cd6ff6107ce262acf832ca60597
`server`: fix tool-call of DeepSeek R1 Qwen, return reasoning_content (Command 7RB & DeepSeek R1) unless `--reasoning-format none` (#11607)

* extract & return thoughts in reasoning_content field (unless --reasoning-format) for DeepSeek R1 & Command R7B

* tool-calls: add deepseek r1 template (models/templates/llama-cpp-deepseek-r1.jinja) + hackommodate broken official template

* tool-calls: accommodate variety of wrong tool call opening tags both R1 Qwen 32B and 7B distills like to spit out

* server/oai: ensure content is null when there are tool calls, and reasoning_content appears before content for readability

* tool-calls: add DeepSeek R1 Qwen distills to server/README.md & server tests

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
17 files changed:
common/arg.cpp
common/chat.cpp
common/chat.hpp
common/common.h
common/sampling.cpp
examples/server/README.md
examples/server/server.cpp
examples/server/tests/unit/test_tool_call.py
examples/server/tests/utils.py
examples/server/utils.hpp
models/templates/README.md [new file with mode: 0644]
models/templates/deepseek-ai-DeepSeek-R1-Distill-Llama-8B.jinja
models/templates/deepseek-ai-DeepSeek-R1-Distill-Qwen-32B.jinja
models/templates/llama-cpp-deepseek-r1.jinja [new file with mode: 0644]
scripts/get_chat_template.py [changed mode: 0644->0755]
src/llama-grammar.cpp
tests/test-chat.cpp