Skip to content

Commit 9bf1f0f

Browse files
committed
fix mask for full attention so that last text token can actually predict the first image token
1 parent 282ef30 commit 9bf1f0f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dalle_pytorch/attention.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def forward(self, x, mask = None):
4848
mask_value = max_neg_value(dots)
4949

5050
if exists(mask):
51-
mask = rearrange(mask, 'b i -> b () i ()') * rearrange(mask, 'b j -> b () () j')
51+
mask = rearrange(mask, 'b j -> b () () j')
5252
dots.masked_fill_(~mask, mask_value)
5353
del mask
5454

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name = 'dalle-pytorch',
55
packages = find_packages(),
6-
version = '0.0.60',
6+
version = '0.0.61',
77
license='MIT',
88
description = 'DALL-E - Pytorch',
99
author = 'Phil Wang',

0 commit comments

Comments
 (0)