clementruhm commited on
Commit
ce0ccc3
·
verified ·
1 Parent(s): c38daf4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -3
README.md CHANGED
@@ -1,3 +1,32 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+ This is an `UTMOS` model traced into a jit for simple use. The model and the inference code are from this [space](https://huggingface.co/spaces/sarulab-speech/UTMOS-demo)
5
+ Usage:
6
+
7
+ ```python
8
+ from huggingface_hub import hf_hub_download
9
+ import torch
10
+ import soundfile as sf
11
+
12
+ # Download the model from repo
13
+ model_path = hf_hub_download(
14
+ repo_id="balacoon/utmos",
15
+ filename="utmos.jit",
16
+ repo_type="model",
17
+ local_dir="./",
18
+ )
19
+
20
+ # load model
21
+ utmos_model = torch.jit.load(model_path).to(torch.device("cuda"))
22
+ # load audio
23
+ wav, sr = sf.read(
24
+ "rms_arctic_a0001.wav",
25
+ dtype="int16"
26
+ )
27
+ assert sr == 16000
28
+ # run inference
29
+ x = torch.tensor(wav).unsqueeze(0).cuda()
30
+ mos = utmos_model(x).item()
31
+ print(mos)
32
+ ```