Skip to content

Conversation

@sayanshaw24
Copy link
Collaborator

@sayanshaw24 sayanshaw24 commented Oct 10, 2025

Description

This PR introduces support for the Qwen3 chat template.

Previously, attempting to apply a Qwen3 chat template with ApplyChatTemplate would result in a runtime error:
RuntimeError: Invalid or unsupported chat template.

The changes in this PR updates the Minja engine used for C++ parsing of Jinja code, to support cases such as str.startswith() and [::-1] as described here in order to ensure correct Qwen3 chat template application.

Validation

  • Native C++ testing against expected HuggingFace output for Qwen/Qwen3-0.6B.

@sayanshaw24 sayanshaw24 marked this pull request as ready for review October 10, 2025 19:28
@sayanshaw24 sayanshaw24 requested a review from a team as a code owner October 10, 2025 19:28
@sayanshaw24 sayanshaw24 enabled auto-merge (squash) October 10, 2025 19:49
@sayanshaw24 sayanshaw24 merged commit 9790faf into main Oct 10, 2025
46 of 47 checks passed
@sayanshaw24 sayanshaw24 deleted the sayanshaw/qwen3 branch October 10, 2025 20:02
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.

3 participants