import gradio as gr from diffusers import DiffusionPipeline import scipy.io.wavfile def load_model(model_id): pipeline = DiffusionPipeline.from_pretrained(model_id) pipeline = pipeline.to("cuda") def denoise(length_sec,model): load_model(model) audios = pipeline(audio_length_in_s=length_sec).audios for audio in audios: scipy.io.wavfile.write("test.wav", pipeline.unet.sample_rate, audio.transpose()) return "test.wav" block = gr.Blocks() with block: gr.HTML( """
Dance Diffusion is the first in a suite of generative audio tools for producers and musicians to be released by Harmonai