From f1d76cc17bf48f5cb0810e588ebaaaf0849b739d Mon Sep 17 00:00:00 2001 From: zengyh1900 Date: Fri, 10 Nov 2023 13:39:37 +0800 Subject: [PATCH] fix lint --- mmagic/models/editors/fastcomposer/fastcomposer_util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mmagic/models/editors/fastcomposer/fastcomposer_util.py b/mmagic/models/editors/fastcomposer/fastcomposer_util.py index e6bf053f9..c134a7eb1 100644 --- a/mmagic/models/editors/fastcomposer/fastcomposer_util.py +++ b/mmagic/models/editors/fastcomposer/fastcomposer_util.py @@ -12,10 +12,13 @@ from transformers import (CLIPModel, CLIPPreTrainedModel, CLIPTextModel, CLIPVisionConfig, CLIPVisionModel) from transformers.modeling_outputs import BaseModelOutputWithPooling + 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 + 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