fix: copy chat_template.jinja to ORT GenAI export folder - #198
Merged
Conversation
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>
Performance Comparison
|
Contributor
There was a problem hiding this comment.
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.jinjato the tokenizer artifact copy list for HuggingFace Hub downloads. - Add
chat_template.jinjato the tokenizer artifact copy list for local directory exports.
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>
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.
The
--runtime ort-genaiexport copies tokenizer files to the output directory but was missingchat_template.jinja. ORT GenAI uses this file for chat formatting when present.Added
chat_template.jinjato 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.