Spaces:
Sleeping
Sleeping
File size: 623 Bytes
2491b10 e288e9a 2491b10 |
1 2 3 4 5 6 7 8 9 10 11 |
from transformers import pipeline
import scipy
import gradio as gr
synthesiser = pipeline("text-to-audio", "facebook/musicgen-small")
def generate_music(Prompt):
music = synthesiser(Prompt, forward_params={"do_sample": True, "max_new_tokens":100})
rate = music["sampling_rate"]
mus = music["audio"][0].reshape(-1)
return rate, mus
inf = gr.Interface(generate_music, title = "Mashdemy Demo Music Generator App", description = "Type in the kind of music you prefer and click submit", inputs =["text"], outputs=["audio"], examples = ["lo-fi music with a soothing melody", "pop music"])
inf.launch(share = True) |