dance-diffusion / app.py
Fauno15's picture
Update app.py
867ecba
raw
history blame
525 Bytes
import gradio as gr
import scipy
from diffusers import DiffusionPipeline
model_id = "harmonai/maestro-150k"
pipeline = DiffusionPipeline.from_pretrained(model_id)
pipeline = pipeline.to("cuda")
def denoise(length_sec):
audios = pipeline(audio_length_in_s=length_sec).audios
scipy.io.wavfile.write("maestro_test.wav", pipeline.unet.sample_rate, audios)
return "maestro_test.wav"
gr.Interface(fn=denoise, inputs=gr.Slider(1.0, 6.0, value=3.0, step=0.5, label="Audio length in seconds"), outputs="audio").launch()