Update app.py
Browse files
app.py
CHANGED
@@ -79,32 +79,41 @@ def predict(music_prompt, melody, duration):
|
|
79 |
|
80 |
|
81 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
with gr.Row():
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
with gr.Row():
|
96 |
-
submit = gr.Button("Submit")
|
97 |
-
#with gr.Row():
|
98 |
-
# model = gr.Radio(["melody", "medium", "small", "large"], label="Model", value="melody", interactive=True)
|
99 |
-
with gr.Row():
|
100 |
-
duration = gr.Slider(minimum=1, maximum=30, value=10, step=1, label="Duration", interactive=True)
|
101 |
-
#with gr.Row():
|
102 |
-
# topk = gr.Number(label="Top-k", value=250, interactive=True)
|
103 |
-
# topp = gr.Number(label="Top-p", value=0, interactive=True)
|
104 |
-
# temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
|
105 |
-
# cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
|
106 |
-
with gr.Column():
|
107 |
-
output = gr.Audio(label="Generated Music")
|
108 |
load_sound_btn.click(split_process, inputs=[uploaded_sound, chosen_track], outputs=[melody])
|
109 |
submit.click(predict, inputs=[music_prompt, melody, duration], outputs=[output])
|
110 |
|
|
|
79 |
|
80 |
|
81 |
with gr.Blocks() as demo:
|
82 |
+
gr.Markdown(
|
83 |
+
"""
|
84 |
+
# Split Audio to MusicGen
|
85 |
+
<br/>
|
86 |
+
<a href="https://huggingface.co/spaces/fffiloni/SplitTrack2MusicGen?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
|
87 |
+
<img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
88 |
+
for longer sequences, more control and no queue.</p>
|
89 |
+
"""
|
90 |
+
)
|
91 |
+
with gr.Row():
|
92 |
+
|
93 |
+
with gr.Row():
|
94 |
+
uploaded_sound = gr.Audio(type="numpy", label="Input", source="upload")
|
95 |
+
chosen_track = gr.Radio(["vocals", "bass", "drums", "other"], label="Track", info="Which track from your audio do you want to mashup ?", value="vocals")
|
96 |
+
load_sound_btn = gr.Button('Load your sound')
|
97 |
+
#split_vocals = gr.Audio(type="filepath", label="Vocals")
|
98 |
+
#split_bass = gr.Audio(type="filepath", label="Bass")
|
99 |
+
#split_drums = gr.Audio(type="filepath", label="Drums")
|
100 |
+
#split_others = gr.Audio(type="filepath", label="Other")
|
101 |
+
with gr.Row():
|
102 |
+
music_prompt = gr.Textbox(label="Musical Prompt", info="Describe what kind music you wish for", interactive=True)
|
103 |
+
melody = gr.Audio(source="upload", type="numpy", label="Melody Condition (optional)", interactive=False)
|
104 |
with gr.Row():
|
105 |
+
submit = gr.Button("Submit")
|
106 |
+
#with gr.Row():
|
107 |
+
# model = gr.Radio(["melody", "medium", "small", "large"], label="Model", value="melody", interactive=True)
|
108 |
+
with gr.Row():
|
109 |
+
duration = gr.Slider(minimum=1, maximum=30, value=10, step=1, label="Duration", interactive=True)
|
110 |
+
#with gr.Row():
|
111 |
+
# topk = gr.Number(label="Top-k", value=250, interactive=True)
|
112 |
+
# topp = gr.Number(label="Top-p", value=0, interactive=True)
|
113 |
+
# temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
|
114 |
+
# cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
|
115 |
+
|
116 |
+
output = gr.Audio(label="Generated Music")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
load_sound_btn.click(split_process, inputs=[uploaded_sound, chosen_track], outputs=[melody])
|
118 |
submit.click(predict, inputs=[music_prompt, melody, duration], outputs=[output])
|
119 |
|