Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

are attention_masks zero tensors? #37

Open
GinnyXiao opened this issue Nov 6, 2024 · 2 comments
Open

are attention_masks zero tensors? #37

GinnyXiao opened this issue Nov 6, 2024 · 2 comments

Comments

@GinnyXiao
Copy link

Dear authors,

I was wondering during draining what attention masks were you using? In your inference code I saw you generated these masks by setting them to zero tensors text_padding_position=torch.zeros_like(input_ids). Was it the same for training? Thank you so much!

def forward(...):
    ...
    output = self.mm_extractor.beit3(
            visual_tokens=images_evf, 
            textual_tokens=input_ids, 
            text_padding_position=~attention_masks
            )
    ...
@CoderZhangYx
Copy link
Collaborator

We place no attention at padding tokens. Our dataset code may produce the attention_mask. Simply using that is okay.

@GinnyXiao
Copy link
Author

Got it, thank you soooo much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants