PyTorch
Nebulon33 commited on
Commit
e645ff1
·
verified ·
1 Parent(s): ee5c4ad

Fixed a typo

Browse files
Files changed (1) hide show
  1. adria.py +2 -2
adria.py CHANGED
@@ -142,7 +142,7 @@ class MultiHeadAttention(nn.Module):
142
  self.c_attention = nn.Linear(dim_model, 3 * dim_model)
143
  self.c_projection = nn.Linear(dim_model, dim_model)
144
 
145
- # Casual mask registered for attention
146
  self.register_buffer("mask", torch.tril(torch.ones((max_len, max_len))).view(1, 1, max_len, max_len))
147
 
148
  def dot_product_attention(self, q, k, v, mask = None):
@@ -207,7 +207,7 @@ class MultiHeadAttention(nn.Module):
207
 
208
  current_kv = (k, v)
209
 
210
- # Casual masking is now skipped when using cache since we only attend to valid past positions
211
  attention = (torch.matmul(q, k.transpose(-2, -1))) * (1.0 / math.sqrt(self.dim_k))
212
 
213
  if kv_cache is None:
 
142
  self.c_attention = nn.Linear(dim_model, 3 * dim_model)
143
  self.c_projection = nn.Linear(dim_model, dim_model)
144
 
145
+ # Causal mask registered for attention
146
  self.register_buffer("mask", torch.tril(torch.ones((max_len, max_len))).view(1, 1, max_len, max_len))
147
 
148
  def dot_product_attention(self, q, k, v, mask = None):
 
207
 
208
  current_kv = (k, v)
209
 
210
+ # Causal masking is now skipped when using cache since we only attend to valid past positions
211
  attention = (torch.matmul(q, k.transpose(-2, -1))) * (1.0 / math.sqrt(self.dim_k))
212
 
213
  if kv_cache is None: