Spaces:
Running
on
Zero
Running
on
Zero
asigalov61
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -89,8 +89,7 @@ def plot_ms_SONG(ms_song,
|
|
89 |
|
90 |
min_val = min(plot_curve_values)
|
91 |
max_val = max(plot_curve_values)
|
92 |
-
spcva = [((value - min_val) / (max_val - min_val)) * 100 for value in plot_curve_values]
|
93 |
-
|
94 |
|
95 |
mult = int(math.ceil(max(add_arrays(start_times, durations)) / len(spcva)))
|
96 |
pcv = [value for value in spcva for _ in range(mult)][:int(max(add_arrays(start_times, durations)))+mult]
|
@@ -412,7 +411,7 @@ def CompareMIDIs(input_src_midi, input_trg_midi, input_sampling_resolution, inpu
|
|
412 |
|
413 |
comp_cos_sims = []
|
414 |
|
415 |
-
for i in range(0, comp_length, sampling_resolution-sampling_overlap):
|
416 |
|
417 |
torch.cuda.empty_cache()
|
418 |
|
|
|
89 |
|
90 |
min_val = min(plot_curve_values)
|
91 |
max_val = max(plot_curve_values)
|
92 |
+
spcva = [((value - min_val) / (max(max_val - min_val, 0.00001))) * 100 for value in plot_curve_values]
|
|
|
93 |
|
94 |
mult = int(math.ceil(max(add_arrays(start_times, durations)) / len(spcva)))
|
95 |
pcv = [value for value in spcva for _ in range(mult)][:int(max(add_arrays(start_times, durations)))+mult]
|
|
|
411 |
|
412 |
comp_cos_sims = []
|
413 |
|
414 |
+
for i in range(0, comp_length, max(0, sampling_resolution-sampling_overlap)):
|
415 |
|
416 |
torch.cuda.empty_cache()
|
417 |
|