Commit 520bb082 authored by Patrick von Platen's avatar Patrick von Platen
Browse files

fixes tests

parent 8faa822d
...@@ -674,7 +674,7 @@ class StableDiffusion2PipelineIntegrationTests(unittest.TestCase): ...@@ -674,7 +674,7 @@ class StableDiffusion2PipelineIntegrationTests(unittest.TestCase):
latents = latents.detach().cpu().numpy() latents = latents.detach().cpu().numpy()
assert latents.shape == (1, 4, 64, 64) assert latents.shape == (1, 4, 64, 64)
latents_slice = latents[0, -3:, -3:, -1] latents_slice = latents[0, -3:, -3:, -1]
expected_slice = np.array([1.078, 1.1804, 1.1339, 0.4664, -0.2354, 0.6097, -0.7749, -0.8784, -0.9465]) expected_slice = np.array([1.0757, 1.1860, 1.1410, 0.4645, -0.2476, 0.6100, -0.7755, -0.8841, -0.9497])
assert np.abs(latents_slice.flatten() - expected_slice).max() < 1e-2 assert np.abs(latents_slice.flatten() - expected_slice).max() < 1e-2
test_callback_fn.has_been_called = False test_callback_fn.has_been_called = False
......
...@@ -124,5 +124,5 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase): ...@@ -124,5 +124,5 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
image_slice = image[0, 253:256, 253:256, -1] image_slice = image[0, 253:256, 253:256, -1]
assert image.shape == (1, 512, 512, 3) assert image.shape == (1, 512, 512, 3)
expected_slice = np.array([0.3479, 0.1943, 0.1060, 0.3894, 0.2537, 0.1394, 0.3989, 0.3191, 0.1987]) expected_slice = np.array([0.3403, 0.1809, 0.0938, 0.3855, 0.2393, 0.1243, 0.4028, 0.3110, 0.1799])
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2 assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment