asigalov61 commited on
Commit
c21fc79
·
verified ·
1 Parent(s): 0b0bdf8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -414,9 +414,10 @@ def CompareMIDIs(input_src_midi, input_trg_midi, input_sampling_resolution, inpu
414
  inp = torch.LongTensor(inp).cuda()
415
 
416
  with ctx:
417
- out = model(inp)
418
- cache = out[2]
419
- src_embedings = cache.layer_hiddens[-1]
 
420
 
421
  torch.cuda.empty_cache()
422
 
@@ -524,11 +525,11 @@ if __name__ == "__main__":
524
 
525
  gr.Markdown("### Make sure that the MIDI has at least sampling resolution number of notes")
526
 
527
- input_sampling_resolution = gr.Slider(40, 1000, value=40, step=1, label="Sampling resolution in notes")
528
 
529
  gr.Markdown("### Make sure that the sampling overlap value is less than sampling resolution value")
530
 
531
- input_sampling_overlap = gr.Slider(0, 500, value=0, step=1, label="Sampling overlap in notes")
532
 
533
  run_btn = gr.Button("compare", variant="primary")
534
 
 
414
  inp = torch.LongTensor(inp).cuda()
415
 
416
  with ctx:
417
+ with torch.no_grad()
418
+ out = model(inp)
419
+ cache = out[2]
420
+ src_embedings = cache.layer_hiddens[-1]
421
 
422
  torch.cuda.empty_cache()
423
 
 
525
 
526
  gr.Markdown("### Make sure that the MIDI has at least sampling resolution number of notes")
527
 
528
+ input_sampling_resolution = gr.Slider(50, 2000, value=500, step=10, label="Sampling resolution in notes")
529
 
530
  gr.Markdown("### Make sure that the sampling overlap value is less than sampling resolution value")
531
 
532
+ input_sampling_overlap = gr.Slider(0, 1000, value=0, step=10, label="Sampling overlap in notes")
533
 
534
  run_btn = gr.Button("compare", variant="primary")
535