Skip to content

Commit

Permalink
Diffusers 0.15.0 bug fix (microsoft#3345)
Browse files Browse the repository at this point in the history
* diffusers 0.15.0 cross attention class check

* revert diffusers_attention.py
  • Loading branch information
molly-smith authored Apr 21, 2023
1 parent 6e1cbeb commit 496a9a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepspeed/module_inject/replace_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ def replace_attn_block(child, policy):

try:
import diffusers
cross_attention = diffusers.models.attention.CrossAttention
if hasattr(diffusers.models.attention, 'CrossAttention'):
cross_attention = diffusers.models.attention.CrossAttention
else:
cross_attention = diffusers.models.attention_processor.Attention
attention_block = diffusers.models.attention.BasicTransformerBlock
new_policies = {
cross_attention: replace_attn,
Expand Down

0 comments on commit 496a9a3

Please sign in to comment.