RetroCirce / MusicLDM

The latent diffusion model for text-to-music generation.
https://huggingface.co/spaces/ircam-reach/musicldm-text-to-music
Other
153 stars 3 forks source link

MusicLDM pipeline usage #5

Closed hoang1007 closed 10 months ago

hoang1007 commented 10 months ago

Hello in diffusers docs, MusicLDM is used as follow

from diffusers import MusicLDMPipeline
import torch
import scipy

repo_id = "cvssp/audioldm-s-full-v2"
pipe = MusicLDMPipeline.from_pretrained(repo_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")

prompt = "Techno music with a strong, upbeat tempo and high melodic riffs"
audio = pipe(prompt, num_inference_steps=10, audio_length_in_s=5.0).audios[0]

# save the audio sample as a .wav file
scipy.io.wavfile.write("techno.wav", rate=16000, data=audio)

But pretrained_path is AudioLDM and seem that is can not be loaded in MusicLDM. How can I use pretrained of MusicLDM?

RetroCirce commented 10 months ago

Hi, i thknk they attached the wrong repo_id. Please try this one: "ucsd-reach/musicldm"