speechbrain.inference is not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- huggingface, python
- Domain
- machine-learning
Research direction
Reproduce the failure in a fresh Google Colab environment using the listed clone, requirements installation, and editable install commands, then run the provided Sepformer import and example script. Inspect how the installed package exposes the speechbrain namespace; the issue is done when the documented speechbrain.inference imports and example complete without ModuleNotFoundError.
Written by the indexing model from the issue text.
Description
Describe the bug
I am now trying to call the Sepformer based on this tutorial from Hugging Face. But after installing the toolkit according to the instruction, seems like it cannot be properly run.
Expected behaviour
After running the script according to the instruction, speechbrain.inference cannot be properly called with simple error
ModuleNotFoundError: No module named 'speechbrain.inference'
To Reproduce
On Colab, first run
!git clone https://github.com/speechbrain/speechbrain.git
!cd speechbrain && pip install -r requirements.txt && pip install -e .
Then run
from speechbrain.inference.separation import SepformerSeparation as separator
from speechbrain.inference.interfaces import fetch
from speechbrain.inference.metrics import SNREstimator as snrest
import torchaudio
# 1- Download a test mixture
fetch("test_mixture.wav", source="speechbrain/sepformer-wsj02mix", savedir=".", save_filename="test_mixture.wav")
# 2- Separate the mixture with a pretrained model (sepformer-whamr in this case)
model = separator.from_hparams(source="speechbrain/sepformer-whamr", savedir='pretrained_models/sepformer-whamr')
est_sources = model.separate_file(path='test_mixture.wav')
# 3- Estimate the performance
snr_est_model = snrest.from_hparams(source="speechbrain/REAL-M-sisnr-estimator",savedir='pretrained_models/REAL-M-sisnr-estimator')
mix, fs = torchaudio.load('test_mixture.wav')
snrhat = snr_est_model.estimate_batch(mix, est_sources)
print(snrhat) # Estimates are in dB / 10 (in the range 0-1, e.g., 0 --> 0dB, 1 --> 10dB)
Environment Details
Google colab default environment
Speechbrain version: 1.0.0 (installed from source)
Relevant Log Output
No response
Additional Context
No response
- Dominant language
- Python
- Stars
- 11.8k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from speechbrain/speechbrain
-
bug performance
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
speechbrain/speechbrain#2601 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
speechbrain/speechbrain#3076 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
speechbrain/speechbrain#3074 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
speechbrain/speechbrain#3071 · 3 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
speechbrain/speechbrain#3070 · 1 comment ·
All issues in speechbrain/speechbrain
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100