-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Migrate Paligemma inputs to TensorSchema #23470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Benji Beck <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully migrates PaliGemmaImagePixelInputs and PaliGemmaImageEmbeddingInputs from TypedDict to the TensorSchema model, which improves input validation and aligns with similar multi-modal models. The removal of the manual validation method _validate_pixel_values and the adoption of declarative shape validation via TensorSchema is a good improvement.
I have one suggestion to further enhance the input contract enforcement for image embeddings by validating the hidden size, which is currently a symbolic dimension.
Signed-off-by: Benji Beck <[email protected]> Signed-off-by: johnnynunez <[email protected]>
Signed-off-by: Benji Beck <[email protected]>
Signed-off-by: Benji Beck <[email protected]> Signed-off-by: Xiao Yu <[email protected]>
Signed-off-by: Benji Beck <[email protected]>
Signed-off-by: Benji Beck <[email protected]>
Signed-off-by: Benji Beck <[email protected]>
Signed-off-by: Benji Beck <[email protected]> Signed-off-by: Ekagra Ranjan <[email protected]>
Signed-off-by: Benji Beck <[email protected]>
Purpose
This PR migrates PaliGemmaImagePixelInputs, PaliGemmaImageEmbeddingInputs from a TypedDict-based definition to a structured TensorSchema model with runtime shape validation. This brings it in line with recent changes to Phi3VImagePixelInputs, and is part of a broader effort to improve input contract enforcement and debugability across multi-modal models.
Test Plan
Confirm validation works via standalone tests in tests/standalone_test/test_tensor_schema.py and rely on CI to check integration.
Test Result