Skip to content

[ASR] Add missing Python 3 type hints to transcribe_utils.py#15707

Open
shivansh023023 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
shivansh023023:typing/add-type-hints-transcribe-utils
Open

[ASR] Add missing Python 3 type hints to transcribe_utils.py#15707
shivansh023023 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
shivansh023023:typing/add-type-hints-transcribe-utils

Conversation

@shivansh023023
Copy link
Copy Markdown

What does this PR do?

Adds complete Python 3 type annotations to public functions in
nemo/collections/asr/parts/utils/transcribe_utils.py, as required by
CONTRIBUTING.md: "Use Python 3 type hints for every class and method exposed to the user."

Collection: ASR

Changelog

  • Added Dict to the existing typing imports
  • get_buffered_pred_feat_rnnt: manifest, filepaths, target_lang_idOptional[...]
  • get_buffered_pred_feat_multitaskAED: manifest, filepathsOptional[...]
  • restore_transcription_order: return type listUnion[List, Tuple]
  • normalize_timestamp_output: timestamps: dictDict, added -> Dict return type
  • write_transcription: filepathsOptional[List[str]]
  • compute_metrics_per_sample: output_manifest_pathOptional[str]
  • PunctuationCapitalization.__init__: added -> None return type

Usage

No API changes. Type hints are purely additive and improve IDE autocompletion
and static analysis for downstream users subclassing or calling these utilities.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests? — No tests needed, annotations only
  • Did you add or update any necessary documentation? — No docs changes needed
  • Does the PR affect components that are optional to install? — No

PR Type:

  • New Feature
  • Bugfix
  • Documentation / Code Style

Additional Information

Adds complete type annotations to public functions in
nemo/collections/asr/parts/utils/transcribe_utils.py as required
by CONTRIBUTING.md: 'Use Python 3 type hints for every class and
method exposed to the user.'

Changes:
- Added Dict to typing imports
- get_buffered_pred_feat_rnnt: manifest, filepaths, target_lang_id -> Optional[...]
- get_buffered_pred_feat_multitaskAED: manifest, filepaths -> Optional[...]
- restore_transcription_order: return type list -> Union[List, Tuple]
- normalize_timestamp_output: dict -> Dict, added -> Dict return type
- write_transcription: filepaths -> Optional[List[str]]
- compute_metrics_per_sample: output_manifest_path -> Optional[str]
- PunctuationCapitalization.__init__: added -> None return type

No logic changes — annotations only.

Signed-off-by: Hackathon User <hackathon@example.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 17, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASR community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants