Skip to content

Add num_inference_steps <= 0 validation in DDPMScheduler.set_timesteps#13988

Open
Whning0513 wants to merge 1 commit into
huggingface:mainfrom
Whning0513:fix-issue-13394
Open

Add num_inference_steps <= 0 validation in DDPMScheduler.set_timesteps#13988
Whning0513 wants to merge 1 commit into
huggingface:mainfrom
Whning0513:fix-issue-13394

Conversation

@Whning0513

@Whning0513 Whning0513 commented Jun 19, 2026

Copy link
Copy Markdown

DDPMScheduler.set_timesteps() was missing a guard for num_inference_steps <= 0. When passed 0 or negative, np.linspace produces empty arrays downstream.

This follows the same validation pattern already used in DDIMScheduler.

@Whning0513 Whning0513 changed the title Fix #13394: DDPMScheduler set_timesteps 缺少 num_inference_steps <= 0 验证 Add num_inference_steps <= 0 validation in DDPMScheduler.set_timesteps Jun 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @Whning0513, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant