Skip to content

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

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

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

Signed-off-by: mikemikimike <13286568797@163.com>
@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.

This branch has not been deployed

No deployments
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

1 participant