patrickvonplaten
commited on
Commit
·
d0b04f4
1
Parent(s):
53a01ee
Update README.md
Browse files
README.md
CHANGED
@@ -11,7 +11,7 @@ tags:
|
|
11 |
```python
|
12 |
# !pip install diffusers[torch] accelerate scipy
|
13 |
from diffusers import DiffusionPipeline
|
14 |
-
|
15 |
|
16 |
model_id = "harmonai/maestro-150k"
|
17 |
pipeline = DiffusionPipeline.from_pretrained(model_id)
|
@@ -21,7 +21,7 @@ audios = pipeline(audio_length_in_s=4.0).audios
|
|
21 |
|
22 |
# To save locally
|
23 |
for i, audio in enumerate(audios):
|
24 |
-
|
25 |
|
26 |
# To dislay in google colab
|
27 |
import IPython.display as ipd
|
@@ -36,7 +36,7 @@ Faster at a small loss of quality
|
|
36 |
```python
|
37 |
# !pip install diffusers[torch] accelerate scipy
|
38 |
from diffusers import DiffusionPipeline
|
39 |
-
|
40 |
import torch
|
41 |
|
42 |
model_id = "harmonai/maestro-150k"
|
@@ -47,7 +47,7 @@ audios = pipeline(audio_length_in_s=4.0).audios
|
|
47 |
|
48 |
# To save locally
|
49 |
for i, audio in enumerate(audios):
|
50 |
-
|
51 |
|
52 |
# To dislay in google colab
|
53 |
import IPython.display as ipd
|
|
|
11 |
```python
|
12 |
# !pip install diffusers[torch] accelerate scipy
|
13 |
from diffusers import DiffusionPipeline
|
14 |
+
from scipy.io.wavfile import write
|
15 |
|
16 |
model_id = "harmonai/maestro-150k"
|
17 |
pipeline = DiffusionPipeline.from_pretrained(model_id)
|
|
|
21 |
|
22 |
# To save locally
|
23 |
for i, audio in enumerate(audios):
|
24 |
+
write(f"maestro_test_{i}.wav", pipe.unet.sample_rate, audio.transpose())
|
25 |
|
26 |
# To dislay in google colab
|
27 |
import IPython.display as ipd
|
|
|
36 |
```python
|
37 |
# !pip install diffusers[torch] accelerate scipy
|
38 |
from diffusers import DiffusionPipeline
|
39 |
+
from scipy.io.wavfile import write
|
40 |
import torch
|
41 |
|
42 |
model_id = "harmonai/maestro-150k"
|
|
|
47 |
|
48 |
# To save locally
|
49 |
for i, audio in enumerate(audios):
|
50 |
+
write(f"maestro_test_{i}.wav", pipe.unet.sample_rate, audio.transpose())
|
51 |
|
52 |
# To dislay in google colab
|
53 |
import IPython.display as ipd
|