asigalov61 commited on
Commit
8963504
·
verified ·
1 Parent(s): f08e748

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -191,6 +191,7 @@ def save_midi(tokens, batch_number=None):
191
  """Convert token sequence back to a MIDI score and write it using TMIDIX (without velocity).
192
  The output MIDI file name incorporates a date-time stamp.
193
  """
 
194
  time = 0
195
  dur = 1
196
  vel = 90
@@ -203,6 +204,8 @@ def save_midi(tokens, batch_number=None):
203
  channels = [0] * 16
204
  channels[9] = 1
205
 
 
 
206
  for ss in tokens:
207
 
208
  if 0 <= ss < 256:
@@ -244,13 +247,8 @@ def save_midi(tokens, batch_number=None):
244
 
245
  # Generate a time stamp using the PDT timezone.
246
  timestamp = datetime.datetime.now(PDT).strftime("%Y%m%d_%H%M%S")
247
-
248
- '''if batch_number is None:
249
- fname = f"Orpheus-Music-Transformer-Music-Composition_{timestamp}"
250
- else:
251
- fname = f"Orpheus-Music-Transformer-Music-Composition_{timestamp}_Batch_{batch_number}"'''
252
 
253
- fname = f"Orpheus-Music-Transformer-Composition"
254
 
255
  TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(
256
  song_f,
@@ -422,7 +420,7 @@ with gr.Blocks() as demo:
422
 
423
  gr.Markdown("<h1 style='text-align: left; margin-bottom: 1rem'>Orpheus Music Transformer</h1>")
424
  gr.Markdown("<h1 style='text-align: left; margin-bottom: 1rem'>SOTA 8k multi-instrumental music transformer trained on 2.31M+ high-quality MIDIs</h1>")
425
- gr.Markdown("<h1 style='text-align: left; margin-bottom: 1rem'>(This is WIP preview. Please check back for final release soon.)</h1>")
426
  gr.HTML("""
427
  Check out <a href="https://huggingface.co/datasets/projectlosangeles/Godzilla-MIDI-Dataset">Godzilla MIDI Dataset</a> on Hugging Face
428
  <p>
 
191
  """Convert token sequence back to a MIDI score and write it using TMIDIX (without velocity).
192
  The output MIDI file name incorporates a date-time stamp.
193
  """
194
+
195
  time = 0
196
  dur = 1
197
  vel = 90
 
204
  channels = [0] * 16
205
  channels[9] = 1
206
 
207
+ song_f = []
208
+
209
  for ss in tokens:
210
 
211
  if 0 <= ss < 256:
 
247
 
248
  # Generate a time stamp using the PDT timezone.
249
  timestamp = datetime.datetime.now(PDT).strftime("%Y%m%d_%H%M%S")
 
 
 
 
 
250
 
251
+ fname = f"Orpheus-Music-Transformer-Composition_" + str(batch_number)
252
 
253
  TMIDIX.Tegridy_ms_SONG_to_MIDI_Converter(
254
  song_f,
 
420
 
421
  gr.Markdown("<h1 style='text-align: left; margin-bottom: 1rem'>Orpheus Music Transformer</h1>")
422
  gr.Markdown("<h1 style='text-align: left; margin-bottom: 1rem'>SOTA 8k multi-instrumental music transformer trained on 2.31M+ high-quality MIDIs</h1>")
423
+ gr.Markdown("<h1 style='text-align: left; margin-bottom: 1rem'>This is a WIP preview. Please check back for final release soon.</h1>")
424
  gr.HTML("""
425
  Check out <a href="https://huggingface.co/datasets/projectlosangeles/Godzilla-MIDI-Dataset">Godzilla MIDI Dataset</a> on Hugging Face
426
  <p>