Skip to content

DOC: Correct the audio scoring docstring's failure contract - #3523

Merged
Richard Lundeen (richlundeen) merged 2 commits into
microsoft:mainfrom
feiiiiii5:a250-audio-docstring
Oct 25, 2026
Merged

Richard Lundeen (richlundeen) merged 2 commits into
microsoft:mainfrom
feiiiiii5:a250-audio-docstring

Conversation

@feiiiiii5

Copy link
Copy Markdown
Contributor

Description

The docstring of AudioTranscriptHelper._score_audio_async promises ValueError: If transcription fails or returns empty text, but neither is true:

  • a failed transcription re-raises the converter's own exception as-is (_transcribe_audio_async logs and does a bare raise);
  • an empty transcript returns an empty list of scores — pinned by test_score_piece_empty_transcript — instead of erroring.

This corrects the contract: the Raises section now says the transcription step's original exception propagates unchanged, and Returns documents the empty-transcript behavior that was already implemented and tested.

Tests and Documentation

Docs-only change (docstring contract now matches the pinned behavior); no code or tests altered. Verified tests/unit/score/test_audio_scorer.py still passes (24 passed) and ruff check/format on the changed file. JupyText not affected — no code samples touched.

_score_audio_async never raises ValueError: a failed transcription
re-raises the converter's own exception, and an empty transcript returns
an empty list of scores instead of erroring.
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 25, 2026
Merged via the queue into microsoft:main with commit 246b659 Oct 25, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants