microsoft/VibeVoice · error · ValueError
missing`sample` as a required keyword argument
Error message
missing`sample` as a required keyword argument
What it means
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.
Source
Thrown at vibevoice/schedule/dpm_solver.py:846
Args:
model_output_list (`List[torch.Tensor]`):
The direct outputs from learned diffusion model at current and latter timesteps.
sample (`torch.Tensor`):
A current instance of a sample created by diffusion process.
Returns:
`torch.Tensor`:
The sample tensor at the previous timestep.
"""
timestep_list = args[0] if len(args) > 0 else kwargs.pop("timestep_list", None)
prev_timestep = args[1] if len(args) > 1 else kwargs.pop("prev_timestep", None)
if sample is None:
if len(args) > 2:
sample = args[2]
else:
raise ValueError(" missing`sample` as a required keyword argument")
if timestep_list is not None:
deprecate(
"timestep_list",
"1.0.0",
"Passing `timestep_list` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`",
)
if prev_timestep is not None:
deprecate(
"prev_timestep",
"1.0.0",
"Passing `prev_timestep` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`",
)
sigma_t, sigma_s0, sigma_s1, sigma_s2 = (
self.sigmas[self.step_index + 1],
self.sigmas[self.step_index],
self.sigmas[self.step_index - 1],View on GitHub (pinned to 94da20d98b)
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).
Example fix
# before prev = sched._multistep_solver_second_order_update_corrected(mo, t_list, t_prev) # after prev = sched._multistep_solver_second_order_update_corrected(mo, sample=sample)
Defensive patterns
Strategy: validation
Validate before calling
assert sample is not None, "sample tensor is required" prev = scheduler._multistep_solver_second_order_update_corrected(model_output, sample=sample)
Type guard
import torch
def has_sample(sample) -> bool:
return isinstance(sample, torch.Tensor) Try / catch
try:
prev = sched._multistep_solver_second_order_update_corrected(mo, sample=sample)
except ValueError as e:
if "sample" in str(e) and "keyword argument" in str(e):
raise TypeError("scheduler update helper called without sample") from e
raise Prevention
- 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.
When it happens
Trigger: Direct invocation like `scheduler._multistep_solver_second_order_update_corrected(model_output, timestep_list, prev_timestep)` without `sample=...`; subclass overrides dropping the argument.
Common situations: Custom high-order update experiments; adapting the scheduler for batched audio tokens; grep-based error handling that expects the sibling message format.
Related errors
- missing `sample` as a required keyword argument
- missing `sample` as a required keyword argument
- Must pass exactly one of `num_inference_steps` or `timesteps
- Can only pass one of `num_inference_steps` or `custom_timest
- Number of inference steps is 'None', you need to run 'set_ti
AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15).
Data as JSON: /api/errors/51cfbaf60004551b.
Report an issue: GitHub.