Annuvin commited on
Commit
40ba236
·
verified ·
1 Parent(s): 5fa2a8d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -1
README.md CHANGED
@@ -2,4 +2,22 @@
2
  base_model:
3
  - hubertsiuzdak/snac_24khz
4
  ---
5
- SNAC in safetensors format.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  base_model:
3
  - hubertsiuzdak/snac_24khz
4
  ---
5
+ SNAC in safetensors format.
6
+
7
+ ```py
8
+ import json
9
+ from pathlib import Path
10
+
11
+ import torch
12
+ from huggingface_hub import snapshot_download
13
+ from safetensors.torch import load_model
14
+ from snac import SNAC
15
+
16
+ device = "cuda"
17
+ dtype = torch.float32
18
+ path = Path(snapshot_download("annuvin/snac-st"))
19
+ config = json.loads((path / "config.json").read_text(encoding="utf-8"))
20
+ model = SNAC(**config)
21
+ load_model(model, path / "model.safetensors", device=device)
22
+ model.to(device, dtype).eval()
23
+ ```