mirror of
https://github.com/pyannote/pyannote-audio.git
synced 2026-11-20 13:07:51 +09:00
chore: remove speechbrain and fix io unit tests (#1938)
This commit is contained in:
1 parent
f496beb40a
commit
3f2f34deeb
3 files changed
+5
-24
No files matched your search
+1
-1
@@ -36,7 +36,7 @@ dependencies = [
|
||||
pyannote-audio = "pyannote.audio.__main__:app"
|
||||
|
||||
[project.optional-dependencies]
|
||||
test = ["papermill>=2.6.0", "pytest>=8.3.4", "speechbrain>=1.0.2"]
|
||||
test = ["papermill>=2.6.0", "pytest>=8.3.4"]
|
||||
doc = ["sphinx-rtd-theme>=3.0.2", "sphinx>=8.1.3"]
|
||||
cli = ["typer>=0.15.1"]
|
||||
separation = ["asteroid>=0.5.2", "transformers>=4.48.3"]
|
||||
|
||||
+4
-3
@@ -1,5 +1,6 @@
|
||||
import torch
|
||||
import torchaudio
|
||||
from torchcodec.decoders import AudioDecoder, AudioStreamMetadata
|
||||
|
||||
from pyannote.core import Segment
|
||||
from torch import Tensor
|
||||
|
||||
@@ -9,8 +10,8 @@ from pyannote.audio.core.io import Audio
|
||||
def test_audio_resample():
|
||||
"Audio is correctly resampled when it isn't the correct sample rate"
|
||||
test_file = "tests/data/dev00.wav"
|
||||
info = torchaudio.info(test_file)
|
||||
old_sr = info.sample_rate
|
||||
metadata: AudioStreamMetadata = AudioDecoder(test_file).metadata
|
||||
old_sr = metadata.sample_rate
|
||||
loader = Audio(sample_rate=old_sr // 2, mono="downmix")
|
||||
wav, sr = loader(test_file)
|
||||
assert isinstance(wav, Tensor)
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
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)
|
||||
Reference in new issue
Block a user