Skip to content

Commit 85d0d70

Browse files
authored
Move cor_nom, cor_den to mps (gui_v1.py) (#851)
* Move `cor_nom`, `cor_den` to mps * Split logic based on system
1 parent 78b8bfe commit 85d0d70

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gui_v1.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,10 @@ def audio_callback(
556556
+ 1e-8
557557
)
558558
if sys.platform == "darwin":
559-
cor_nom = cor_nom.cpu()
560-
cor_den = cor_den.cpu()
561-
sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
559+
_, sola_offset = torch.max(cor_nom[0, 0] / cor_den[0, 0])
560+
sola_offset = sola_offset.item()
561+
else:
562+
sola_offset = torch.argmax(cor_nom[0, 0] / cor_den[0, 0])
562563
print("sola offset: " + str(int(sola_offset)))
563564
self.output_wav[:] = infer_wav[sola_offset : sola_offset + self.block_frame]
564565
self.output_wav[: self.crossfade_frame] *= self.fade_in_window

0 commit comments

Comments
 (0)