-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug fix Pretrained.load_audio #1303
base: develop
Are you sure you want to change the base?
Changes from 6 commits
625cda7
54aebc7
8aaff1a
a09d206
cce5732
b8991b0
b75370f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import torch | ||
|
||
|
||
def test_load_audio(tmpdir): | ||
from speechbrain.pretrained.interfaces import Pretrained | ||
|
||
verification = Pretrained.from_hparams( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still wondering about loading a 100+MB pretrained model here. I deleted my earlier comments on using a shorter pretrained model. All that is relevant here are these lines source, fl = split_path(path)
path = fetch(fl, source=source, savedir=savedir)
signal, sr = torchaudio.load(path, channels_first=False) That's what needs to be tested for the fetch in pretrained interfaces. |
||
source="speechbrain/spkrec-ecapa-voxceleb", | ||
savedir=tmpdir.mkdir("savedir"), | ||
) | ||
audio1 = verification.load_audio( | ||
"samples/voxceleb_samples/wav/id10002/xTV-jFAUKcw/00001.wav" | ||
) | ||
audio2 = verification.load_audio( | ||
"samples/voxceleb_samples/wav/id10001/1zcIwhmdeo4/00001.wav" | ||
) | ||
assert not torch.equal(audio1, audio2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a final empty line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing it will avoid this problem but also deactivate other features ;-)
the bug fix needs to happen elsewhere, as this fix will break other things (e.g. resolving HuggingFace URLs)