Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1858,14 +1858,14 @@ def test_callback_fn(step: int, timestep: int, latents: torch.FloatTensor) -> No
expected_slice = np.array(
[1.1078, 1.5803, 0.2773, -0.0589, -1.7928, -0.3665, -0.4695, -1.0727, -1.1601]
)
assert np.abs(latents_slice.flatten() - expected_slice).max() < 1e-3
assert np.abs(latents_slice.flatten() - expected_slice).max() < 1e-2

test_callback_fn.has_been_called = False

pipe = StableDiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16
)
pipe.to(torch_device)
pipe = pipe.to(torch_device)
pipe.set_progress_bar_config(disable=None)
pipe.enable_attention_slicing()

Expand Down Expand Up @@ -1904,7 +1904,7 @@ def test_callback_fn(step: int, timestep: int, latents: torch.FloatTensor) -> No
assert latents.shape == (1, 4, 64, 96)
latents_slice = latents[0, -3:, -3:, -1]
expected_slice = np.array([0.7071, 0.7831, 0.8300, 1.8140, 1.7840, 1.9402, 1.3651, 1.6590, 1.2828])
assert np.abs(latents_slice.flatten() - expected_slice).max() < 1e-3
assert np.abs(latents_slice.flatten() - expected_slice).max() < 1e-2

test_callback_fn.has_been_called = False

Expand Down