asigalov61 commited on
Commit
823b615
1 Parent(s): 8446cdf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -151,15 +151,16 @@ def GenerateMIDI(num_tok, idrums, iinstr, progress=gr.Progress()):
151
  y.append(s[4])
152
  c.append(colors[s[3]])
153
 
154
- plt.figure(figsize=(14,5))
155
  ax=plt.axes(title='Allegro Music Transformer Composition')
156
  ax.set_facecolor('black')
157
 
158
  plt.scatter(x,y, c=c)
159
  plt.xlabel("Time")
160
  plt.ylabel("Pitch")
 
161
 
162
- yield [500, output1], plt, "Allegro-Music-Transformer-Music-Composition.mid", (44100, audio)
163
 
164
  #=================================================================================================
165
 
@@ -219,5 +220,5 @@ if __name__ == "__main__":
219
  output_plot = gr.Plot(label="output plot")
220
  output_midi = gr.File(label="output midi", file_types=[".mid"])
221
  run_event = run_btn.click(GenerateMIDI, [input_num_tokens, input_drums, input_instrument], [output_midi_seq, output_plot, output_midi, output_audio])
222
- plt.close()
223
  app.queue(concurrency_count=1).launch(server_port=opt.port, share=opt.share, inbrowser=True)
 
151
  y.append(s[4])
152
  c.append(colors[s[3]])
153
 
154
+ midi_plot = plt.figure(figsize=(14,5))
155
  ax=plt.axes(title='Allegro Music Transformer Composition')
156
  ax.set_facecolor('black')
157
 
158
  plt.scatter(x,y, c=c)
159
  plt.xlabel("Time")
160
  plt.ylabel("Pitch")
161
+ plt.close()
162
 
163
+ yield [500, output1], midi_plot, "Allegro-Music-Transformer-Music-Composition.mid", (44100, audio)
164
 
165
  #=================================================================================================
166
 
 
220
  output_plot = gr.Plot(label="output plot")
221
  output_midi = gr.File(label="output midi", file_types=[".mid"])
222
  run_event = run_btn.click(GenerateMIDI, [input_num_tokens, input_drums, input_instrument], [output_midi_seq, output_plot, output_midi, output_audio])
223
+
224
  app.queue(concurrency_count=1).launch(server_port=opt.port, share=opt.share, inbrowser=True)