asigalov61 commited on
Commit
4de4865
·
verified ·
1 Parent(s): e30152c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -404,8 +404,8 @@ def CompareMIDIs(input_src_midi, input_trg_midi, input_sampling_resolution, inpu
404
  input_src_tokens = src_tokens
405
  input_trg_tokens = trg_tokens
406
 
407
- sampling_resolution = input_sampling_resolution * 3
408
- sampling_overlap = input_sampling_overlap * 3
409
 
410
  comp_length = (min(len(input_src_tokens), len(input_trg_tokens)) // sampling_resolution) * sampling_resolution
411
 
 
404
  input_src_tokens = src_tokens
405
  input_trg_tokens = trg_tokens
406
 
407
+ sampling_resolution = max(40, min(1000, input_sampling_resolution)) * 3
408
+ sampling_overlap = max(0, min(500, input_sampling_overlap)) * 3
409
 
410
  comp_length = (min(len(input_src_tokens), len(input_trg_tokens)) // sampling_resolution) * sampling_resolution
411