broccoli-ml 4.0.0__tar.gz → 4.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/PKG-INFO +1 -1
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/transformer.py +3 -1
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/pyproject.toml +1 -1
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/LICENSE +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/README.md +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/__init__.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/activation.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/cnn.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/linear.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/rope.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/tensor.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/utils.py +0 -0
- {broccoli_ml-4.0.0 → broccoli_ml-4.0.1}/broccoli/vit.py +0 -0
|
@@ -233,7 +233,7 @@ class MHAttention(nn.Module):
|
|
|
233
233
|
q,
|
|
234
234
|
k,
|
|
235
235
|
v,
|
|
236
|
-
dropout_p=self.dropout if self.training else 0.0,
|
|
236
|
+
dropout_p=self.dropout.p if self.training else 0.0,
|
|
237
237
|
softmax_scale=scaling_factor,
|
|
238
238
|
causal=self.causal,
|
|
239
239
|
)
|
|
@@ -257,6 +257,8 @@ class MHAttention(nn.Module):
|
|
|
257
257
|
|
|
258
258
|
qk_scores = F.softmax(qk_scores, dim=-1)
|
|
259
259
|
|
|
260
|
+
qk_scores = self.dropout(qk_scores)
|
|
261
|
+
|
|
260
262
|
output_with_heads = qk_scores @ v
|
|
261
263
|
|
|
262
264
|
output_without_heads = rearrange(output_with_heads, "b h t d -> b t (h d)")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|