Skip to content

Comments

decode-fix: MPS tensor and codebook bounds for macOS#23

Merged
lmangani merged 1 commit intomainfrom
decode-fix
Jan 30, 2026
Merged

decode-fix: MPS tensor and codebook bounds for macOS#23
lmangani merged 1 commit intomainfrom
decode-fix

Conversation

@lmangani
Copy link
Collaborator

  • Run HeartCodec on CPU on MPS to avoid 'invalid type: torch.mps.FloatTensor' during decode (detokenize/save path).
  • Round-trip wav via numpy before torchaudio.save so backend gets plain CPU tensor.
  • Clamp token IDs to codec codebook range [0, codebook_size-1] to avoid 'index X is out of bounds for dimension 1 with size 8192' in ResidualVQ.
  • Document decoding step flow in comments.

- Run HeartCodec on CPU on MPS to avoid 'invalid type: torch.mps.FloatTensor'
  during decode (detokenize/save path).
- Round-trip wav via numpy before torchaudio.save so backend gets plain CPU tensor.
- Clamp token IDs to codec codebook range [0, codebook_size-1] to avoid
  'index X is out of bounds for dimension 1 with size 8192' in ResidualVQ.
- Document decoding step flow in comments.
@lmangani lmangani merged commit be77667 into main Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant