Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,9 @@ import scipy
|
|
3 |
import gradio as gr
|
4 |
synthesiser = pipeline("text-to-audio", "facebook/musicgen-small")
|
5 |
def generate_music(Prompt):
|
6 |
-
|
7 |
-
rate = music["sampling_rate"]
|
8 |
-
|
9 |
-
|
10 |
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"])
|
11 |
inf.launch(share = True)
|
|
|
3 |
import gradio as gr
|
4 |
synthesiser = pipeline("text-to-audio", "facebook/musicgen-small")
|
5 |
def generate_music(Prompt):
|
6 |
+
music = synthesiser(Prompt, forward_params={"do_sample": True, "max_new_tokens":100})
|
7 |
+
rate = music["sampling_rate"]
|
8 |
+
mus = music["audio"][0].reshape(-1)
|
9 |
+
return rate, mus
|
10 |
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"])
|
11 |
inf.launch(share = True)
|