Skip to content

Update C++, C# and Python Examples - #1664

Merged
Baiju Meswani (baijumeswani) merged 6 commits into
mainfrom
sayanshaw/examples
Jul 30, 2025
Merged

Update C++, C# and Python Examples#1664
Baiju Meswani (baijumeswani) merged 6 commits into
mainfrom
sayanshaw/examples

Conversation

@sayanshaw24

@sayanshaw24 Sayan Shaw (sayanshaw24) commented Jul 29, 2025

Copy link
Copy Markdown
Collaborator

Updates

Updates examples to now use ApplyChatTemplate, including in multimodal cases as it now supports multimodal templating with a Minja-powered C++ templating engine.

Note that we decided not to use the newly added whisper chat template functionality (microsoft/onnxruntime-extensions#981) for the examples, because specifically for our examples itself, the chat template functionality (just appending message contents) does not make sense - we do not need it.

Validation

  • Native C++, Python and C# testing using phi-4, phi-3-vision, and phi-4-mm models
  • Ran C# examples e2e with project solutions

Comment thread examples/python/phi4-mm.py Fixed
Comment thread examples/python/model-vision.py
Comment thread examples/python/model-vision.py Outdated
@kunal-vaishnavi

Copy link
Copy Markdown
Contributor

Can we update the Whisper examples to use the chat template?

@sayanshaw24

Copy link
Copy Markdown
Collaborator Author

Can we update the Whisper examples to use the chat template?

After discussion with Baiju Meswani (@baijumeswani) we decided to not use the whisper chat template functionality for the examples, because specifically for our examples itself, the chat template functionality (just appending message contents) does not make sense - we do not need it. Can give you more context offline.

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.

LGTM, it looks cleaner with the content and ApplyChatTemplate.

@baijumeswani
Baiju Meswani (baijumeswani) merged commit 46a9ef2 into main Jul 30, 2025
14 checks passed
@baijumeswani
Baiju Meswani (baijumeswani) deleted the sayanshaw/examples branch July 30, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants