diff --git a/model/model_minimind.py b/model/model_minimind.py index 4b43610..b76b993 100644 --- a/model/model_minimind.py +++ b/model/model_minimind.py @@ -141,6 +141,7 @@ class Attention(nn.Module): self.resid_dropout = nn.Dropout(args.dropout) self.dropout = args.dropout self.flash = hasattr(torch.nn.functional, 'scaled_dot_product_attention') and args.flash_attn + self.flash = hasattr(torch.nn.functional, 'scaled_dot_product_attention') and args.flash_attn and torch.cuda.is_available() # print("WARNING: using slow attention. Flash Attention requires PyTorch >= 2.0") def forward(self,