asigalov61
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -404,11 +404,11 @@ def CompareMIDIs(input_src_midi, input_trg_midi, input_sampling_resolution, inpu
|
|
404 |
input_trg_tokens = trg_tokens[:comp_length]
|
405 |
|
406 |
comp_cos_sims = []
|
|
|
|
|
407 |
|
408 |
for i in range(0, comp_length, max(1, sampling_resolution-sampling_overlap)):
|
409 |
|
410 |
-
torch.cuda.empty_cache()
|
411 |
-
|
412 |
inp = [input_src_tokens[i:i+sampling_resolution]]
|
413 |
|
414 |
inp = torch.LongTensor(inp).cuda()
|
@@ -420,8 +420,6 @@ def CompareMIDIs(input_src_midi, input_trg_midi, input_sampling_resolution, inpu
|
|
420 |
cache = out[2]
|
421 |
src_embedings = cache.layer_hiddens[-1]
|
422 |
|
423 |
-
torch.cuda.empty_cache()
|
424 |
-
|
425 |
inp = [input_trg_tokens[i:i+sampling_resolution]]
|
426 |
|
427 |
inp = torch.LongTensor(inp).cuda()
|
|
|
404 |
input_trg_tokens = trg_tokens[:comp_length]
|
405 |
|
406 |
comp_cos_sims = []
|
407 |
+
|
408 |
+
torch.cuda.empty_cache()
|
409 |
|
410 |
for i in range(0, comp_length, max(1, sampling_resolution-sampling_overlap)):
|
411 |
|
|
|
|
|
412 |
inp = [input_src_tokens[i:i+sampling_resolution]]
|
413 |
|
414 |
inp = torch.LongTensor(inp).cuda()
|
|
|
420 |
cache = out[2]
|
421 |
src_embedings = cache.layer_hiddens[-1]
|
422 |
|
|
|
|
|
423 |
inp = [input_trg_tokens[i:i+sampling_resolution]]
|
424 |
|
425 |
inp = torch.LongTensor(inp).cuda()
|