Reject an empty custom timestep list with a clear ValueError - #25
Open
alex-16moro wants to merge 2 commits into
Open
alex-16moro wants to merge 2 commits into
alex-16moro wants to merge 2 commits into
Conversation
Co-authored-by: alex-16moro <alex-16moro@users.noreply.github.com>
Co-authored-by: alex-16moro <alex-16moro@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DDPMScheduler.set_timesteps(timesteps=[])currently fails withIndexError: list index out of rangewhen it readstimesteps[0], which gives the caller no hint about what went wrong.What changed
DDPMScheduler.set_timestepsraisesValueError("timestepscannot be empty.") for an empty custom list. The check runs after the existing mutual-exclusion check and beforetimesteps[0]is read.DDPMParallelScheduler.set_timestepsis a# Copied fromcopy and was updated withutils/check_copies.py --fix_and_overwrite.num_inference_stepsschedules behave as before.Considered and rejected: substituting a default such as
[999]. The library's guidance prefers a concise error to silently correcting input, and999is only meaningful whennum_train_timestepsis 1000.Validation
Ramp Kit full verification: 12/12 checks PASS (acceptance, scheduler tests, lint, format, upstream quality, copies, dummies, support list, forward docstrings, dependency table, dependencies, test strength). The test-strength replay removed the fix and the new test failed as intended. Patch digest
02c34f9999a89c1131050dd001c3e7a0bf1dbb7b4f18db93b0b4bf62108ad3da.Reviewer attention
tests/schedulers/test_scheduler_ddpm.pybecause the kit's editable scope excludes the parallel test file; it can move if preferred.