test_schedulers: enforce manual seed

This commit is contained in:
Cédric Deltheil 2023-12-12 17:18:29 +01:00 committed by Cédric Deltheil
parent 7992258dd2
commit 315b4ed2e4

View file

@ -26,9 +26,11 @@ def test_dpm_solver_diffusers():
assert allclose(diffusers_output, refiners_output, rtol=0.01), f"outputs differ at step {step}" assert allclose(diffusers_output, refiners_output, rtol=0.01), f"outputs differ at step {step}"
def test_ddim_solver_diffusers(): def test_ddim_diffusers():
from diffusers import DDIMScheduler # type: ignore from diffusers import DDIMScheduler # type: ignore
manual_seed(0)
diffusers_scheduler = DDIMScheduler( diffusers_scheduler = DDIMScheduler(
beta_end=0.012, beta_end=0.012,
beta_schedule="scaled_linear", beta_schedule="scaled_linear",
@ -54,6 +56,8 @@ def test_ddim_solver_diffusers():
def test_scheduler_remove_noise(): def test_scheduler_remove_noise():
from diffusers import DDIMScheduler # type: ignore from diffusers import DDIMScheduler # type: ignore
manual_seed(0)
diffusers_scheduler = DDIMScheduler( diffusers_scheduler = DDIMScheduler(
beta_end=0.012, beta_end=0.012,
beta_schedule="scaled_linear", beta_schedule="scaled_linear",