Skip to content

Commit

Permalink
improve(io): switch to torchaudio >= 2.2.0 (pyannote#1674)
Browse files Browse the repository at this point in the history
fix: fixes pyannote#1576
  • Loading branch information
hbredin authored Mar 17, 2024
1 parent bad6179 commit dc49f37
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

- improve(metric): add support for number of speakers mismatch in `diarization_error_rate` metric
- improve(pipeline): track both `Model` and `nn.Module` attributes in `Pipeline.to(device)`
- improve(io): switch to `torchaudio >= 2.2.0`

## Breaking changes

Expand Down
2 changes: 0 additions & 2 deletions pyannote/audio/core/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
from pyannote.core import Segment
from torch import Tensor

torchaudio.set_audio_backend("soundfile")

AudioFile = Union[Text, Path, IOBase, Mapping]

AudioFileDocString = """
Expand Down
4 changes: 0 additions & 4 deletions pyannote/audio/pipelines/speaker_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import numpy as np
import torch
import torch.nn.functional as F
import torchaudio
import torchaudio.compliance.kaldi as kaldi
from huggingface_hub import hf_hub_download
from huggingface_hub.utils import RepositoryNotFoundError
Expand All @@ -40,7 +39,6 @@
from pyannote.audio.core.model import CACHE_DIR
from pyannote.audio.pipelines.utils import PipelineModel, get_model

backend = torchaudio.get_audio_backend()
try:
from speechbrain.pretrained import (
EncoderClassifier as SpeechBrain_EncoderClassifier,
Expand All @@ -49,8 +47,6 @@
SPEECHBRAIN_IS_AVAILABLE = True
except ImportError:
SPEECHBRAIN_IS_AVAILABLE = False
finally:
torchaudio.set_audio_backend(backend)

try:
from nemo.collections.asr.models import (
Expand Down
2 changes: 1 addition & 1 deletion pyannote/audio/tasks/segmentation/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from pyannote.database.protocol.protocol import Scope, Subset
from pytorch_lightning.loggers import MLFlowLogger, TensorBoardLogger
from torch.utils.data._utils.collate import default_collate
from torchaudio.backend.common import AudioMetaData
from torchaudio import AudioMetaData
from torchmetrics import Metric
from torchmetrics.classification import BinaryAUROC, MulticlassAUROC, MultilabelAUROC

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ speechbrain >= 0.5.14
tensorboardX >= 2.6
torch >= 2.0.0
torch_audiomentations >= 0.11.0
torchaudio >= 2.0.0
torchaudio >= 2.2.0
torchmetrics >= 0.11.0

0 comments on commit dc49f37

Please sign in to comment.