infgrad andrewqian123 commited on
Commit
221e305
1 Parent(s): d03be74

Making File Compatible With Environments That Do Not Have Flash Attention (#26)

Browse files

- Making File Compatible With Environments That Do Not Have Flash Attention (322f67256f88db7cab21c500c72a85858b0ae07e)


Co-authored-by: Andrew Qian <andrewqian123@users.noreply.huggingface.co>

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__)