Fix broken file transcription and speaker diarization
qwen3 backend: model list pointed at nonexistent HF repos (Qwen3-ASR-2B/8B don't exist), and inference went through the generic HF ASR pipeline with Whisper-only options (return_timestamps, task/language generate_kwargs) that Qwen3-ASR's chat-style architecture doesn't support. Switched to the real 0.6B/1.7B-hf checkpoints and drive them via processor.apply_transcription_request() + model.generate(). Also added an ffmpeg pre-conversion step since the model's feature extractor can't decode m4a via librosa. faster-whisper backend: speaker diarization was broken by two pyannote.audio API changes it hadn't caught up with (use_auth_token= renamed to token=, and pipeline() now returns a DiarizeOutput wrapper instead of an Annotation directly). Also pinned LD_LIBRARY_PATH for that worker so it picks up its own venv's cuDNN instead of the older one shadowing it via the container's global LD_LIBRARY_PATH, which crashed pyannote's GPU init. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -209,7 +209,7 @@ def _get_diarization_pipeline():
|
||||
raise RuntimeError("화자 분리를 사용하려면 PYANNOTE_HF_TOKEN 환경변수를 설정하세요.")
|
||||
_DIARIZATION_PIPELINE = Pipeline.from_pretrained(
|
||||
"pyannote/speaker-diarization-3.1",
|
||||
use_auth_token=PYANNOTE_HF_TOKEN,
|
||||
token=PYANNOTE_HF_TOKEN,
|
||||
)
|
||||
if DEVICE == "cuda":
|
||||
import torch
|
||||
@@ -234,7 +234,9 @@ def _apply_diarization(
|
||||
if max_speakers is not None:
|
||||
kwargs["max_speakers"] = max_speakers
|
||||
|
||||
diarization = pipeline(str(audio_path), **kwargs)
|
||||
# pyannote.audio 4.x: pipeline() returns a DiarizeOutput dataclass instead of
|
||||
# an Annotation directly; the itertracks-capable Annotation is .speaker_diarization.
|
||||
diarization = pipeline(str(audio_path), **kwargs).speaker_diarization
|
||||
segments = result.get("segments", [])
|
||||
for seg in segments:
|
||||
seg_start = float(seg.get("start", 0))
|
||||
|
||||
Reference in New Issue
Block a user