SaBra34 commited on
Commit
baa6a5a
·
verified ·
1 Parent(s): e0e6457

Update video_depth_anything/motion_module/attention.py

Browse files
video_depth_anything/motion_module/attention.py CHANGED
@@ -17,8 +17,14 @@ import torch
17
  import torch.nn.functional as F
18
  from torch import nn
19
 
20
- import xformers
21
- import xformers.ops
 
 
 
 
 
 
22
 
23
 
24
  class CrossAttention(nn.Module):
 
17
  import torch.nn.functional as F
18
  from torch import nn
19
 
20
+ try:
21
+ import xformers
22
+ import xformers.ops
23
+ XFORMERS_AVAILABLE = True
24
+ except ImportError:
25
+ xformers = None
26
+ XFORMERS_AVAILABLE = False
27
+ print("xFormers not available - using standard PyTorch attention")
28
 
29
 
30
  class CrossAttention(nn.Module):