Update README.md
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
```
|