Skip to content

fix(whisperx): reject unconfigured diarization - #11521

Open
localai-org-maint-bot wants to merge 1 commit into
masterfrom
bot/issue-11520-whisperx-diarization
Open

fix(whisperx): reject unconfigured diarization#11521
localai-org-maint-bot wants to merge 1 commit into
masterfrom
bot/issue-11520-whisperx-diarization

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Description

This PR fixes #11520.

WhisperX now rejects diarization requests with a clear FailedPrecondition when HF_TOKEN is missing instead of silently returning a transcript without speaker labels. It also converts WhisperX segment timestamps from seconds to LocalAI's nanosecond duration unit.

Focused unit tests cover the token requirement and timestamp conversion. The audio-to-text documentation now describes WhisperX diarization setup and the missing-token error.

Notes for Reviewers

Verification:

python3 -m unittest test_transcript_utils.py
python3 -m py_compile backend.py transcript_utils.py test_transcript_utils.py
git diff --check

The full WhisperX backend suite was not run because it installs the backend and downloads real models.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

WhisperX silently returned a plain transcript when diarization lacked
the Hugging Face token required to load pyannote. Reject that request
clearly so callers do not mistake missing speaker labels for a
successful diarization.

Convert WhisperX seconds to the nanosecond duration unit used by the
transcription API.

Assisted-by: Codex:gpt-5
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.

whisperx doesn't return speaker when diarization is requested

1 participant