Skip to content

Commit

Permalink
fix masking issue, thanks to @dhansmair
Browse files Browse the repository at this point in the history
  • Loading branch information
lucidrains committed Oct 18, 2022
1 parent 749f824 commit 10913ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flamingo_pytorch/flamingo_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def forward(
# any text without a preceding media needs to have attention zeroed out
text_without_media_mask = text_time == 0
text_without_media_mask = rearrange(text_without_media_mask, 'b i -> b 1 i 1')
attn.masked_fill(text_without_media_mask, 0.)
attn = attn.masked_fill(text_without_media_mask, 0.)

out = einsum('... i j, ... j d -> ... i d', attn, v)
out = rearrange(out, 'b h n d -> b n (h d)')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'flamingo-pytorch',
packages = find_packages(exclude=[]),
version = '0.1.1',
version = '0.1.2',
license='MIT',
description = 'Flamingo - Pytorch',
author = 'Phil Wang',
Expand Down

0 comments on commit 10913ab

Please sign in to comment.