Spaces:
Running
on
Zero
Running
on
Zero
asigalov61
commited on
Update app.py
Browse files
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 |
-
|
418 |
-
|
419 |
-
|
|
|
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(
|
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,
|
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 |
|