-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Migrate whisper inputs to TensorSchema #23505
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
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 WhisperAudioInputs from a TypedDict to TensorSchema, introducing runtime shape validation. This is a good improvement for input contract enforcement and debuggability, aligning with the project's goals. The changes are correct and well-implemented. I have no further comments.
|
Observing failing MM test similar to #23503: Based on existing schema, this seems to be an issue with the inputs: |
Head branch was pushed to by a user without write access
|
Seeing test failures where
|
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Benji Beck <benjibeck@meta.com>
Signed-off-by: Benji Beck <benjibeck@meta.com>
Signed-off-by: Benji Beck <benjibeck@meta.com>
| input_features = torch.cat( | ||
| [feat.to(self.dtype) for feat in input_features]) | ||
|
|
||
| if input_features.size(1) == 80: |
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.
I think we should avoid changing the dimensions like this since it may affect the output of the model. IMO only squeezing or flattening should be allowed. Better to update the shape definitions instead.
Signed-off-by: Benji Beck <benjibeck@meta.com>
Signed-off-by: Benji Beck <benjibeck@meta.com>
Signed-off-by: Benji Beck <benjibeck@meta.com>
Purpose
This PR migrates WhisperAudioInputs inputs 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 debug-ability across multi-modal models.
More details: #14764 (comment)
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