Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,19 +77,24 @@ def predict(music_prompt, melody, duration):
|
|
| 77 |
#waveform_video = gr.make_waveform(file.name)
|
| 78 |
return file.name
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
-
with gr.Blocks() as demo:
|
| 82 |
-
gr.
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 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")
|
|
@@ -101,19 +106,19 @@ with gr.Blocks() as demo:
|
|
| 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 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 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 |
|
|
|
|
| 77 |
#waveform_video = gr.make_waveform(file.name)
|
| 78 |
return file.name
|
| 79 |
|
| 80 |
+
css="""
|
| 81 |
+
#col-container {max-width: 510px; margin-left: auto; margin-right: auto;}
|
| 82 |
+
a {text-decoration-line: underline; font-weight: 600;}
|
| 83 |
+
"""
|
| 84 |
|
| 85 |
+
with gr.Blocks(css=css) as demo:
|
| 86 |
+
with gr.Column(elem_id="col-container"):
|
| 87 |
+
gr.Markdown(
|
| 88 |
+
"""
|
| 89 |
+
# Split Audio to MusicGen
|
| 90 |
+
Upload an audio file, split audio tracks with Demucs, choose a track as conditional sound for MusicGen, get a remix !
|
| 91 |
+
<br/>
|
| 92 |
+
<a href="https://huggingface.co/spaces/fffiloni/SplitTrack2MusicGen?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
|
| 93 |
+
<img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>
|
| 94 |
+
for longer sequences, more control and no queue.</p>
|
| 95 |
+
"""
|
| 96 |
+
)
|
| 97 |
+
|
| 98 |
with gr.Row():
|
| 99 |
uploaded_sound = gr.Audio(type="numpy", label="Input", source="upload")
|
| 100 |
chosen_track = gr.Radio(["vocals", "bass", "drums", "other"], label="Track", info="Which track from your audio do you want to mashup ?", value="vocals")
|
|
|
|
| 106 |
with gr.Row():
|
| 107 |
music_prompt = gr.Textbox(label="Musical Prompt", info="Describe what kind music you wish for", interactive=True)
|
| 108 |
melody = gr.Audio(source="upload", type="numpy", label="Melody Condition (optional)", interactive=False)
|
| 109 |
+
#with gr.Row():
|
| 110 |
+
# model = gr.Radio(["melody", "medium", "small", "large"], label="Model", value="melody", interactive=True)
|
| 111 |
+
with gr.Row():
|
| 112 |
+
duration = gr.Slider(minimum=1, maximum=30, value=10, step=1, label="Duration", interactive=True)
|
| 113 |
+
with gr.Row():
|
| 114 |
+
submit = gr.Button("Submit")
|
| 115 |
+
#with gr.Row():
|
| 116 |
+
# topk = gr.Number(label="Top-k", value=250, interactive=True)
|
| 117 |
+
# topp = gr.Number(label="Top-p", value=0, interactive=True)
|
| 118 |
+
# temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
|
| 119 |
+
# cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
|
| 120 |
+
|
| 121 |
+
output = gr.Audio(label="Generated Music")
|
| 122 |
load_sound_btn.click(split_process, inputs=[uploaded_sound, chosen_track], outputs=[melody])
|
| 123 |
submit.click(predict, inputs=[music_prompt, melody, duration], outputs=[output])
|
| 124 |
|