clementruhm commited on
Commit
a8713c5
·
verified ·
1 Parent(s): 4f442ba

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -3
README.md CHANGED
@@ -1,3 +1,26 @@
1
- ---
2
- license: cc-by-nc-sa-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ base_model:
4
+ - utter-project/mHuBERT-147
5
+ ---
6
+
7
+ This is a `mHuBERT-147` model traced into a pytorch jit file.
8
+ This allows to run and deploy the model without extra dependencies.
9
+ Model after 2nd training iteration is combined with faiss index, to output hubert labels.
10
+
11
+ ##Usage
12
+
13
+ ```
14
+ import torch
15
+ import soundfile as sf
16
+
17
+ extractor = torch.jit.load("mhubert_fp32_cuda.jit").to(torch.device("cuda"))
18
+ wav, sr = sf.read(
19
+ "rms_arctic_a0001.wav",
20
+ dtype="int16"
21
+ )
22
+ assert sr == 16000
23
+ x = torch.tensor(wav).unsqueeze(0).cuda()
24
+ x_len = torch.tensor([x.shape[1]]).cuda()
25
+ labels = traced_extractor(x, x_len)[1].detach().cpu().numpy()
26
+ ```