Skip to content

Commit

Permalink
Fix reshaping unet if timestep is 0d tensor (#1083)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Dec 19, 2024
1 parent 106a5b7 commit cda4908
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion optimum/intel/openvino/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@ def _reshape_unet(
for inputs in model.inputs:
shapes[inputs] = inputs.get_partial_shape()
if inputs.get_any_name() == "timestep":
shapes[inputs][0] = 1
if shapes[inputs].rank == 1:
shapes[inputs][0] = 1
elif inputs.get_any_name() == "sample":
in_channels = self.unet.config.get("in_channels", None)
if in_channels is None:
Expand Down

0 comments on commit cda4908

Please sign in to comment.