microsoft/VibeVoice · error · ValueError

Unsupported dist_type: {dist_type}, expected 'fix' or 'gauss

Error message

Unsupported dist_type: {dist_type}, expected 'fix' or 'gaussian'

What it means

The tokenizer's `sampling()` method draws latents from the encoder output distribution. The distribution type must be 'fix' (deterministic, using the stored fixed std) or 'gaussian' (sample from N(mean, std)). The value comes from the `dist_type` argument or, when omitted, from the model's `std_dist_type` attribute; anything else raises this ValueError.

Source

Thrown at vibevoice/modular/modular_vibevoice_tokenizer.py:1109

                nn.init.zeros_(module.bias)
    
    @torch.no_grad()
    def encode(self, audio, cache=None, sample_indices=None, use_cache=False, debug=False, is_final_chunk=False):
        """Convert audio to latent representations"""
        latents = self.encoder(audio, cache=cache, sample_indices=sample_indices, use_cache=use_cache, debug=debug, is_final_chunk=is_final_chunk)
        return VibeVoiceTokenizerEncoderOutput(mean=latents.permute(0, 2, 1), std=self.fix_std)
    
    @torch.no_grad()
    def sampling(self, encoder_output, dist_type=None):
        """Sample from the encoder output distribution"""
        dist_type = dist_type or self.std_dist_type
    
        if dist_type == 'fix':
            return encoder_output.sample(dist_type='fix')
        elif dist_type == 'gaussian':
            return encoder_output.sample(dist_type='gaussian')
        else:
            raise ValueError(f"Unsupported dist_type: {dist_type}, expected 'fix' or 'gaussian'")
    
    @torch.no_grad()
    def decode(self, latents, cache=None, sample_indices=None, use_cache=False, debug=False):
        """Convert latent representations back to audio"""
        if latents.shape[1] == self.config.vae_dim:
            pass
        else:
            latents = latents.permute(0, 2, 1)

        audio = self.decoder(latents, cache=cache, sample_indices=sample_indices, use_cache=use_cache, debug=debug)
        return audio

    def forward(self, audio, cache=None, sample_indices=None, use_cache=False, debug=False):
        """Full forward pass: encode audio to latents, then decode back to audio"""
        encoder_output = self.encode(audio, cache=cache, sample_indices=sample_indices, use_cache=use_cache, debug=debug)
        sampled_latents, _ = self.sampling(encoder_output)
        reconstructed = self.decode(sampled_latents, cache=cache, sample_indices=sample_indices, use_cache=use_cache, debug=debug)
        return reconstructed, sampled_latents

View on GitHub (pinned to 94da20d98b)

Solutions

  1. Pass dist_type='fix' or dist_type='gaussian' explicitly to sampling().
  2. If omitting the argument, set the model's std_dist_type (or the corresponding config field) to 'fix' or 'gaussian' at construction time.
  3. Check for leading/trailing whitespace or casing mistakes in config-driven values (matching is exact).

Example fix

# before
latents = model.sampling(encoder_output)  # std_dist_type unset -> ValueError

# after
latents = model.sampling(encoder_output, dist_type='gaussian')
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_DIST = {'fix', 'gaussian'}
dist = dist_type or model.std_dist_type
assert dist in SUPPORTED_DIST, f'dist_type must be {SUPPORTED_DIST}, got {dist!r}'
latents = model.sampling(encoder_output, dist_type=dist)

Type guard

def is_supported_dist_type(value) -> bool:
    return isinstance(value, str) and value in ('fix', 'gaussian')

Try / catch

try:
    latents = model.sampling(encoder_output, dist_type=dist_type)
except ValueError as e:
    if 'Unsupported dist_type' in str(e):
        latents = model.sampling(encoder_output, dist_type='fix')  # explicit safe default
    else:
        raise

Prevention

When it happens

Trigger: Calling model.sampling(encoder_output, dist_type='fixed'), dist_type='' or any string other than 'fix'/'gaussian'; or configuring the model with a std_dist_type default that is None or misspelled and then calling sampling() with no explicit dist_type.

Common situations: Users migrating from another VAE codebase that uses 'deterministic'/'stochastic' terminology, or setting std_dist_type in a config file with the wrong casing ('Fix', 'GAUSSIAN'). Also occurs when dist_type is left unset on a config that never defined std_dist_type.

Related errors


AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15). Data as JSON: /api/errors/8c07def07222f8e6. Report an issue: GitHub.