Skip to content

Commit

Permalink
[PixArt Tests] remove fast tests from slow suite (huggingface#5945)
Browse files Browse the repository at this point in the history
remove fast tests from slow suite
  • Loading branch information
sayakpaul authored Dec 2, 2023
1 parent 4520e12 commit 3351270
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions tests/pipelines/pixart/test_pixart.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,40 +329,6 @@ def tearDown(self):
gc.collect()
torch.cuda.empty_cache()

def test_pixart_1024_fast(self):
generator = torch.manual_seed(0)

pipe = PixArtAlphaPipeline.from_pretrained(self.ckpt_id_1024, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

prompt = self.prompt

image = pipe(prompt, generator=generator, num_inference_steps=2, output_type="np").images

image_slice = image[0, -3:, -3:, -1]

expected_slice = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])

max_diff = np.abs(image_slice.flatten() - expected_slice).max()
self.assertLessEqual(max_diff, 1e-3)

def test_pixart_512_fast(self):
generator = torch.manual_seed(0)

pipe = PixArtAlphaPipeline.from_pretrained(self.ckpt_id_512, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

prompt = self.prompt

image = pipe(prompt, generator=generator, num_inference_steps=2, output_type="np").images

image_slice = image[0, -3:, -3:, -1]

expected_slice = np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])

max_diff = np.abs(image_slice.flatten() - expected_slice).max()
self.assertLessEqual(max_diff, 1e-3)

def test_pixart_1024(self):
generator = torch.manual_seed(0)

Expand Down

0 comments on commit 3351270

Please sign in to comment.