The _expand_mask function that is imported from transformers.models.clip.modeling_clip in models/blip_diffusion_models/modeling_ctx_clip.py does not exist anymore since this commit that is part of release v4.35.0.
It has since been replaced with transformers.modeling_attn_mask_utils._prepare_4d_attention_mask.
There is another closed issue ( #571 ) in this repo regarding this error, but there is not enough information to tell whether using transformers>=4.35 was the cause of that one too.