Repository navigation
add missing context/toolcall parameters - #140
Merged
Merged
Conversation
davidkoski
commented
Mar 10, 2026
| let promptTokens = try tokenizer.applyChatTemplate(messages: messages) | ||
| let promptTokens = try tokenizer.applyChatTemplate( | ||
| messages: messages, tools: input.tools, | ||
| additionalContext: input.additionalContext) |
Member
Author
There was a problem hiding this comment.
I think the VLMs got copy & pasted without the tool and additional context (e.g. thinking) -- tool calling was probably not in place when the first VLM was built.
Anyway, see also #139 which is the same issue.
davidkoski
commented
Mar 10, 2026
| /// | ||
| /// - Parameter messages: Array of message dictionaries with "role" and "content" keys | ||
| /// - Returns: Array of token IDs | ||
| @available(*, deprecated, message: "Use applyChatTemplate directly on tokenizer") |
Member
Author
There was a problem hiding this comment.
This one is unused in the library -- warn people not to call it because it doesn't have the extra parameters.
4 tasks done
davidkoski
force-pushed
the
tool-calling
branch
from
March 26, 2026 15:51
664d92d to
ca5a32c
Compare
alankessler
added a commit
to alankessler/mlx-swift-lm
that referenced
this pull request
Mar 31, 2026
GlmOcr never forwarded tools or additionalContext to applyChatTemplate (added after ml-explore#140, missed the pattern). SmolVLM2's video path was also missing them while its other two branches had them.
viktike
pushed a commit
to viktike/mlx-swift-lm
that referenced
this pull request
Mar 31, 2026
GlmOcr never forwarded tools or additionalContext to applyChatTemplate (added after ml-explore#140, missed the pattern). SmolVLM2's video path was also missing them while its other two branches had them.
TheTom
referenced
this pull request
in TheTom/mlx-swift-lm
Apr 5, 2026
* add missing context/toolcall parameters - see ekryski#139
alankessler
added a commit
to alankessler/mlx-swift-lm
that referenced
this pull request
Apr 15, 2026
GlmOcr never forwarded tools or additionalContext to applyChatTemplate (added after ml-explore#140, missed the pattern). SmolVLM2's video path was also missing them while its other two branches had them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes