Update README.md
Browse files
README.md
CHANGED
@@ -43,27 +43,6 @@ waveform = hifi_gan_unit.decode_unit(codes)
|
|
43 |
|
44 |
```
|
45 |
|
46 |
-
### Using the Vocoder with the S2UT
|
47 |
-
```python
|
48 |
-
import torch
|
49 |
-
import torchaudio
|
50 |
-
from speechbrain.pretrained import EncoderDecoderS2UT
|
51 |
-
from speechbrain.pretrained import UnitHIFIGAN
|
52 |
-
|
53 |
-
# Intialize S2UT (Transformer) and Vocoder (HiFIGAN Unit)
|
54 |
-
s2ut = EncoderDecoderS2UT.from_hparams(source="speechbrain/s2st-transformer-fr-en-hubert-l6-k100-cvss", savedir="tmpdir_s2ut")
|
55 |
-
hifi_gan_unit = UnitHIFIGAN.from_hparams(source="speechbrain/tts-hifigan-unit-hubert-l6-k100-ljspeech", savedir="tmpdir_vocoder")
|
56 |
-
|
57 |
-
# Running the S2UT model
|
58 |
-
codes = s2ut.translate_file("speechbrain/s2st-transformer-fr-en-hubert-l6-k100-cvss/example-fr.wav")
|
59 |
-
codes = torch.IntTensor(codes)
|
60 |
-
|
61 |
-
# Running Vocoder (units-to-waveform)
|
62 |
-
waveforms = hifi_gan_unit.decode_unit(codes)
|
63 |
-
|
64 |
-
# Save the waverform
|
65 |
-
torchaudio.save('example.wav',waveforms.squeeze(1), 16000)
|
66 |
-
```
|
67 |
|
68 |
### Inference on GPU
|
69 |
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|
|
|
43 |
|
44 |
```
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
### Inference on GPU
|
48 |
To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
|