Speaker labels were empty because whisperx 3.8.5's DiarizationPipeline wrapper
has a compatibility bug with pyannote.audio 4.0.4: the wrapper silently returns
empty segments (the 'fallback to plain text' message in 3.8.5 logs), so
segments.speaker becomes '' instead of 'SPEAKER_XX'.
Fix: load pyannote.audio.Pipeline directly and convert DiarizeOutput →
DataFrame the same way whisperx/diarize.py does internally. Verified with 30s
Cantonese clip from real recording (chunk_0.mp3):
speaker: SPEAKER_00 (was '')
text: '那就係F5嘅Low Balancer用喺你哋嘅...特別感謝Sherry...'
took: 34s for 30s audio (1.13x realtime, CPU int8 + diarize=1)
curl http://localhost:8765/transcribe -F file=@test.wav -F language=yue -F diarize=1
- Bug: long audio (32+ min) batched inference hit NoneType 'sot_sequence' error
- Root cause: faster-whisper tokenizer reset to None between VAD chunks for multilingual inference when preset_language is None
- Fix: load model with language='zh' to set preset_language, avoiding tokenizer reset
- Side effect: slightly faster (no language detection per file)
Tested on F5 Tech Refresh meeting (32:46 audio, 80 segments, 8072 chars)
Previous: failed with AttributeError: 'NoneType' object has no attribute 'sot_sequence'
After: full transcript + summary generated successfully