Skip to content

Commit

Permalink
fix: fix support for speechbrain==1.0 (#1659)
Browse files Browse the repository at this point in the history
* fixes #1727 
* fixes #1677
  • Loading branch information
Adel-Moumen authored Jun 19, 2024
1 parent 1a5b870 commit bd7b977
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
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)

0 comments on commit bd7b977

Please sign in to comment.