Skip to content

Commit

Permalink
fix(diffusers/pipelines): fix some bugs to make mindone.diffusers.pip…
Browse files Browse the repository at this point in the history
…elines compatible with MindSpore 2.3.0
  • Loading branch information
The-truthh committed Aug 22, 2024
1 parent cae308a commit d6fdc3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion mindone/diffusers/models/downsampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ def construct(self, inputs: ms.Tensor) -> ms.Tensor:
inputs.shape[1],
self.kernel.shape[0],
self.kernel.shape[1],
]
],
dtype=inputs.dtype,
)
indices = ops.arange(inputs.shape[1])
kernel = self.kernel.to(weight.dtype)[None, :].broadcast_to((inputs.shape[1], -1, -1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _encode_prompt(self, prompt, do_classifier_free_guidance, negative_prompt):
)

text_encoder_out = self.text_encoder(ms.Tensor(text_input_ids), output_hidden_states=True)
text_embeddings = text_encoder_out[0][-1]
text_embeddings = text_encoder_out[0]
text_pooler_out = text_encoder_out[1]

# get unconditional embeddings for classifier free guidance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1091,10 +1091,6 @@ def __call__(
image = latents

if not output_type == "latent":
# apply watermark if available
if self.watermark is not None:
image = self.watermark.apply_watermark(image)

image = self.image_processor.postprocess(image, output_type=output_type)

if not return_dict:
Expand Down

0 comments on commit d6fdc3b

Please sign in to comment.