Making File Compatible With Environments That Do Not Have Flash Attention

#26
Files changed (1) hide show
  1. modeling_qwen.py +6 -4
modeling_qwen.py CHANGED
@@ -46,11 +46,13 @@ from transformers.utils import (
46
  )
47
 
48
 
49
- if is_flash_attn_2_available():
50
- from flash_attn import flash_attn_func, flash_attn_varlen_func
51
- from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
52
 
53
- _flash_supports_window_size = "window_size" in list(inspect.signature(flash_attn_func).parameters)
 
 
54
 
55
 
56
  logger = logging.get_logger(__name__)
 
46
  )
47
 
48
 
49
+ # if is_flash_attn_2_available():
50
+ # from flash_attn import flash_attn_func, flash_attn_varlen_func
51
+ # from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
52
 
53
+ # _flash_supports_window_size = "window_size" in list(inspect.signature(flash_attn_func).parameters)
54
+
55
+ # REMOVE THE CODE ABOVE SHOULD ALLOW FOR RUNNING OF THIS MODEL WITHOUT FLASH ATTENTION SUPPORT.
56
 
57
 
58
  logger = logging.get_logger(__name__)