From fc8b126673bdfed65b2b98ee747368d35c1b42ba Mon Sep 17 00:00:00 2001 From: AUTOMATIC1111 <16777216c@gmail.com> Date: Fri, 28 Jun 2024 08:10:19 +0300 Subject: [PATCH] get T5 to work both with and without --precision half --- modules/models/sd3/other_impls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/models/sd3/other_impls.py b/modules/models/sd3/other_impls.py index d7b9b2621..002fe4832 100644 --- a/modules/models/sd3/other_impls.py +++ b/modules/models/sd3/other_impls.py @@ -479,7 +479,7 @@ class T5Stack(torch.nn.Module): def forward(self, input_ids, intermediate_output=None, final_layer_norm_intermediate=True): intermediate = None - x = self.embed_tokens(input_ids) + x = self.embed_tokens(input_ids).to(torch.float32) # needs float32 or else T5 returns all zeroes past_bias = None for i, layer in enumerate(self.block): x, past_bias = layer(x, past_bias)