Skip to content

Commit a9a64c6

Browse files
Apply suggestions from code review
Co-authored-by: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com>
1 parent d8585db commit a9a64c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/openvino/test_diffusion.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def test_compare_to_diffusers_pipeline(self, model_arch: str):
134134
height, width, batch_size = 64, 64, 1
135135
inputs = self.generate_inputs(height=height, width=width, batch_size=batch_size)
136136
ov_pipeline = self.OVMODEL_CLASS.from_pretrained(MODEL_NAMES[model_arch])
137-
diffusers_pipeline = DiffusionPipeline.from_pretrained(MODEL_NAMES[model_arch])
137+
auto_cls = self.AUTOMODEL_CLASS if model_arch != "sana" else DiffusionPipeline
138+
diffusers_pipeline = auto_cls.from_pretrained(MODEL_NAMES[model_arch])
138139

139140
for output_type in ["latent", "np", "pt"]:
140141
inputs["output_type"] = output_type
@@ -179,7 +180,8 @@ def __call__(self, *args, **kwargs) -> None:
179180
auto_callback = Callback()
180181

181182
ov_pipe = self.OVMODEL_CLASS.from_pretrained(MODEL_NAMES[model_arch])
182-
auto_pipe = DiffusionPipeline.from_pretrained(MODEL_NAMES[model_arch])
183+
auto_cls = self.AUTOMODEL_CLASS if model_arch != "sana" else DiffusionPipeline
184+
auto_pipe = auto_cls.from_pretrained(MODEL_NAMES[model_arch])
183185

184186
# callback_steps=1 to trigger callback every step
185187
ov_pipe(**inputs, callback=ov_callback, callback_steps=1)

0 commit comments

Comments
 (0)