{"record":{"id":"d4112326b15b72e1","repo":"microsoft/VibeVoice","slug":"self-config-timestep-spacing-is-not-supported-p","errorCode":null,"errorMessage":"{self.config.timestep_spacing} is not supported. Please make sure to choose one of 'linspace', 'leading' or 'trailing'.","messagePattern":"(.+?) is not supported\\. Please make sure to choose one of 'linspace', 'leading' or 'trailing'\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/schedule/dpm_solver.py","lineNumber":380,"sourceCode":"                    .copy()\n                    .astype(np.int64)\n                )\n            elif self.config.timestep_spacing == \"leading\":\n                step_ratio = last_timestep // (num_inference_steps + 1)\n                # creates integer timesteps by multiplying by ratio\n                # casting to int to avoid issues when num_inference_step is power of 3\n                timesteps = (\n                    (np.arange(0, num_inference_steps + 1) * step_ratio).round()[::-1][:-1].copy().astype(np.int64)\n                )\n                timesteps += self.config.steps_offset\n            elif self.config.timestep_spacing == \"trailing\":\n                step_ratio = self.config.num_train_timesteps / num_inference_steps\n                # creates integer timesteps by multiplying by ratio\n                # casting to int to avoid issues when num_inference_step is power of 3\n                timesteps = np.arange(last_timestep, 0, -step_ratio).round().copy().astype(np.int64)\n                timesteps -= 1\n            else:\n                raise ValueError(\n                    f\"{self.config.timestep_spacing} is not supported. Please make sure to choose one of 'linspace', 'leading' or 'trailing'.\"\n                )\n\n        sigmas = np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5)\n        log_sigmas = np.log(sigmas)\n\n        if self.config.use_karras_sigmas:\n            sigmas = np.flip(sigmas).copy()\n            sigmas = self._convert_to_karras(in_sigmas=sigmas, num_inference_steps=num_inference_steps)\n            timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas]).round()\n        elif self.config.use_lu_lambdas:\n            lambdas = np.flip(log_sigmas.copy())\n            lambdas = self._convert_to_lu(in_lambdas=lambdas, num_inference_steps=num_inference_steps)\n            sigmas = np.exp(lambdas)\n            timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas]).round()\n        else:\n            sigmas = np.interp(timesteps, np.arange(0, len(sigmas)), sigmas)\n","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/schedule/dpm_solver.py#L362-L398","documentation":"When `set_timesteps` generates its grid from `num_inference_steps`, the spacing rule comes from `config.timestep_spacing`; this vendored scheduler implements only `linspace`, `leading`, and `trailing`. Any other value raises ValueError at set_timesteps time (not construction), because the constructor never validates it. The default in diffusers-style configs is usually `leading`.","triggerScenarios":"`scheduler.set_timesteps(30)` on a scheduler constructed with `timestep_spacing=\"linspace_trailing\"`, `\"trailing\" ` with whitespace, or a value from a newer diffusers config not ported here.","commonSituations":"Configs authored for SDXL-era diffusers (where trailing is recommended) copied into this repo; typo or case error in YAML; model-card JSON carrying an unsupported spacing value.","solutions":["Set timestep_spacing to \"linspace\", \"leading\", or \"trailing\" in the scheduler constructor/config.","For diffusion models trained with zero-terminal-SNR, prefer \"trailing\".","Validate the value right after loading config, since the constructor will not catch it."],"exampleFix":"# before\nsched = DPMSolverMultistepScheduler(..., timestep_spacing=\"euler\")\nsched.set_timesteps(30)  # ValueError here\n\n# after\nsched = DPMSolverMultistepScheduler(..., timestep_spacing=\"trailing\")\nsched.set_timesteps(30)","handlingStrategy":"validation","validationCode":"SPACINGS = {\"linspace\", \"leading\", \"trailing\"}\nif scheduler.config.timestep_spacing not in SPACINGS:\n    raise ValueError(\n        f\"timestep_spacing {scheduler.config.timestep_spacing!r} invalid; \"\n        f\"choose from {sorted(SPACINGS)}\"\n    )\nscheduler.set_timesteps(30)","typeGuard":"def is_supported_timestep_spacing(v) -> bool:\n    return isinstance(v, str) and v in {\"linspace\", \"leading\", \"trailing\"}","tryCatchPattern":null,"preventionTips":["Validate timestep_spacing immediately after scheduler construction — the constructor does not check it.","Configs from other diffusion repos may carry spacing values this copy lacks.","For zero-terminal-SNR-trained models, standardize on 'trailing'."],"tags":["python","diffusion","scheduler","config","timesteps"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}