{"record":{"id":"512a65c4be8342e5","repo":"microsoft/VibeVoice","slug":"vibevoicestreamingmodel-forward-is-intentionally-d","errorCode":null,"errorMessage":"VibeVoiceStreamingModel.forward is intentionally disabled. Use `model.language_model(...)` or `model.tts_language_model(...)` instead.","messagePattern":"VibeVoiceStreamingModel\\.forward is intentionally disabled\\. Use `model\\.language_model\\(\\.\\.\\.\\)` or `model\\.tts_language_model\\(\\.\\.\\.\\)` instead\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"vibevoice/modular/modeling_vibevoice_streaming.py","lineNumber":179,"sourceCode":"            self.acoustic_tokenizer.eval()\n    \n    def forward(self, *args, **kwargs):\n        \"\"\"\n        Intentionally not implemented.\n\n        This streaming model is split into two explicit submodules:\n          - `language_model`      for plain text processing (lower layers).\n          - `tts_language_model`  for TTS-related upper layers.\n\n        We deliberately avoid a unified `forward` to prevent accidental calls\n        that mix responsibilities.\n\n        To use the model:\n          - Call `self.language_model(...)` for text embeddings / hidden states.\n          - Call `self.tts_language_model(...)` for the TTS portion.\n          - Use the dedicated inference class for combined generation logic.\n        \"\"\"\n        raise RuntimeError(\n            \"VibeVoiceStreamingModel.forward is intentionally disabled. \"\n            \"Use `model.language_model(...)` or `model.tts_language_model(...)` instead.\"\n        )\n\n\nAutoModel.register(VibeVoiceStreamingConfig, VibeVoiceStreamingModel)\n\n__all__ = [\n    \"VibeVoiceStreamingPreTrainedModel\",\n    \"VibeVoiceStreamingModel\",\n]","sourceCodeStart":161,"sourceCodeEnd":190,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/modular/modeling_vibevoice_streaming.py#L161-L190","documentation":"VibeVoiceStreamingModel deliberately disables nn.Module-style forward. The model is split into language_model (text layers) and tts_language_model (TTS upper layers), and a monolithic forward would hide that split, so calling model(...) always raises RuntimeError with instructions. This is an API-contract error, not a malfunction.","triggerScenarios":"Calling model(input_ids=...) directly on a VibeVoiceStreamingModel (including via generic HF helpers like from_pretrained(...)(...) or wrappers that invoke .forward); passing the model to code that assumes a callable module.","commonSituations":"Porting code from the non-streaming VibeVoiceModel which does have forward; generic wrappers (accelerate, custom loops) that call module(*inputs); copy-paste of standard transformers usage patterns.","solutions":["Use model.language_model(...) for text hidden states and model.tts_language_model(...) for TTS layers.","For end-to-end generation, use the dedicated inference wrapper class (VibeVoiceStreamingForInference / generate) instead of the raw module.","Audit third-party wrappers that call module(...) and route them to the explicit submodules.","Do not attempt to bypass by defining forward — the split is intentional for correct staged inference."],"exampleFix":"# before\nout = streaming_model(input_ids=ids)  # RuntimeError\n\n# after\nhidden = streaming_model.language_model(input_ids=ids)\ntts_out = streaming_model.tts_language_model(hidden_states=hidden.last_hidden_state)","handlingStrategy":"type-guard","validationCode":"def call_streaming(model, **kwargs):\n    if hasattr(model, \"language_model\") and hasattr(model, \"tts_language_model\"):\n        raise TypeError(\"Use model.language_model()/tts_language_model()/generate, not model(...)\")\n    return model(**kwargs)","typeGuard":"from vibevoice.modular.modeling_vibevoice_streaming import VibeVoiceStreamingModel\n\ndef has_disabled_forward(model) -> bool:\n    return isinstance(model, VibeVoiceStreamingModel)","tryCatchPattern":"try:\n    out = model(input_ids=ids)\nexcept RuntimeError as e:\n    if \"intentionally disabled\" in str(e):\n        out = model.language_model(input_ids=ids)  # route explicitly\n    else:\n        raise","preventionTips":["Treat language_model/tts_language_model as the only entry points","Don't feed the streaming module to code that calls module(*) blindly","Use the inference wrapper's generate for end-to-end runs"],"tags":["api-contract","streaming","forward-disabled","runtimeerror"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}