jmann-small-190k / README.md
patrickvonplaten's picture
Update README.md
716099a
|
raw
history blame
853 Bytes

FP32

# !pip install git+https://github.com/huggingface/diffusers.git
from diffusers import DiffusionPipeline
import scipy

model_id = "harmonai/jmann-small-190k"
pipeline = DiffusionPipeline.from_pretrained(model_id)
pipeline = pipeline.to("cuda")

audio = pipeline(audio_length_in_s=4.0).audios

scipy.io.wavfile.write("maestro_test.wav", pipe.unet.sample_rate, audios)

FP16

Faster at a small loss of quality

# !pip install git+https://github.com/huggingface/diffusers.git
from diffusers import DiffusionPipeline
import scipy
import torch

model_id = "harmonai/jmann-small-190k"
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipeline = pipeline.to("cuda")

audio = pipeline(audio_length_in_s=4.0).audios

scipy.io.wavfile.write("maestro_test.wav", pipe.unet.sample_rate, audios)