Skip to content

Conversation

@DePasqualeOrg
Copy link
Collaborator

I still need to add a test for the SmolLM3 chat template.

@johnmai-dev
Copy link
Collaborator

You are truly outstanding.🚀🚀🚀

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Amazing!

@johnmai-dev johnmai-dev linked an issue Jul 9, 2025 that may be closed by this pull request
@DePasqualeOrg
Copy link
Collaborator Author

I added a test, but when I run it I get this error: testSmolLM3(): failed: caught error: "parser("Parser Error: Expected closing statement token. identifier != closeStatement.")

I need to leave it here for now, but maybe you can figure out what's going wrong.

@DePasqualeOrg
Copy link
Collaborator Author

DePasqualeOrg commented Jul 9, 2025

The problem seems to be Swift Jinja's handling of escaped quotation marks here:

{%- set xml_tool_string = ns.xml_tool_string + "</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>" -%}

I am not able to take on the task of fixing this separate problem, but others are welcome to do that.

If you want to try to fix it with agentic tools, I recommend cloning https://github.com/pallets/jinja inside this repo so that it can be used for reference.

johnmai-dev added a commit that referenced this pull request Jul 10, 2025
* Add tilde operator

* Add test for SmolLM3

* Fix tilde operator handling to use additive binary operator

* Add testSmolLM3FromHF

* swift-format

* Add replace function to String extension with optional count parameter

* Add unit tests for String replacingOccurrences function

* Add test for SmolLM3 template rendering with system prompt

* swift-format

---------

Co-authored-by: Anthony DePasquale <[email protected]>
@DePasqualeOrg
Copy link
Collaborator Author

@johnmai-dev, it would have made more sense to work with my original PR instead of creating a new one using my commits. I will close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse error on SmolLM3 chat template

3 participants