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
5 changes: 3 additions & 2 deletions backend/app/services/music_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,9 @@ def _pad_audio_token(token):
else:
raise RuntimeError("Cannot load HeartCodec: codec_path not available")

# Convert frames to codec device and dtype (important for MPS float16)
frames_for_codec = frames.to(device=pipeline.codec_device, dtype=codec_dtype)
# 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)
wav = pipeline.codec.detokenize(frames_for_codec)

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