Skip to content

fix: replace assert statements with explicit raise in ASR models#15454

Open
stanley1208 wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
stanley1208:fix/replace-assert-with-raise-asr-models
Open

fix: replace assert statements with explicit raise in ASR models#15454
stanley1208 wants to merge 1 commit intoNVIDIA-NeMo:mainfrom
stanley1208:fix/replace-assert-with-raise-asr-models

Conversation

@stanley1208
Copy link
Contributor

What does this PR do?

Replace 5 assert statements with explicit raise ValueError/raise RuntimeError across 4 ASR files, per the Contributor guidelines which state:

"RaiseError is preferred to assert"

This is a follow-up to #15444 which applied the same fix to aed_multitask_models.py.

Changes:

  • hybrid_rnnt_ctc_models.py:342 — Validate decoder_type and ctc_decoder attribute
  • sortformer_diar_models.py:470 — Validate batch size consistency after signal processing
  • msdd_models.py:459 — Validate gradient detachment of ms_avg_embs
  • msdd_models.py:750 — Validate scale mapping dimensions match
  • manifest_utils.py:338 — Validate data path count matches expected count

Collection: ASR

Changelog

  • Replace 5 assert statements with raise ValueError/raise RuntimeError across 4 ASR files

Before your PR is "Ready for review"

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests? (N/A — no behavior change)
  • Did you add or update any necessary documentation?

PR Type:

  • Bugfix

Signed-off-by: stanley1208 <stanley.mei08@gmail.com>
Made-with: Cursor
@github-actions github-actions bot added the ASR label Mar 1, 2026
@stanley1208
Copy link
Contributor Author

@nithinraok Ready for review — follow-up to #15444, replaces 5 more assert statements across 4 ASR files per CONTRIBUTING.md guidelines. Thanks!

@chtruong814 chtruong814 added the needs-follow-up Issue needs follow-up label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants