Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.
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
4 changes: 3 additions & 1 deletion tests/test_diffusion_inferer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def test_ddim_sampler(self, model_params, input_shape):

@parameterized.expand(TEST_CASES)
def test_sampler_conditioned(self, model_params, input_shape):
model_params["with_conditioning"] = True
model_params["cross_attention_dim"] = 3
model = DiffusionModelUNet(**model_params)
device = "cuda:0" if torch.cuda.is_available() else "cpu"
model.to(device)
Expand All @@ -130,7 +132,7 @@ def test_sampler_conditioned(self, model_params, input_shape):
)
inferer = DiffusionInferer(scheduler=scheduler)
scheduler.set_timesteps(num_inference_steps=10)
conditioning = torch.randn([input_shape[0], 1, 3])
conditioning = torch.randn([input_shape[0], 1, 3]).to(device)
sample, intermediates = inferer.sample(
input_noise=noise,
diffusion_model=model,
Expand Down