-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[df-if II] add additional input checks to ensure the input is divisible by 8 #7844
base: main
Are you sure you want to change the base?
Changes from all commits
ffaa08f
ea22092
95bba60
2c1cc63
96290b6
84ae72a
69b5d38
a98ee37
7fd4782
b7973d6
fe48c23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,15 @@ def get_dummy_inputs(self, device, seed=0): | |
|
||
return inputs | ||
|
||
def test_incorrect_input_size(self): | ||
# Put an image non-divisible by 8 into the pipeline and check that it throws an Exception. | ||
image = floats_tensor((1, 3, 31, 31), rng=random.Random(0)).to(torch_device) | ||
generator = torch.Generator(device="cpu").manual_seed(0) | ||
with self.assertRaises(ValueError): | ||
self.pipeline( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we make sure this test works? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i can't run the test suite locally, i was waiting for it to run on the workflow here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh so these are the tests that failed https://github.com/huggingface/diffusers/actions/runs/9044175339/job/24855064736#step:7:15620 |
||
prompt="elegant destruction", image=image, generator=generator, num_inference_steps=2, output_type="np" | ||
) | ||
|
||
@unittest.skipIf( | ||
torch_device != "cuda" or not is_xformers_available(), | ||
reason="XFormers attention is only available with CUDA and `xformers` installed", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to do this in a separate code block:
So we keep this section as it is to check
image_batch_size
and then
The current code does not work for list of array or tensors