Skip to content

fix(audio): ignore no-speech ASR control token - #169

Closed
mikemikimike wants to merge 1 commit into
generative-computing:mainfrom
mikemikimike:fix/ignore-nospeech-token
Closed

mikemikimike wants to merge 1 commit into
generative-computing:mainfrom
mikemikimike:fix/ignore-nospeech-token

Conversation

@mikemikimike

Copy link
Copy Markdown

Fixes #165

Summary

  • Treat the <|nospeech|> control token emitted by multilingual CTC checkpoints as an empty transcript.
  • Keep the existing empty-transcript placeholder behavior so silent or non-speech audio cannot add the control token to the LLM prompt.
  • Add a regression test covering surrounding whitespace and the normalized empty result.

Tests

  • uv run --frozen --no-default-groups --extra hf --extra compose python -m pytest tests/unit/test_asr.py::TestTranscriber -q
  • uvx pre-commit run --files src/granite_switch/vllm/audio/asr.py tests/unit/test_asr.py
  • git diff --check

@mikemikimike

Copy link
Copy Markdown
Author

The focused regression tests for this change pass. The remaining failure in tests/unit/test_asr.py::TestPatchedPipelineRestores::test_pipeline_attribute_is_restored was reproduced on the base commit 1cc5225, so it is pre-existing and is not introduced by this PR. The Windows environment also cannot collect the full unit suite because the project’s GPU-only vllm dependency has no supported Windows installation.

@aviv1ron1 aviv1ron1 self-assigned this Nov 10, 2026
@aviv1ron1

Copy link
Copy Markdown
Collaborator

@mikemikimike thank you for your contribution to granite-switch! we are looking into your PR and will get back to you soon

@aviv1ron1

Copy link
Copy Markdown
Collaborator

We're closing this one in favor of #171, which takes a slightly different approach:

  • Partial matches: the check here only drops a transcript that is exactly <|nospeech|>. If the marker sits next to speech (hello <|nospeech|>), repeats, or lands in one window of a chunked long clip, it still reaches the prompt.
  • Other ASR models: the marker is specific to the ASR model, and other ASR models we may support may use different markers. So Drop configurable ASR no-speech markers from transcripts #171 makes it a config field (asr_no_speech_markers, set with --asr-no-speech-marker at compose time) instead of a hardcoded string.

@aviv1ron1 aviv1ron1 closed this Nov 10, 2026
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.

audio: ASR outputs the literal text <|nospeech|> into the LLM prompt

2 participants