reed commited on
Commit
824bd56
1 Parent(s): 0e24941
Files changed (1) hide show
  1. modeling_yi.py +3 -6
modeling_yi.py CHANGED
@@ -26,16 +26,13 @@ from .configuration_yi import YiConfig
26
 
27
  is_flash_attn_available = True
28
  try:
29
- from flash_attn import flash_attn_func
30
- except Exception:
31
- is_flash_attn_available = False
32
-
33
- if is_flash_attn_available:
34
- from flash_attn import __version__
35
 
36
  assert version.parse(__version__) >= version.parse(
37
  "2.3.0"
38
  ), "please update your flash_attn version (>= 2.3.0)"
 
 
39
 
40
  logger = logging.get_logger(__name__)
41
 
 
26
 
27
  is_flash_attn_available = True
28
  try:
29
+ from flash_attn import flash_attn_func, __version__
 
 
 
 
 
30
 
31
  assert version.parse(__version__) >= version.parse(
32
  "2.3.0"
33
  ), "please update your flash_attn version (>= 2.3.0)"
34
+ except ModuleNotFoundError:
35
+ is_flash_attn_available = False
36
 
37
  logger = logging.get_logger(__name__)
38