Skip to content

fix: bump @huggingface/jinja to ^0.5.9 for {%- generation -%} support#1725

Open
wwhsaber wants to merge 1 commit into
huggingface:mainfrom
wwhsaber:fix/bump-huggingface-jinja-generation-tags
Open

fix: bump @huggingface/jinja to ^0.5.9 for {%- generation -%} support#1725
wwhsaber wants to merge 1 commit into
huggingface:mainfrom
wwhsaber:fix/bump-huggingface-jinja-generation-tags

Conversation

@wwhsaber

Copy link
Copy Markdown

Summary

  • Bumps @huggingface/jinja from ^0.5.6^0.5.9 and updates pnpm-lock.yaml accordingly.
  • Fixes chat templates that use whitespace-control custom generation tags ({%- generation -%} / {%- endgeneration -%}), as used by LiquidAI LFM models.

Why

@huggingface/jinja@0.5.6 only strips plain {% generation %} tags. Templates with {%- generation -%} leave a generation statement for the parser and throw:

Unknown statement type: generation

Support for whitespace-control generation tags was added in @huggingface/jinja@0.5.8 (huggingface/huggingface.js#2124). Latest published is 0.5.9.

Verification

Rendered a minimal template with {%- generation -%} against both versions:

Version Result
0.5.6 Unknown statement type: generation
0.5.9 Renders successfully

Plain {% generation %} continues to work on both.

Test plan

  • Confirm npm package versions/integrity for 0.5.9
  • Repro failure on 0.5.6 and success on 0.5.9 with {%- generation -%}
  • CI / maintainer release of @huggingface/transformers after merge

Closes #1724

Chat templates that use `{%- generation -%}` (e.g. LiquidAI LFM models)
throw `Unknown statement type: generation` with jinja 0.5.6 because that
release only stripped plain `{% generation %}` tags.

@huggingface/jinja 0.5.8+ honors whitespace-control generation tags
(huggingface/huggingface.js#2124). Bump the dependency and lockfile so
installs resolve a fixed version.

Closes huggingface#1724
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.

LFM uses {%- generation -%} found only in newer jinja not used by transformers.js

2 participants