Update app.py
Browse files
app.py
CHANGED
@@ -80,7 +80,7 @@ def predict(music_prompt, melody, duration, model):
|
|
80 |
return file.name
|
81 |
|
82 |
css="""
|
83 |
-
#col-container {max-width:
|
84 |
a {text-decoration-line: underline; font-weight: 600;}
|
85 |
"""
|
86 |
|
@@ -96,31 +96,32 @@ with gr.Blocks(css=css) as demo:
|
|
96 |
for longer sequences, more control and no queue.</p>
|
97 |
"""
|
98 |
)
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
124 |
load_sound_btn.click(split_process, inputs=[uploaded_sound, chosen_track], outputs=[melody])
|
125 |
submit.click(predict, inputs=[music_prompt, melody, duration, model], outputs=[output])
|
126 |
|
|
|
80 |
return file.name
|
81 |
|
82 |
css="""
|
83 |
+
#col-container {max-width: 910px; margin-left: auto; margin-right: auto;}
|
84 |
a {text-decoration-line: underline; font-weight: 600;}
|
85 |
"""
|
86 |
|
|
|
96 |
for longer sequences, more control and no queue.</p>
|
97 |
"""
|
98 |
)
|
99 |
+
with gr.Row():
|
100 |
+
with gr.Column():
|
101 |
+
uploaded_sound = gr.Audio(type="numpy", label="Input", source="upload")
|
102 |
+
chosen_track = gr.Radio(["vocals", "bass", "drums", "other", "all-in"], label="Track", info="Which track from your audio do you want to mashup ?", value="vocals")
|
103 |
+
load_sound_btn = gr.Button('Load your sound')
|
104 |
+
#split_vocals = gr.Audio(type="filepath", label="Vocals")
|
105 |
+
#split_bass = gr.Audio(type="filepath", label="Bass")
|
106 |
+
#split_drums = gr.Audio(type="filepath", label="Drums")
|
107 |
+
#split_others = gr.Audio(type="filepath", label="Other")
|
108 |
+
with gr.Column():
|
109 |
+
with gr.Row():
|
110 |
+
music_prompt = gr.Textbox(label="Musical Prompt", info="Describe what kind of music you wish for", interactive=True)
|
111 |
+
melody = gr.Audio(source="upload", type="numpy", label="Track Condition (from previous step)", interactive=False)
|
112 |
+
with gr.Row():
|
113 |
+
model = gr.Radio(["melody", "medium", "small", "large"], label="Model", value="melody", interactive=True)
|
114 |
+
with gr.Row():
|
115 |
+
duration = gr.Slider(minimum=1, maximum=30, value=10, step=1, label="Generated Music Duration", interactive=True)
|
116 |
+
with gr.Row():
|
117 |
+
submit = gr.Button("Submit")
|
118 |
+
#with gr.Row():
|
119 |
+
# topk = gr.Number(label="Top-k", value=250, interactive=True)
|
120 |
+
# topp = gr.Number(label="Top-p", value=0, interactive=True)
|
121 |
+
# temperature = gr.Number(label="Temperature", value=1.0, interactive=True)
|
122 |
+
# cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
|
123 |
+
|
124 |
+
output = gr.Audio(label="Generated Music")
|
125 |
load_sound_btn.click(split_process, inputs=[uploaded_sound, chosen_track], outputs=[melody])
|
126 |
submit.click(predict, inputs=[music_prompt, melody, duration, model], outputs=[output])
|
127 |
|