patrickvonplaten commited on
Commit
ac2764c
1 Parent(s): f80e5ef

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -0
README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## FP32
2
+
3
+ ```python
4
+ # !pip install git+https://github.com/huggingface/diffusers.git
5
+ from diffusers import DiffusionPipeline
6
+ import scipy
7
+
8
+ model_id = "harmonai/maestro-150k"
9
+ pipeline = DiffusionPipeline.from_pretrained(model_id)
10
+
11
+ audio = pipeline(audio_length_in_s=4.0).audios
12
+
13
+ scipy.io.wavfile.write("maestro_test.wav", pipe.unet.sample_rate, audios)
14
+ ```
15
+
16
+ ## FP16
17
+
18
+ Faster at a small loss of quality
19
+
20
+ ```python
21
+ # !pip install git+https://github.com/huggingface/diffusers.git
22
+ from diffusers import DiffusionPipeline
23
+ import scipy
24
+ import torch
25
+
26
+ model_id = "harmonai/maestro-150k"
27
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
28
+
29
+ audio = pipeline(audio_length_in_s=4.0).audios
30
+
31
+ scipy.io.wavfile.write("maestro_test.wav", pipe.unet.sample_rate, audios)
32
+ ```