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

Can current token see next token in encoder for code completion ? #5

Closed
mf1832146 opened this issue Mar 3, 2022 · 3 comments
Closed

Comments

@mf1832146
Copy link

Hello, I have not found there exists a mask matrix in encoder for code completion, so every node of ast will participate in self attention computation?

@jxzhn
Copy link

jxzhn commented Mar 8, 2022

I found it here (cc/main/src/model.py: line 181)

        w = w * b - INF * (1 - b)

where b is from lower triangular matrix bias defined on lines 77-79

        self.register_buffer(
            "bias", torch.tril(torch.ones(n_ctx, n_ctx)).view(1, 1, n_ctx, n_ctx)
        )

@mf1832146
Copy link
Author

@jxzhn Thanks, it looks right!!!

@serjtroshin
Copy link
Collaborator

@jxzhn thanks for helping, I am closing this issue

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

3 participants