projectlosangeles commited on
Commit
8e8d4bc
·
verified ·
1 Parent(s): 98b4e0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -16
app.py CHANGED
@@ -205,11 +205,11 @@ def Generate_Music_Bridge(input_midi,
205
 
206
  print('Loading MIDI...')
207
 
208
- score = load_midi(input_midi.name)
209
 
210
- if score is not None:
211
 
212
- print('Sample score tokens', score[:10])
213
 
214
  #==================================================================
215
 
@@ -435,21 +435,18 @@ with gr.Blocks() as demo:
435
 
436
  gr.Markdown("## Generation options")
437
 
 
 
 
 
438
 
439
- patches_to_inpaint = [0]
440
- inpaint_every_nth_note = 1
441
- forbid_original_pitches = True
442
- max_inpainted_pitch_dev = 12
443
- max_inpaint_tries_per_note = 20
444
-
445
- num_prime_tokens = 128
446
- num_mem_tokens = 4096
447
-
448
 
449
- inpaint_instruments = gr.Dropdown(label="Select instruments to inpaint", choices=list(patch2number.keys()),
450
- multiselect=True, type="value",
451
- info="Instruments MUST be present in the composition. For best results select a single instrument."
452
- )
453
 
454
  model_temperature = gr.Slider(0.1, 1, value=0.9, step=0.01, label="Model temperature")
455
  model_sampling_top_k = gr.Slider(1, 100, value=15, step=1, label="Model sampling top k value")
 
205
 
206
  print('Loading MIDI...')
207
 
208
+ melody_chords = load_midi(input_midi.name)
209
 
210
+ if melody_chords is not None:
211
 
212
+ print('Sample score tokens', melody_chords[:10])
213
 
214
  #==================================================================
215
 
 
435
 
436
  gr.Markdown("## Generation options")
437
 
438
+ patches_to_inpaint = gr.Dropdown(label="Select instruments to inpaint", choices=list(patch2number.keys()),
439
+ multiselect=True, type="value",
440
+ info="Instruments MUST be present in the composition. For best results select a single instrument."
441
+ )
442
 
443
+ inpaint_every_nth_note = gr.Slider(1, 10, value=1, step=1, label="Inpaint every nth note")
444
+ forbid_original_pitches = gr.Checkbox(value=True, label="Forbid repeating original pitches")
445
+ max_inpainted_pitch_dev = gr.Slider(12, 24, value=12, step=12, label="Maximum inpainted pitch deviation")
446
+ max_inpaint_tries_per_note = gr.Slider(5, 100, value=20, step=1, label="Maximum inpainting attempts per note")
 
 
 
 
 
447
 
448
+ num_prime_tokens = gr.Slider(0, 512, value=128, step=1, label="Number of prime tokens")
449
+ num_mem_tokens = gr.Slider(32, 8192, value=4096, step=8, label="Number of prime tokens")
 
 
450
 
451
  model_temperature = gr.Slider(0.1, 1, value=0.9, step=0.01, label="Model temperature")
452
  model_sampling_top_k = gr.Slider(1, 100, value=15, step=1, label="Model sampling top k value")