Spaces:
Running
Running
Fabrice-TIERCELIN
commited on
Commit
•
0d00dc3
1
Parent(s):
8679470
Order of inputs
Browse files- demos/musicgen_app.py +14 -14
demos/musicgen_app.py
CHANGED
@@ -244,8 +244,8 @@ def ui_full(launch_kwargs):
|
|
244 |
with gr.Blocks() as interface:
|
245 |
gr.Markdown(
|
246 |
"""
|
247 |
-
#
|
248 |
-
|
249 |
presented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284).
|
250 |
Modified for experiments in the re-scoring of *Metropolis* and *Wings*.
|
251 |
"""
|
@@ -260,9 +260,19 @@ def ui_full(launch_kwargs):
|
|
260 |
melody = gr.Audio(source="upload", type="numpy", label="File",
|
261 |
interactive=True, elem_id="melody-input")
|
262 |
with gr.Row():
|
263 |
-
submit = gr.Button("Generate", variant="primary")
|
264 |
# Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
|
265 |
-
_ = gr.Button("Abort all", variant="stop").click(fn=interrupt, queue=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
with gr.Row():
|
267 |
model = gr.Radio(["facebook/musicgen-melody", "facebook/musicgen-medium", "facebook/musicgen-small",
|
268 |
"facebook/musicgen-large",
|
@@ -272,16 +282,6 @@ def ui_full(launch_kwargs):
|
|
272 |
"facebook/musicgen-stereo-melody-large"],
|
273 |
label="Model", value="facebook/musicgen-stereo-melody", interactive=True)
|
274 |
model_path = gr.Text(label="Model Path (custom models)")
|
275 |
-
with gr.Row():
|
276 |
-
decoder = gr.Radio(["Default", "MultiBand_Diffusion"],
|
277 |
-
label="Decoder", value="Default", interactive=True)
|
278 |
-
with gr.Row():
|
279 |
-
duration = gr.Slider(minimum=1, maximum=120, value=10, label="Duration", interactive=True)
|
280 |
-
with gr.Row():
|
281 |
-
topk = gr.Number(label="Top-k", info="Number of tokens shortlisted", value=250, interactive=True)
|
282 |
-
topp = gr.Number(label="Top-p", info="Percent of tokens shortlisted", value=0, interactive=True)
|
283 |
-
temperature = gr.Number(label="Temperature", info="lower=Always similar, higher=More creative", value=1.0, interactive=True)
|
284 |
-
cfg_coef = gr.Number(label="Classifier Free Guidance", value=3.0, interactive=True)
|
285 |
with gr.Column():
|
286 |
output = gr.Video(label="Generated Music")
|
287 |
audio_output = gr.Audio(label="Generated Music (wav)", type='filepath')
|
|
|
244 |
with gr.Blocks() as interface:
|
245 |
gr.Markdown(
|
246 |
"""
|
247 |
+
# Text-to-Music / Music-to-Music
|
248 |
+
MusicGen derived from [MusicGen](https://github.com/facebookresearch/audiocraft),
|
249 |
presented at: ["Simple and Controllable Music Generation"](https://huggingface.co/papers/2306.05284).
|
250 |
Modified for experiments in the re-scoring of *Metropolis* and *Wings*.
|
251 |
"""
|
|
|
260 |
melody = gr.Audio(source="upload", type="numpy", label="File",
|
261 |
interactive=True, elem_id="melody-input")
|
262 |
with gr.Row():
|
263 |
+
submit = gr.Button("Generate", variant = "primary")
|
264 |
# Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
|
265 |
+
_ = gr.Button("Abort all", variant="stop").click(fn=interrupt, queue = False)
|
266 |
+
with gr.Row():
|
267 |
+
duration = gr.Slider(minimum = 1, maximum = 120, value = 10, label = "Duration", interactive = True)
|
268 |
+
with gr.Row():
|
269 |
+
topk = gr.Number(label="Top-k", info = "Number of tokens shortlisted", value = 250, interactive = True)
|
270 |
+
topp = gr.Number(label="Top-p", info = "Percent of tokens shortlisted", value = 0, interactive = True)
|
271 |
+
temperature = gr.Number(label="Temperature", info = "lower=Always similar, higher=More creative", value = 1.0, interactive = True)
|
272 |
+
cfg_coef = gr.Number(label="Classifier Free Guidance", value = 3.0, interactive=True)
|
273 |
+
with gr.Row():
|
274 |
+
decoder = gr.Radio(["Default", "MultiBand_Diffusion"],
|
275 |
+
label="Decoder", value="Default", interactive=True)
|
276 |
with gr.Row():
|
277 |
model = gr.Radio(["facebook/musicgen-melody", "facebook/musicgen-medium", "facebook/musicgen-small",
|
278 |
"facebook/musicgen-large",
|
|
|
282 |
"facebook/musicgen-stereo-melody-large"],
|
283 |
label="Model", value="facebook/musicgen-stereo-melody", interactive=True)
|
284 |
model_path = gr.Text(label="Model Path (custom models)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
with gr.Column():
|
286 |
output = gr.Video(label="Generated Music")
|
287 |
audio_output = gr.Audio(label="Generated Music (wav)", type='filepath')
|