Skip to content

Commit

Permalink
try import expand mask from transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
zengyh1900 committed Nov 10, 2023
1 parent 991d535 commit 889fc96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mmagic/models/editors/fastcomposer/fastcomposer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
from transformers import (CLIPModel, CLIPPreTrainedModel, CLIPTextModel,
CLIPVisionConfig, CLIPVisionModel)
from transformers.modeling_outputs import BaseModelOutputWithPooling
from transformers.models.clip.modeling_clip import _expand_mask

try:
from transformers.models.clip.modeling_clip import _expand_mask
except:
from transformers.models.clip.modeling_clip import _prepare_4d_attention_mask as _expand_mask

class FastComposerModel(nn.Module):
"""FastComposerModel is based on the StableDiffusion Model and the Clip
Expand Down

0 comments on commit 889fc96

Please sign in to comment.