mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
Fix mixed precision issue by wrapping the offending code with the torch.autocast context manager.
This commit is contained in:
@@ -1246,7 +1246,8 @@ class UniDiffuserPipeline(DiffusionPipeline):
|
||||
)
|
||||
|
||||
if reduce_text_emb_dim:
|
||||
prompt_embeds = self.text_decoder.encode_prefix(prompt_embeds)
|
||||
with torch.autocast(device_type=device.type):
|
||||
prompt_embeds = self.text_decoder.encode_prefix(prompt_embeds)
|
||||
|
||||
# 4. Encode image, if available; otherwise prepare image latents
|
||||
if mode in ["img2text"]:
|
||||
|
||||
Reference in New Issue
Block a user