File size: 734 Bytes
a8713c5
 
 
 
 
 
 
 
 
 
266bfc6
a8713c5
 
 
 
 
dd403ae
a8713c5
 
 
 
 
 
 
 
44dbaeb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
license: cc-by-nc-sa-4.0
base_model:
- utter-project/mHuBERT-147
---

This is a `mHuBERT-147` model traced into a pytorch jit file.
This allows to run and deploy the model without extra dependencies.
Model after 2nd training iteration is combined with faiss index, to output hubert labels.

Usage:

```
import torch
import soundfile as sf

extractor = torch.jit.load("mhubert147_fp16_cuda.jit").to(torch.device("cuda"))
wav, sr = sf.read(
    "rms_arctic_a0001.wav",
    dtype="int16"
)
assert sr == 16000
x = torch.tensor(wav).unsqueeze(0).cuda()
x_len = torch.tensor([x.shape[1]]).cuda()
labels = traced_extractor(x, x_len)[1].detach().cpu().numpy()
```

More on tracing in the [post](https://balacoon.com/blog/mhubert_tracing/)