Add gemma4 unit tests - #2151
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Python pytest module intended to validate Gemma4 multimodal integration in onnxruntime_genai, including basic processor behavior (text-only and vision) and ONNX I/O interface checks for the vision/embedding/decoder components.
Changes:
- Introduces
test/python/test_gemma4_models.pywith Gemma4 model load + multimodal processor tests. - Adds image-path, image-bytes, and multi-image prompt preprocessing coverage for Gemma4.
- Adds ONNX graph interface validation assertions for Gemma4 dummy vision/embedding/text models.
baijumeswani
left a comment
Collaborator
There was a problem hiding this comment.
Do these tests only run locally or was the intention to also enable it in the CI pipeline?
baijumeswani
previously approved these changes
May 20, 2026
baijumeswani
approved these changes
May 20, 2026
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.
This pull request adds a comprehensive test suite for the Gemma4 multimodal model, covering model loading, text-only and vision (image) processing, and validation of ONNX model input/output interfaces. These tests ensure that the Gemma4 model and its components function as expected for both text and image modalities.
The most important changes include:
New test coverage for Gemma4 multimodal model:
onnxruntime_genailibrary (test_gemma4_models.py).input_ids,pixel_values, andtoken_type_ids.ONNX model interface validation:
pixel_valuesinput.