fix: fix support for speechbrain==1.0 (#1659)

* fixes #1727 
* fixes #1677
This commit is contained in:
Adel Moumen
2024-06-19 07:58:31 -04:00
committed by GitHub
parent 1a5b870a90
commit bd7b977c21
4 changed files with 23 additions and 2 deletions
+1
View File
@@ -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
@@ -40,7 +40,7 @@ from pyannote.audio.core.model import CACHE_DIR
from pyannote.audio.pipelines.utils import PipelineModel, get_model
try:
from speechbrain.pretrained import (
from speechbrain.inference import (
EncoderClassifier as SpeechBrain_EncoderClassifier,
)
+1 -1
View File
@@ -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
+20
View File
@@ -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)