asigalov61 commited on
Commit
f4019fd
1 Parent(s): 186f625

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -159,7 +159,7 @@ if __name__ == "__main__":
159
 
160
  session = rt.InferenceSession('Allegro_Music_Transformer_Small_Trained_Model_56000_steps_0.9399_loss_0.7374_acc.onnx', providers=['CUDAExecutionProvider'])
161
 
162
- # load_javascript()
163
  app = gr.Blocks()
164
  with app:
165
  gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Allegro Music Transformer</h1>")
@@ -178,7 +178,7 @@ if __name__ == "__main__":
178
 
179
  output_audio = gr.Audio(label="output audio", format="mp3", elem_id="midi_audio")
180
  output_midi = gr.File(label="output midi", file_types=[".mid"])
181
- run_event = run_btn.click(run, [output_midi_seq, output_midi, output_audio, js_msg])
182
  stop_btn.click(cancel_run, output_midi_seq, [output_midi, output_audio, js_msg], cancels=run_event, queue=False)
183
 
184
  app.queue(2).launch(server_port=opt.port, share=opt.share, inbrowser=True)
 
159
 
160
  session = rt.InferenceSession('Allegro_Music_Transformer_Small_Trained_Model_56000_steps_0.9399_loss_0.7374_acc.onnx', providers=['CUDAExecutionProvider'])
161
 
162
+ load_javascript()
163
  app = gr.Blocks()
164
  with app:
165
  gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Allegro Music Transformer</h1>")
 
178
 
179
  output_audio = gr.Audio(label="output audio", format="mp3", elem_id="midi_audio")
180
  output_midi = gr.File(label="output midi", file_types=[".mid"])
181
+ run_event = run_btn.click(GenerateMIDI, [output_midi_seq, output_midi, output_audio, js_msg])
182
  stop_btn.click(cancel_run, output_midi_seq, [output_midi, output_audio, js_msg], cancels=run_event, queue=False)
183
 
184
  app.queue(2).launch(server_port=opt.port, share=opt.share, inbrowser=True)