mrfakename commited on
Commit
c989815
1 Parent(s): 32b2ee7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -4,6 +4,7 @@ from io import BytesIO
4
  import midi_util
5
  from midi_util import VocabConfig
6
  import tempfile
 
7
  def gen(piano_only, length):
8
  midi = ''
9
  for item in musicgen(piano_only=piano_only, length=length):
@@ -24,4 +25,7 @@ with gr.Blocks() as demo:
24
  txtout = gr.Textbox(interactive=False, label="MIDI Tokens")
25
  fileout = gr.File(interactive=False, label="MIDI File", type="binary")
26
  synth.click(gen, inputs=[piano_only, length], outputs=[txtout, fileout])
 
 
 
27
  demo.queue().launch()
 
4
  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):
 
25
  txtout = gr.Textbox(interactive=False, label="MIDI Tokens")
26
  fileout = gr.File(interactive=False, label="MIDI File", type="binary")
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().launch()