mrfakename commited on
Commit
7670c1c
·
verified ·
1 Parent(s): d4beeea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,9 +13,9 @@ def gen(piano_only, length):
13
  cfg = VocabConfig.from_json('./vocab_config.json')
14
  text = midi.strip()
15
  mid = midi_util.convert_str_to_midi(cfg, text)
16
- with tempfile.NamedTemporaryFile(suffix='.midi', delete=False):
17
- mid.save(file=bio)
18
- yield midi, bio.getvalue()
19
  with gr.Blocks() as demo:
20
  piano_only = gr.Checkbox(label="Piano Only")
21
  length = gr.Slider(label="Length (in tokens)", minimum=4, maximum=4096, step=1, value=4096)
 
13
  cfg = VocabConfig.from_json('./vocab_config.json')
14
  text = midi.strip()
15
  mid = midi_util.convert_str_to_midi(cfg, text)
16
+ with tempfile.NamedTemporaryFile(suffix='.midi', delete=False) as tmp:
17
+ mid.save(tmp)
18
+ yield midi, tmp
19
  with gr.Blocks() as demo:
20
  piano_only = gr.Checkbox(label="Piano Only")
21
  length = gr.Slider(label="Length (in tokens)", minimum=4, maximum=4096, step=1, value=4096)