Skip to content

fix: copy chat_template.jinja to ORT GenAI export folder - #198

Merged
justinchuby merged 2 commits into
mainfrom
justinchu/chat-template-jinja
Apr 23, 2026
Merged

fix: copy chat_template.jinja to ORT GenAI export folder#198
justinchuby merged 2 commits into
mainfrom
justinchu/chat-template-jinja

Conversation

@justinchuby

Copy link
Copy Markdown
Member

The --runtime ort-genai export copies tokenizer files to the output directory but was missing chat_template.jinja. ORT GenAI uses this file for chat formatting when present.

Added chat_template.jinja to the file list in both _copy_tokenizer_files() (HF Hub download) and _copy_tokenizer_files_from_local() (local copy). Both paths already silently skip missing files, so models without a chat template are unaffected.

Add chat_template.jinja to the tokenizer files list in both
_copy_tokenizer_files() and _copy_tokenizer_files_from_local().
Missing files are silently skipped, so models without a chat
template are unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
@github-actions

github-actions Bot commented Apr 23, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing f27118b08aa807

Model Sub-model Changes Status

No architecture changes detected.


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@github-actions

github-actions Bot commented Apr 23, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing f27118b08aa807

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0%
bert (feature-extraction) num_nodes 60 60 +0.0%
falcon model_size_bytes 364 KB 364 KB +0.0%
falcon num_nodes 66 66 +0.0%
gemma2 model_size_bytes 428 KB 428 KB +0.0%
gemma2 num_nodes 107 107 +0.0%
gpt2 model_size_bytes 388 KB 388 KB +0.0%
gpt2 num_nodes 53 53 +0.0%
llama model_size_bytes 425 KB 425 KB +0.0%
llama num_nodes 61 61 +0.0%
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0%
llama (static-cache) num_nodes 58 58 +0.0%
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0%
mamba (ssm-text-generation) num_nodes 98 98 +0.0%
phi3 model_size_bytes 421 KB 421 KB +0.0%
phi3 num_nodes 59 59 +0.0%
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0%
phi3 (static-cache) num_nodes 56 56 +0.0%
qwen2 model_size_bytes 425 KB 425 KB +0.0%
qwen2 num_nodes 61 61 +0.0%
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0%
qwen2 (static-cache) num_nodes 58 58 +0.0%
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0%
qwen3_5_moe (hybrid-text-generation) num_nodes 275 275 +0.0%
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0%
qwen3_5_text (hybrid-text-generation) num_nodes 129 129 +0.0%
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0%
qwen3_5_vl (hybrid-qwen-vl) num_nodes 408 408 +0.0%
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0%
t5 (seq2seq) num_nodes 166 166 +0.0%
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0%
whisper (speech-to-text) num_nodes 128 128 +0.0%

No performance regressions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes ORT GenAI export artifacts by ensuring chat_template.jinja is copied into the output directory when present, enabling ORT GenAI chat formatting without impacting models that don’t ship a template.

Changes:

  • Add chat_template.jinja to the tokenizer artifact copy list for HuggingFace Hub downloads.
  • Add chat_template.jinja to the tokenizer artifact copy list for local directory exports.

Comment thread src/mobius/integrations/ort_genai/auto_export.py
Comment thread src/mobius/integrations/ort_genai/auto_export.py
@codecov

codecov Bot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchu@microsoft.com>
@justinchuby
justinchuby requested a review from apsonawane April 23, 2026 18:46
@justinchuby
justinchuby merged commit 1045792 into main Apr 23, 2026
22 of 23 checks passed
@justinchuby
justinchuby deleted the justinchu/chat-template-jinja branch April 23, 2026 19:00
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.

2 participants