Skip to content

Bug with dac.encode(x, n_quantizers) #106

Description

@ana-kuznetsova

Hello!,

I have been trying to use both 16k and 44k version of DAC. I am trying to use the same model with the different number of codebooks. E.g. for 16k I use

# Download a model
model_path = dac.utils.download(model_type="16khz")
model = dac.DAC.load(model_path)

model.to('cuda')

# Load audio signal file
audio, sr = torchaudio.load('input.wav')

audio = audio.unsqueeze(0)
z, codes, latents, _, _ = model.encode(audio.to('cuda'), n_quantizers=12)

The shape of the output codes tensor is torch.Size([1, 12, 292]).

However, if I do

z, codes, latents, _, _ = model.encode(audio.to('cuda'), n_quantizers=2)

The output codes still have the same shape, although I would imagine it should be torch.Size([1, 2, 292]) since only two codebooks are used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions