-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Adding chat template support for Granite model #14864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ork to include libcommon.a to expose chat template processing
The |
Thank's for the update. I've reverted build-xcframework.sh to it's original form and the rest of the change set is model template specific which should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though would be nice to have a second look from somebody more familiar with tools/templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the Granite chat template format by IBM, including thinking (reasoning) capabilities and tool calling functionality. The implementation includes format detection, template processing, and message parsing for the Granite model.
- Adds COMMON_CHAT_FORMAT_GRANITE enum value and associated parsing logic
- Implements granite-specific thinking tag support with COMMON_REASONING_FORMAT_GRANITE
- Enhances tool call argument parsing to handle both object and string formats
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
common/common.h | Adds COMMON_REASONING_FORMAT_GRANITE enum for granite thinking format |
common/chat.h | Adds COMMON_CHAT_FORMAT_GRANITE enum for granite chat format |
common/chat.cpp | Implements granite template initialization, parsing logic, and format detection |
common/chat-parser.cpp | Enhances tool call argument handling for object/string formats |
tests/test-chat.cpp | Adds comprehensive test coverage for granite format functionality |
This adds support for the chat template Granite model. It also modified build-xcframework.sh to include libcommon.a and supporting header files so the built framework can be used by a Swift wrapper for template processing.