fix: replace assert statements with raise ValueError in EncDecMultiTaskModel#15444
Open
stanley1208 wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
Open
fix: replace assert statements with raise ValueError in EncDecMultiTaskModel#15444stanley1208 wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
stanley1208 wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
Conversation
…skModel Signed-off-by: stanley1208 <stanley.mei08@gmail.com> Made-with: Cursor
Contributor
Author
|
@nithinraok Ready for review — replaces 5 assert statements with raise ValueError per CONTRIBUTING.md guidelines. No behavior change, just safer error handling. Thanks! |
Collaborator
|
Looks good, please fix the checks |
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.
What does this PR do?
Replace 5
assertstatements with explicitraise ValueErrorinEncDecMultiTaskModeland its prompt parsing utility, per the Contributor guidelines which state:assertstatements are silently removed when Python runs with the-O(optimize) flag, meaning invalid inputs would pass through uncaught in production.raise ValueErroralways executes regardless of optimization flags.Changes:
timestampsparameter withraise ValueErrorinstead ofassertuse_lhotseconfig withraise ValueErrorinstead ofassertraise ValueErrorinstead ofassertraise ValueErrorinstead ofassertprompt["slots"]type withraise ValueErrorinstead ofassertCollection: ASR
Changelog
assertstatements withraise ValueErrorinaed_multitask_models.pyBefore your PR is "Ready for review"
PR Type: