mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
Improve KV cache code for torch.compile (#705)
* Improve KV cache code for torch.compile * cleanup * cleanup
This commit is contained in:
committed by
GitHub
parent
6522be94be
commit
81eda38d3b
@@ -27,7 +27,7 @@ class MultiHeadAttention(nn.Module):
|
||||
self.dropout = nn.Dropout(dropout)
|
||||
self.register_buffer(
|
||||
"mask",
|
||||
torch.triu(torch.ones(context_length, context_length),diagonal=1),
|
||||
torch.triu(torch.ones(context_length, context_length), diagonal=1),
|
||||
persistent=False
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user