Bump @huggingface/jinja to pick up generation tag whitespace-trim support - #1761
Open
afonsojanu wants to merge 1 commit into
Open
Bump @huggingface/jinja to pick up generation tag whitespace-trim support#1761afonsojanu wants to merge 1 commit into
afonsojanu wants to merge 1 commit into
Conversation
…port
The bundled jinja package already gained support for the
{%- generation -%} / {%- endgeneration -%} whitespace-trim variants of
the transformers-specific generation tag back in 0.5.7, but this
package's own lockfile still resolved @huggingface/jinja to 0.5.6,
even though the ^0.5.6 range in package.json already permits the
newer release. Chat templates using the trimmed form (as some newer
models on the hub do) failed to parse with "Unknown statement type:
generation" as a result.
Bumping the declared range to ^0.5.9 and refreshing the lockfile picks
up the fix that was already available. Added a regression test that
renders a template using the trimmed tag form directly against
@huggingface/jinja's Template class.
Fixes huggingface#1724
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.
Closes #1724.
The bundled jinja package already gained support for the
{%- generation -%}/{%- endgeneration -%}whitespace-trim variants of the transformers-specific generation tag back in 0.5.7, but this package's own lockfile still resolved@huggingface/jinjato 0.5.6, even though the^0.5.6range inpackage.jsonalready permits the newer release. Chat templates using the trimmed form (as some newer models on the hub do, per the issue) failed to parse withUnknown statement type: generationas a result.Bumped the declared range to
^0.5.9and refreshed the lockfile to actually pick up the fix that was already published. Added a regression test that renders a template using the trimmed tag form directly against@huggingface/jinja'sTemplateclass, so this doesn't silently regress again if the lockfile drifts.Verified by temporarily reverting just the
package.jsonbump and reinstalling: the new test fails with the exact reportedUnknown statement type: generationerror against 0.5.6, and passes once the bump and lockfile update are restored and reinstalled.