nielsr HF staff commited on
Commit
bf2c439
·
verified ·
1 Parent(s): 216352d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -1
README.md CHANGED
@@ -8,4 +8,31 @@ tags:
8
 
9
  This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
10
  - Library: https://github.com/SesameAILabs/csm
11
- - Docs: [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
10
  - Library: https://github.com/SesameAILabs/csm
11
+
12
+ ## Installation
13
+
14
+ First install from here:
15
+
16
+ ```bash
17
+ git clone -b add_hf https://github.com/NielsRogge/csm.git
18
+ cd csm
19
+ pip install -r requirements.txt
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```python
25
+ import torchaudio
26
+ from generator import load_csm_1b
27
+
28
+ generator = load_csm_1b(device="cuda")
29
+
30
+ audio = generator.generate(
31
+ text="Hello from Sesame.",
32
+ speaker=0,
33
+ context=[],
34
+ max_audio_length_ms=10_000,
35
+ )
36
+
37
+ torchaudio.save("audio.wav", audio.unsqueeze(0).cpu(), generator.sample_rate)
38
+ ```