We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For RoPEMaskedAttentionHead,
if return_attn_weights: attn_mask = torch.tril(torch.ones((m,m)), diagonal=0) attn_weights = torch.bmm(q_rotated, k_rotated.transpose(1,2)) / np.sqrt(d) + attn_mask attn_weights = F.softmax(attn_weights, dim=-1) return activations, attn_weights return activations
I think it should be
if return_attn_weights: attn_mask = torch.tril(torch.ones((m,m)),diagonal=0) attn_mask = torch.where(attn_mask==1,torch.tensor(0),torch.tensor(float('-inf'))) attn_weights = torch.bmm(q_rotated,k_rotated.transpose(1,2)) / np.sqrt(d) + attn_mask attn_weights = F.softmax(attn_weights,dim=-1) return activations,attn_weights return activations
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For RoPEMaskedAttentionHead,
I think it should be
The text was updated successfully, but these errors were encountered: