Skip to content

Commit

Permalink
fix inference
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad committed Apr 24, 2024
1 parent 3091aa9 commit 1968221
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions amt/inference/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ def __init__(
]
)
self.ln = nn.LayerNorm(n_state)
self.output = nn.Linear(n_state, n_vocab, bias=False)
self.register_buffer("causal_mask", None, persistent=False)

def forward(
Expand All @@ -376,9 +377,7 @@ def forward(
)

x = self.ln(x)
logits = (
x @ torch.transpose(self.token_embedding.weight.to(x.dtype), 0, 1)
).float()
logits = self.output(x)

return logits

Expand Down

0 comments on commit 1968221

Please sign in to comment.