asigalov61 commited on
Commit
2508606
1 Parent(s): 707c61d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -179,6 +179,7 @@ def find_midi(input_search_string):
179
  #========================================================
180
 
181
  output_midi_title = str(LAKH_hash)
 
182
  output_midi_summary = str(MIDI_score_metadata)
183
  output_midi_caps = str(best_corpus_match)
184
  output_midi = str(new_fn)
@@ -187,6 +188,7 @@ def find_midi(input_search_string):
187
  output_plot = TMIDIX.plot_ms_SONG(output_score, plot_title=output_midi_title, return_plt=True)
188
 
189
  print('Output MIDI file name:', output_midi)
 
190
  print('Output MIDI title:', output_midi_title)
191
  print('Output MIDI summary:', output_midi_summary)
192
  print('Output MidiCaps information:', output_midi_caps)
@@ -199,7 +201,7 @@ def find_midi(input_search_string):
199
  print('-' * 70)
200
  print('Req execution time:', (reqtime.time() - start_time), 'sec')
201
 
202
- return output_midi_title, output_midi_summary, output_midi_caps, output_midi, output_audio, output_plot
203
 
204
  #==========================================================================================================
205
 
@@ -256,6 +258,7 @@ if __name__ == "__main__":
256
  gr.Markdown("# Search results")
257
 
258
  output_midi_title = gr.Textbox(label="Output MIDI title")
 
259
  output_midi_summary = gr.Textbox(label="Aggregated MIDI file text metadata")
260
  output_midi_caps = gr.Textbox(label="MidiCaps dataset information")
261
  output_audio = gr.Audio(label="Output MIDI audio", format="wav", elem_id="midi_audio")
@@ -263,6 +266,6 @@ if __name__ == "__main__":
263
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
264
 
265
  run_event = submit.click(find_midi, [input_search_string],
266
- [output_midi_title, output_midi_summary, output_midi_caps, output_midi, output_audio, output_plot ])
267
 
268
  app.launch()
 
179
  #========================================================
180
 
181
  output_midi_title = str(LAKH_hash)
182
+ output_midi_caption = str(best_corpus_match['caption'])
183
  output_midi_summary = str(MIDI_score_metadata)
184
  output_midi_caps = str(best_corpus_match)
185
  output_midi = str(new_fn)
 
188
  output_plot = TMIDIX.plot_ms_SONG(output_score, plot_title=output_midi_title, return_plt=True)
189
 
190
  print('Output MIDI file name:', output_midi)
191
+ print('Output MIDI caption string:', output_midi_caption)
192
  print('Output MIDI title:', output_midi_title)
193
  print('Output MIDI summary:', output_midi_summary)
194
  print('Output MidiCaps information:', output_midi_caps)
 
201
  print('-' * 70)
202
  print('Req execution time:', (reqtime.time() - start_time), 'sec')
203
 
204
+ return output_midi_title, output_midi_caption, output_midi_summary, output_midi_caps, output_midi, output_audio, output_plot
205
 
206
  #==========================================================================================================
207
 
 
258
  gr.Markdown("# Search results")
259
 
260
  output_midi_title = gr.Textbox(label="Output MIDI title")
261
+ output_midi_caption = gr.Textbox(label="MIDI caption string")
262
  output_midi_summary = gr.Textbox(label="Aggregated MIDI file text metadata")
263
  output_midi_caps = gr.Textbox(label="MidiCaps dataset information")
264
  output_audio = gr.Audio(label="Output MIDI audio", format="wav", elem_id="midi_audio")
 
266
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
267
 
268
  run_event = submit.click(find_midi, [input_search_string],
269
+ [output_midi_title, output_midi_caption, output_midi_summary, output_midi_caps, output_midi, output_audio, output_plot ])
270
 
271
  app.launch()