Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Pyannote with SpeechBrain 1.0 #1659

Merged
merged 13 commits into from
Jun 19, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- fix: fix support for `numpy==2.x` ([@ibevers](https://github.com/ibevers/))
- fix: fix support for `speechbrain==1.x` ([@Adel-Moumen](https://github.com/Adel-Moumen/))

### Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion pyannote/audio/pipelines/speaker_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from pyannote.audio.pipelines.utils import PipelineModel, get_model

try:
from speechbrain.pretrained import (
from speechbrain.inference import (
EncoderClassifier as SpeechBrain_EncoderClassifier,
)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pytorch_metric_learning >= 2.1.0
rich >= 12.0.0
semver >= 3.0.0
soundfile >= 0.12.1
speechbrain >= 0.5.14
speechbrain >= 1.0.0
tensorboardX >= 2.6
torch >= 2.0.0
torch_audiomentations >= 0.11.0
Expand Down
20 changes: 20 additions & 0 deletions tests/test_speechbrain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import tempfile
import pytest
from speechbrain.inference import EncoderClassifier


@pytest.fixture()
def cache():
return tempfile.mkdtemp()

def test_import_speechbrain_encoder_classifier(cache):
"""This is a simple test that check if speechbrain
EncoderClassifier can be imported. It does not check
if the model is working properly.
"""

model = EncoderClassifier.from_hparams(
source="speechbrain/spkrec-ecapa-voxceleb",
savedir=cache,
)
assert isinstance(model, EncoderClassifier)
Loading