From f36df419995da1bafee02aaf789c2299b0e123d7 Mon Sep 17 00:00:00 2001 From: Daniel Gu Date: Thu, 11 May 2023 08:07:54 -0700 Subject: [PATCH] Revert "Fix mixed precision issue by wrapping the offending code with the torch.autocast context manager." This reverts commit 1a58958ab4f024dbc4c90a6404c2e66210db6d00. --- src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py b/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py index e1184964ad..d5f598c311 100644 --- a/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py +++ b/src/diffusers/pipelines/unidiffuser/pipeline_unidiffuser.py @@ -1246,8 +1246,7 @@ class UniDiffuserPipeline(DiffusionPipeline): ) if reduce_text_emb_dim: - with torch.autocast(device_type=device.type): - prompt_embeds = self.text_decoder.encode_prefix(prompt_embeds) + prompt_embeds = self.text_decoder.encode_prefix(prompt_embeds) # 4. Encode image, if available; otherwise prepare image latents if mode in ["img2text"]: