asigalov61 commited on
Commit
6d01d0c
1 Parent(s): 88d8b6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -24,7 +24,7 @@ in_space = os.getenv("SYSTEM") == "spaces"
24
  # =================================================================================================
25
 
26
  @spaces.GPU
27
- def GenerateSong(input_melody_seed_number):
28
  print('=' * 70)
29
  print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
30
  start_time = reqtime.time()
@@ -210,16 +210,16 @@ if __name__ == "__main__":
210
 
211
  app = gr.Blocks()
212
  with app:
213
- gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Melody2Song Seq2Seq Music Transformer</h1>")
214
- gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Generate unique songs from melodies with seq2seq music transformer</h1>")
215
  gr.Markdown(
216
- "![Visitors](https://api.visitorbadge.io/api/visitors?path=asigalov61.Melody2Song-Seq2Seq-Music-Transformer&style=flat)\n\n")
217
 
218
- input_melody_seed_number = gr.Slider(0, 203664, value=0, step=1, label="Select seed melody number")
219
 
220
  run_btn = gr.Button("generate", variant="primary")
221
 
222
- gr.Markdown("## Generation results")
223
 
224
  output_midi_title = gr.Textbox(label="Output MIDI title")
225
  output_midi_summary = gr.Textbox(label="Output MIDI summary")
@@ -227,7 +227,7 @@ if __name__ == "__main__":
227
  output_plot = gr.Plot(label="Output MIDI score plot")
228
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
229
 
230
- run_event = run_btn.click(GenerateSong, [input_melody_seed_number],
231
  [output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
232
 
233
  app.queue().launch()
 
24
  # =================================================================================================
25
 
26
  @spaces.GPU
27
+ def ClassifyMIDI(input_midi):
28
  print('=' * 70)
29
  print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
30
  start_time = reqtime.time()
 
210
 
211
  app = gr.Blocks()
212
  with app:
213
+ gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Advanced MIDI Classifier</h1>")
214
+ gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Detailed MIDI classification with transformers</h1>")
215
  gr.Markdown(
216
+ "![Visitors](https://api.visitorbadge.io/api/visitors?path=asigalov61.Advanced-MIDI-Classifier&style=flat)\n\n")
217
 
218
+ input_midi = gr.File(label="Input MIDI", file_types=[".midi", ".mid", ".kar"])
219
 
220
  run_btn = gr.Button("generate", variant="primary")
221
 
222
+ gr.Markdown("## Classification results")
223
 
224
  output_midi_title = gr.Textbox(label="Output MIDI title")
225
  output_midi_summary = gr.Textbox(label="Output MIDI summary")
 
227
  output_plot = gr.Plot(label="Output MIDI score plot")
228
  output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
229
 
230
+ run_event = run_btn.click(ClassifyMIDI, [input_midi],
231
  [output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
232
 
233
  app.queue().launch()