Skip to content

Copy the template resolution logic from the base apply_chat_template to Voxtral#45117

Merged
Rocketknight1 merged 3 commits intomainfrom
fix-voxtral-chat-template-none
Apr 10, 2026
Merged

Copy the template resolution logic from the base apply_chat_template to Voxtral#45117
Rocketknight1 merged 3 commits intomainfrom
fix-voxtral-chat-template-none

Conversation

@Rocketknight1
Copy link
Copy Markdown
Member

Fixes #45084. We need to resolve the chat template in the Voxtral code to avoid None being passed to _get_template_variables()!

cc @zucchini-nlp, follow-up to #44881

@Rocketknight1 Rocketknight1 marked this pull request as ready for review March 30, 2026 12:34
@Rocketknight1 Rocketknight1 force-pushed the fix-voxtral-chat-template-none branch from fdb29a9 to 04a890a Compare March 30, 2026 12:34
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Great thanks a lot, caught up with model release and forgot about a failing test

@Rocketknight1 Rocketknight1 force-pushed the fix-voxtral-chat-template-none branch from c03a5ea to e87bb2e Compare April 9, 2026 15:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

[For maintainers] Suggested jobs to run (before merge)

run-slow: voxtral

@Rocketknight1
Copy link
Copy Markdown
Member Author

Rocketknight1 commented Apr 9, 2026

@zucchini-nlp my bad, I actually misread the Voxtral processor. Almost all of the actual handling is done inside self.tokenizer.apply_chat_template(). I think the right solution is just to leave the code alone, but fix _get_template_variables() so it doesn't crash when an empty template is passed. We can't really figure out the template variables for Voxtral anyway, since I think it uses mistral_common rather than jinja.

Updated the code to just handle that instead! Can you take another look and I'll merge if you're happy?

@zucchini-nlp
Copy link
Copy Markdown
Member

Hmm I guess voxtral has no special kwargs expected for jinja, right? Should be fine in that case, otherwise we might need to manually define template_kwargs

Those jinja-kwargs can't be passed over to processor, it'll return ValueError at some point

@Rocketknight1 Rocketknight1 force-pushed the fix-voxtral-chat-template-none branch from 7312a5f to b5bd46a Compare April 10, 2026 12:59
@Rocketknight1
Copy link
Copy Markdown
Member Author

run-slow: voxtral

@github-actions
Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

This comment contains run-slow, running the specified jobs:

models: ["models/voxtral"]
quantizations: []

@github-actions
Copy link
Copy Markdown
Contributor

CI Results

Workflow Run ⚙️

Commit Info

Context Commit Description
RUN fe64f6e5 workflow commit (merge commit)
PR b5bd46a8 branch commit (from PR)
main c9f1b95a base commit (on main)

Model CI Report

4 new failed tests from this PR 😭

  • voxtral:
    tests/models/voxtral/test_modeling_voxtral.py::VoxtralForConditionalGenerationIntegrationTest::test_mini_multi_turn_text_and_audio (❌ ⟹ ❌)
    tests/models/voxtral/test_modeling_voxtral.py::VoxtralForConditionalGenerationIntegrationTest::test_mini_single_turn_audio_only (❌ ⟹ ❌)
    tests/models/voxtral/test_modeling_voxtral.py::VoxtralForConditionalGenerationIntegrationTest::test_mini_single_turn_text_and_audio (❌ ⟹ ❌)
    tests/models/voxtral/test_modeling_voxtral.py::VoxtralForConditionalGenerationIntegrationTest::test_mini_single_turn_text_and_multiple_audios_batched (❌ ⟹ ❌)

@Rocketknight1
Copy link
Copy Markdown
Member Author

Those tests are all failing already on main, so I don't think they should block this! We might want to check them in a future PR

@Rocketknight1 Rocketknight1 added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 5c7190f Apr 10, 2026
29 of 30 checks passed
@Rocketknight1 Rocketknight1 deleted the fix-voxtral-chat-template-none branch April 10, 2026 14:36
sirzechs66 pushed a commit to sirzechs66/transformers that referenced this pull request Apr 18, 2026
…to Voxtral (huggingface#45117)

* Copy the template resolution logic from the base apply_chat_template to the voxtral override

* Just return an empty set from the template variables scan instead

* Revert other changes
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.

TypeError: Can't compile non template nodes

3 participants