Cleanup upscalers

This commit is contained in:
Disty0
2024-01-27 02:54:39 +03:00
parent 1440e07f02
commit dbe4d2ff70
8 changed files with 85 additions and 56 deletions
+2
View File
@@ -99,6 +99,8 @@ def scaled_dot_product_attention(query, key, value, attn_mask=None, dropout_p=0.
key = key.to(dtype=query.dtype)
if query.dtype != value.dtype:
value = value.to(dtype=query.dtype)
if attn_mask is not None and query.dtype != attn_mask.dtype:
attn_mask = attn_mask.to(dtype=query.dtype)
return original_scaled_dot_product_attention(query, key, value, attn_mask=attn_mask, dropout_p=dropout_p, is_causal=is_causal)
# A1111 FP16