From eb08c1fef950d5e1cb754167af6db795b66caa44 Mon Sep 17 00:00:00 2001 From: itqop Date: Thu, 19 Feb 2026 04:11:36 +0300 Subject: [PATCH] fixes bugs --- README.md | 5 ++--- requirements.txt | 1 - transcriber/diarization/pyannote_engine.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3efad96..811f89a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Возможности - Распознавание речи (faster-whisper, модель large-v3) -- Диаризация спикеров (pyannote.audio 3.1) +- Диаризация спикеров (pyannote.audio community-1) - Поддержка форматов: `.m4a`, `.mp3`, `.wav`, `.aac` - Аудио до 3 часов / 2 ГБ - Автоматический чанкинг для длинных записей (>30 мин) @@ -38,8 +38,7 @@ HF_TOKEN=hf_your_token_here > Для получения токена: https://huggingface.co/settings/tokens > Необходимо принять условия использования моделей: -> - https://huggingface.co/pyannote/speaker-diarization-3.1 -> - https://huggingface.co/pyannote/segmentation-3.0 +> - https://huggingface.co/pyannote/speaker-diarization-community-1 ## Использование diff --git a/requirements.txt b/requirements.txt index ef65724..481f457 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ faster-whisper pyannote.audio python-dotenv -pydub tqdm diff --git a/transcriber/diarization/pyannote_engine.py b/transcriber/diarization/pyannote_engine.py index 7ba07c1..ec95676 100644 --- a/transcriber/diarization/pyannote_engine.py +++ b/transcriber/diarization/pyannote_engine.py @@ -23,7 +23,7 @@ class DiarizationEngine: def __init__(self, hf_token: str, device: str): logger.info("Loading diarization pipeline on %s", device) self._pipeline = Pipeline.from_pretrained( - "pyannote/speaker-diarization-3.1", + "pyannote/speaker-diarization-community-1", token=hf_token, ) self._device = torch.device(device) @@ -57,7 +57,7 @@ class DiarizationEngine: diarization = self._pipeline(audio_path, hook=hook, **kwargs) turns = [] - for turn, _, speaker in diarization.itertracks(yield_label=True): + for turn, speaker in diarization.exclusive_speaker_diarization: turns.append(SpeakerTurn( start=turn.start, end=turn.end,