Skip to content

Conversation

@ochafik
Copy link
Collaborator

@ochafik ochafik commented Mar 10, 2025

Fixes #12275

Note: unrelated to this PR, but streaming mode is still not dealing w/ thoughts extraction, which means templates that pre-feed the <think> tag (like DeepSeek R1 Distills & QwQ-32B) will lack the <think> tag in their output. Will address separately w/ a streaming overhaul + tool call support.

@github-actions github-actions bot added the testing Everything test related label Mar 10, 2025
common/chat.cpp Outdated
Comment on lines 1126 to 1128
static std::regex function_regex("<|tool▁call▁begin|>function<|tool▁sep|>([^\n]+)\n```json\n");
static std::regex close_regex("```[\\s\\r\\n]*<|tool▁call▁end|>");
static std::regex tool_calls_regex("[\\s\\r\\n]*(?:<|tool▁calls▁begin|>|<|tool_calls_begin|>|<|tool calls begin|>|<|tool\\\\_calls\\\\_begin|>)([\\s\\S\\r\\n]*?)<|tool▁calls▁end|>");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be static const

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks!

@ochafik ochafik marked this pull request as ready for review March 10, 2025 09:50
@ochafik ochafik merged commit 4e39a3c into ggml-org:master Mar 10, 2025
24 checks passed
@ochafik ochafik deleted the qwq-think branch March 10, 2025 12:33
jpohhhh pushed a commit to Telosnex/llama.cpp that referenced this pull request Mar 14, 2025
* extract <think> tags from qwq outputs

* const for all static regexes in chat.cpp
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Mar 19, 2025
* extract <think> tags from qwq outputs

* const for all static regexes in chat.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: QwQ 32B doesn't put the reasoning content in message.reasoning_content

3 participants