Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/app/services/music_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,8 @@ def _pad_audio_token(token):

# Move frames to codec device (keep dtype as long for indexing)
# frames contains token IDs (integers) used as indices, so dtype must remain long
frames_for_codec = frames.to(device=pipeline.codec_device)
# Explicitly preserve torch.long dtype when moving to device (critical for MPS)
frames_for_codec = frames.to(device=pipeline.codec_device, dtype=torch.long)
wav = pipeline.codec.detokenize(frames_for_codec)

# Cleanup codec if using lazy loading (free VRAM for next generation)
Expand Down