-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Labels
Good second issuebugSomething isn't workingSomething isn't workingcontributions-welcomehelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
transformers added sdpa and FA2 for CLIP model in huggingface/transformers#31940. It now initializes the vision model like https://github.com/huggingface/transformers/blob/85a1269e19af022e04bc2aad82572cd5a9e8cdd9/src/transformers/models/clip/modeling_clip.py#L1143.
However, StableDiffusionSafetyChecker uses
| self.vision_model = CLIPVisionModel(config.vision_config) |
Reproduction
from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker
model = StableDiffusionSafetyChecker.from_pretrained(
"runwayml/stable-diffusion-v1-5",
subfolder="safety_checker",
attn_implementation="eager"
)
print(type(model.vision_model.vision_model.encoder.layers[0].self_attn))Expected transformers.models.clip.modeling_clip.CLIPAttention but got transformers.models.clip.modeling_clip.CLIPSdpaAttention.
Logs
No response
System Info
diffusers 0.29.0
transformers 4.43.1
Who can help?
Metadata
Metadata
Assignees
Labels
Good second issuebugSomething isn't workingSomething isn't workingcontributions-welcomehelp wantedExtra attention is neededExtra attention is needed