microsoft/VibeVoice · error · RuntimeError
Output embeddings (lm_head) are not defined for this model.
Error message
Output embeddings (lm_head) are not defined for this model. Create one before calling set_output_embeddings if needed.
What it means
The streaming inference wrapper defines get_output_embeddings() -> None and makes set_output_embeddings a hard RuntimeError: the model has no lm_head (vocabulary projection) because TTS generation ends in the diffusion head and an eos classifier, not token logits. Calling set_output_embeddings violates that design.
Source
Thrown at vibevoice/modular/modeling_vibevoice_streaming_inference.py:232
def get_input_embeddings(self):
return self.model.get_input_embeddings()
def set_input_embeddings(self, value):
self.model.set_input_embeddings(value)
def get_output_embeddings(self):
"""
This model does not define an `lm_head` (vocabulary projection).
"""
return None
def set_output_embeddings(self, new_embeddings):
"""
No-op because there is no `lm_head`. Provided only to satisfy optional API calls.
To enable, first create `self.lm_head` then allow assignment.
"""
raise RuntimeError("Output embeddings (lm_head) are not defined for this model. "
"Create one before calling set_output_embeddings if needed.")
def set_speech_tokenizers(self, acoustic_tokenizer=None):
"""Set the speech tokenizers used for encoding and decoding speech."""
self.model.set_speech_tokenizers(acoustic_tokenizer)
def set_ddpm_inference_steps(self, num_steps=None):
self.ddpm_inference_steps = num_steps or self.config.diffusion_head_config.ddpm_num_inference_steps
def prepare_inputs_for_generation(
self,
input_ids: torch.LongTensor,
past_key_values=None,
attention_mask=None,
inputs_embeds=None,
cache_position=None,
**kwargs,
):View on GitHub (pinned to 94da20d98b)
Solutions
- Remove the set_output_embeddings call — this model has no vocabulary head by design.
- If you added vocabulary tokens, resize via the text tokenizer/embedding path instead of the output head.
- get_output_embeddings() returns None; treat None as 'no head' in generic code paths.
- For logits-style output use forward_tts_lm, which returns tts_eos_classifier logits.
Example fix
# before model.set_output_embeddings(new_head) # RuntimeError # after # no lm_head exists; use the TTS end-of-stream logits instead out = model.forward_tts_lm(input_ids=ids, ...) print(out.logits) # from tts_eos_classifier
Defensive patterns
Strategy: type-guard
Validate before calling
if model.get_output_embeddings() is None:
# no lm_head by design; skip embedding resize/tie logic
pass Type guard
def has_lm_head(model) -> bool:
return model.get_output_embeddings() is not None Try / catch
try:
model.set_output_embeddings(head)
except RuntimeError:
# model has no vocabulary head; not an error condition
pass Prevention
- Check get_output_embeddings() is not None before calling setters
- Don't port HF CausalLM boilerplate onto the streaming wrapper
- Use forward_tts_lm logits for stop-token decisions
When it happens
Trigger: Generic transformers utilities (resize_token_embeddings, tie_weights, generation utilities) or user code calling model.set_output_embeddings(new_embeddings) on the streaming inference model.
Common situations: Reusing HF causal-LM boilerplate that resizes embeddings after adding tokens; hooking the model into tooling that assumes a standard CausalLM interface; migration from VibeVoice (non-streaming) which does have output embeddings.
Related errors
- VibeVoiceStreamingModel.forward is intentionally disabled. U
- Unified forward is disabled. Use `forward_lm`, `forward_tts_
- Voice preset {key!r} not found
- Unsupported decoder model type: {decoder_config.get('model_t
- segment_length must be positive
AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15).
Data as JSON: /api/errors/a7d78d56fd6b7dc6.
Report an issue: GitHub.