Files
pyannote-audio/tests/test_separation.py
T
ea18bc70d8 Align audio CI and releases; require Python 3.11 (#2081)
* feat(cli): add --subfolder option to benchmark command (#2063)
* fix(utils): fix `SpeakerDiarizationMixin.optimal_mapping` when `reference` is a mapping
* fix(task): fix `balance` option crashing training with `KeyError: 'metadata'` (#2067)
* fix(io): fix `Audio.crop` raising when an in-memory waveform is cropped up to its very end (#2068)
* fix(model): make Model.default_activation return identity for unsupported tasks
* fix: compute sample duration from preloaded waveform
* fix(pipeline): omit unset runtime options from model references (#2080)

Co-authored-by: abeeranajam31 <128603901+abeeranajam31@users.noreply.github.com>
Co-authored-by: antoinelaurent <antoinelaurent@me.com>
Co-authored-by: Kayvan Zahiri <123409429+Kayvan-Zahiri@users.noreply.github.com>
Co-authored-by: Mohammad Hijjawi <51020382+MohammadHijjawi97@users.noreply.github.com>
2026-10-22 15:07:01 +02:00

22 lines
620 B
Python

# Copyright (c) 2025- pyannoteAI
import pytest
import torch
def test_separation_masker():
pytest.importorskip("asteroid")
pytest.importorskip("transformers")
from pyannote.audio.models.separation.ToTaToNet import ToTaToNet
model = ToTaToNet(
use_wavlm=False,
n_sources=2,
dprnn={"n_repeats": 1, "bn_chan": 8, "hid_size": 8, "chunk_size": 10},
).eval()
with torch.inference_mode():
encoded = model.encoder(torch.randn(1, 1, 1600))
masks = model.masker(encoded)
assert masks.shape == (1, 2, *encoded.shape[1:])
assert torch.isfinite(masks).all()