fix: use "" instead of nullptr for templates requiring non null content#72
Merged
ochafik merged 1 commit intogoogle:mainfrom Jul 10, 2025
Merged
fix: use "" instead of nullptr for templates requiring non null content#72ochafik merged 1 commit intogoogle:mainfrom
"" instead of nullptr for templates requiring non null content#72ochafik merged 1 commit intogoogle:mainfrom
Conversation
Contributor
Author
|
With the Qwen3 model's chat template being improved, it seems that the change in this PR is no longer mandatory for Qwen3 template. However, it may still be meaningful for other templates that require non-null content. |
Contributor
|
Could we merge this PR? |
Contributor
|
This PR broke the chat-template tests? |
Contributor
|
Please check the fix #75 |
Contributor
That is true, tests were broken by this PR, see https://github.com/google/minja/actions/runs/15346704885/job/43184463260#step:9:7818 |
ochafik
added a commit
that referenced
this pull request
Aug 7, 2025
ochafik
added a commit
that referenced
this pull request
Aug 7, 2025
* Port content handling of #72 to python test logic * Pin dependency versions * add clangd/ to .gitignore * disable QwQ-32B test
ochafik
pushed a commit
to ochafik/minja
that referenced
this pull request
Nov 2, 2025
…ontent (google#72) fix: use empty string instead of nullptr for templates requiring non null
ochafik
added a commit
to ochafik/minja
that referenced
this pull request
Nov 2, 2025
* Port content handling of google#72 to python test logic * Pin dependency versions * add clangd/ to .gitignore * disable QwQ-32B test
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.
Description
Due to uses of
nullptrto test templates which arecaps_.requires_non_null_content == true, the capabilities of that template are being mis-estimated.In the case I saw, even though the template covers 'tool call' and 'tool response',
caps_.supports_tool_callsandcaps_.supports_tool_responseswere bothfalse, so the tool calls and tool responses are rendered with the polyfills.Currently in
main, the non-null content requirement is being checked(caps_.requires_non_null_content), but it is difficult to find any meaningful use cases.It seems desirable that this be used to suppress the above situation.