Upload modeling_vit.py
Browse files- modeling_vit.py +3 -2
modeling_vit.py
CHANGED
|
@@ -234,10 +234,11 @@ class ViTSelfAttention(nn.Module):
|
|
| 234 |
ssm_eps=None,
|
| 235 |
tau=None,
|
| 236 |
skip_attn=False,
|
| 237 |
-
attn_gate_type=AttentionGateType.
|
| 238 |
-
attn_gate_init=
|
| 239 |
attn_gate_mlp=False,
|
| 240 |
attn_gate_mlp2=False,
|
|
|
|
| 241 |
attn_gate_linear_all_features=False) -> None:
|
| 242 |
super().__init__()
|
| 243 |
if config.hidden_size % config.num_attention_heads != 0 and not hasattr(config, "embedding_size"):
|
|
|
|
| 234 |
ssm_eps=None,
|
| 235 |
tau=None,
|
| 236 |
skip_attn=False,
|
| 237 |
+
attn_gate_type=AttentionGateType.conditional_per_token,
|
| 238 |
+
attn_gate_init=0.25,
|
| 239 |
attn_gate_mlp=False,
|
| 240 |
attn_gate_mlp2=False,
|
| 241 |
+
max_seq_length=None,
|
| 242 |
attn_gate_linear_all_features=False) -> None:
|
| 243 |
super().__init__()
|
| 244 |
if config.hidden_size % config.num_attention_heads != 0 and not hasattr(config, "embedding_size"):
|