Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Commit
•
d45a9bf
1
Parent(s):
188a1cd
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,8 @@ import midi_util
|
|
5 |
from midi_util import VocabConfig
|
6 |
import tempfile
|
7 |
from glob import glob
|
|
|
|
|
8 |
def gen(piano_only, length):
|
9 |
midi = ''
|
10 |
for item in musicgen(piano_only=piano_only, length=length):
|
@@ -27,5 +29,5 @@ with gr.Blocks() as demo:
|
|
27 |
synth.click(gen, inputs=[piano_only, length], outputs=[txtout, fileout])
|
28 |
with gr.Accordion("Samples", open=False):
|
29 |
for i, audpath in enumerate(glob("*.wav")):
|
30 |
-
gr.Audio(interactive=False, value=audpath, label=f'Sample {i + 1}')
|
31 |
demo.queue(api_open=False).launch(show_api=False)
|
|
|
5 |
from midi_util import VocabConfig
|
6 |
import tempfile
|
7 |
from glob import glob
|
8 |
+
import soundfile as sf
|
9 |
+
|
10 |
def gen(piano_only, length):
|
11 |
midi = ''
|
12 |
for item in musicgen(piano_only=piano_only, length=length):
|
|
|
29 |
synth.click(gen, inputs=[piano_only, length], outputs=[txtout, fileout])
|
30 |
with gr.Accordion("Samples", open=False):
|
31 |
for i, audpath in enumerate(glob("*.wav")):
|
32 |
+
gr.Audio(interactive=False, value=sf.read(audpath), label=f'Sample {i + 1}')
|
33 |
demo.queue(api_open=False).launch(show_api=False)
|