sangeet2020
commited on
Commit
·
602c4eb
1
Parent(s):
78782f9
add example wav file and update readme
Browse files- README.md +13 -4
- example_rescuespeech16k.wav +0 -0
README.md
CHANGED
@@ -87,13 +87,22 @@ Please notice that we encourage you to read our tutorials and learn more about
|
|
87 |
```python
|
88 |
from speechbrain.pretrained import SepformerSeparation as Separator
|
89 |
from speechbrain.pretrained import WhisperASR
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
# For custom file, change the path accordingly
|
95 |
est_sources = enh_model.separate_file(path='example_rescuespeech16k.wav')
|
96 |
-
|
97 |
```
|
98 |
### Inference on GPU
|
99 |
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
|
|
87 |
```python
|
88 |
from speechbrain.pretrained import SepformerSeparation as Separator
|
89 |
from speechbrain.pretrained import WhisperASR
|
90 |
+
import torch
|
91 |
+
|
92 |
+
enh_model = Separator.from_hparams(
|
93 |
+
source="speechbrain/noisy-whisper-resucespeech",
|
94 |
+
savedir='pretrained_models/noisy-whisper-resucespeech',
|
95 |
+
hparams_file="enhance.yaml"
|
96 |
+
)
|
97 |
+
asr_model = WhisperASR.from_hparams(
|
98 |
+
source="speechbrain/noisy-whisper-resucespeech",
|
99 |
+
savedir="pretrained_models/noisy-whisper-resucespeech",
|
100 |
+
hparams_file="asr.yaml"
|
101 |
+
)
|
102 |
|
103 |
# For custom file, change the path accordingly
|
104 |
est_sources = enh_model.separate_file(path='example_rescuespeech16k.wav')
|
105 |
+
pred_words, _ = asr_model(est_sources[:, :, 0], torch.tensor([1.0]))
|
106 |
```
|
107 |
### Inference on GPU
|
108 |
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
example_rescuespeech16k.wav
ADDED
Binary file (445 kB). View file
|
|