{"record":{"id":"51cfbaf60004551b","repo":"microsoft/VibeVoice","slug":"missing-sample-as-a-required-keyword-argument-51cfba","errorCode":null,"errorMessage":" missing`sample` as a required keyword argument","messagePattern":" missing`sample` as a required keyword argument","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/schedule/dpm_solver.py","lineNumber":846,"sourceCode":"\n        Args:\n            model_output_list (`List[torch.Tensor]`):\n                The direct outputs from learned diffusion model at current and latter timesteps.\n            sample (`torch.Tensor`):\n                A current instance of a sample created by diffusion process.\n\n        Returns:\n            `torch.Tensor`:\n                The sample tensor at the previous timestep.\n        \"\"\"\n\n        timestep_list = args[0] if len(args) > 0 else kwargs.pop(\"timestep_list\", None)\n        prev_timestep = args[1] if len(args) > 1 else kwargs.pop(\"prev_timestep\", None)\n        if sample is None:\n            if len(args) > 2:\n                sample = args[2]\n            else:\n                raise ValueError(\" missing`sample` as a required keyword argument\")\n        if timestep_list is not None:\n            deprecate(\n                \"timestep_list\",\n                \"1.0.0\",\n                \"Passing `timestep_list` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`\",\n            )\n\n        if prev_timestep is not None:\n            deprecate(\n                \"prev_timestep\",\n                \"1.0.0\",\n                \"Passing `prev_timestep` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`\",\n            )\n\n        sigma_t, sigma_s0, sigma_s1, sigma_s2 = (\n            self.sigmas[self.step_index + 1],\n            self.sigmas[self.step_index],\n            self.sigmas[self.step_index - 1],","sourceCodeStart":828,"sourceCodeEnd":864,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/schedule/dpm_solver.py#L828-L864","documentation":"The second/third-order multistep update helper (same `timestep_list`-style signature as 57) raises this when `sample` is absent from both kwargs and args[2]. Note the message has drifted from the siblings: ` missing\\`sample`` — a stray backtick and leading space in this vendored copy, so exact string matching on the message will not match the other two variants.","triggerScenarios":"Direct invocation like `scheduler._multistep_solver_second_order_update_corrected(model_output, timestep_list, prev_timestep)` without `sample=...`; subclass overrides dropping the argument.","commonSituations":"Custom high-order update experiments; adapting the scheduler for batched audio tokens; grep-based error handling that expects the sibling message format.","solutions":["Pass the sample tensor: `...(model_output, sample=sample)`.","Use the public `step()` API instead of the internal update helpers.","When matching these errors by message, allow for formatting drift (match on 'sample' + 'required keyword' rather than the exact string)."],"exampleFix":"# before\nprev = sched._multistep_solver_second_order_update_corrected(mo, t_list, t_prev)\n\n# after\nprev = sched._multistep_solver_second_order_update_corrected(mo, sample=sample)","handlingStrategy":"validation","validationCode":"assert sample is not None, \"sample tensor is required\"\nprev = scheduler._multistep_solver_second_order_update_corrected(model_output, sample=sample)","typeGuard":"import torch\n\ndef has_sample(sample) -> bool:\n    return isinstance(sample, torch.Tensor)","tryCatchPattern":"try:\n    prev = sched._multistep_solver_second_order_update_corrected(mo, sample=sample)\nexcept ValueError as e:\n    if \"sample\" in str(e) and \"keyword argument\" in str(e):\n        raise TypeError(\"scheduler update helper called without sample\") from e\n    raise","preventionTips":["Pass sample by keyword to all internal update helpers.","This message contains a stray backtick (' missing`sample') — do not match sibling error strings exactly.","Prefer step(); direct helper calls are for experimentation only."],"tags":["python","diffusion","scheduler","internal-api","api-misuse"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}