Skip to content

Commit f148354

Browse files
Copilotlmangani
andcommitted
Update comment to be more accurate about MPS dtype behavior
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
1 parent 033a8a4 commit f148354

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/app/services/music_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ def _pad_audio_token(token):
805805
callback(progress, f"Generating audio... {i + 1}/{max_audio_frames} frames")
806806

807807
# Stack frames and explicitly preserve torch.long dtype (critical for MPS compatibility)
808-
# torch.stack may promote dtype to float on MPS, so we explicitly convert to long before CPU
808+
# Explicitly ensure torch.long dtype is preserved (defensive fix for potential MPS backend issues)
809809
frames = torch.stack(frames).permute(1, 2, 0).squeeze(0).to(dtype=torch.long).cpu()
810810

811811
# Sequential offload: Move HeartMuLa to CPU before loading HeartCodec

0 commit comments

Comments
 (0)