You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TransformerBlock instantiates CrossAttentionBlock even when with_cross_attention=False #8845
Hi @AhmedZaalouk122576 , I've submitted a fix for this in #8860. It wraps the cross-attention layer creation in a conditional so CrossAttentionBlock and its LayerNorm are only instantiated when with_cross_attention=True. Happy to adjust if needed.
Activity
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
AlexanderSanin commentedon May 18, 2026
Hi @AhmedZaalouk122576 , I've submitted a fix for this in #8860. It wraps the cross-attention layer creation in a conditional so
CrossAttentionBlockand itsLayerNormare only instantiated whenwith_cross_attention=True. Happy to adjust if needed.fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=True
fix: only instantiate CrossAttentionBlock when with_cross_attention=T…