Spaces:
Build error
Build error
mattricesound
commited on
Commit
•
11b74f8
1
Parent(s):
ad4d1d7
Hide input melody
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ from demucs.audio import convert_audio
|
|
31 |
from gradio_client import Client
|
32 |
import pretty_midi
|
33 |
|
34 |
-
LOCAL =
|
35 |
USE_MIDI = True
|
36 |
|
37 |
|
@@ -123,7 +123,7 @@ def connect_to_endpoint():
|
|
123 |
|
124 |
|
125 |
def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
|
126 |
-
MODEL.set_generation_params(duration=duration, **gen_kwargs)
|
127 |
print("new batch", len(texts), texts, [None if m is None else (m[0], m[1].shape) for m in melodies])
|
128 |
be = time.time()
|
129 |
processed_melodies = []
|
@@ -307,10 +307,10 @@ def ui_full(launch_kwargs):
|
|
307 |
else:
|
308 |
audio_type="filepath"
|
309 |
melody = gr.Audio(type=audio_type, label="File", source="upload",
|
310 |
-
interactive=True, elem_id="melody-input", value=select_new_melody())
|
311 |
-
new_melody = gr.Button("
|
312 |
-
with gr.Row():
|
313 |
-
|
314 |
# Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
|
315 |
# _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
|
316 |
|
|
|
31 |
from gradio_client import Client
|
32 |
import pretty_midi
|
33 |
|
34 |
+
LOCAL = False
|
35 |
USE_MIDI = True
|
36 |
|
37 |
|
|
|
123 |
|
124 |
|
125 |
def _do_predictions(texts, melodies, duration, progress=False, **gen_kwargs):
|
126 |
+
MODEL.set_generation_params(duration=duration, cfg_coef=5, **gen_kwargs)
|
127 |
print("new batch", len(texts), texts, [None if m is None else (m[0], m[1].shape) for m in melodies])
|
128 |
be = time.time()
|
129 |
processed_melodies = []
|
|
|
307 |
else:
|
308 |
audio_type="filepath"
|
309 |
melody = gr.Audio(type=audio_type, label="File", source="upload",
|
310 |
+
interactive=True, elem_id="melody-input", value=select_new_melody(), visible=False)
|
311 |
+
new_melody = gr.Button("Change input melody", interactive=True)
|
312 |
+
# with gr.Row():
|
313 |
+
submit = gr.Button("Submit")
|
314 |
# Adapted from https://github.com/rkfg/audiocraft/blob/long/app.py, MIT license.
|
315 |
# _ = gr.Button("Interrupt").click(fn=interrupt, queue=False)
|
316 |
|