Skip to content

Commit a90271b

Browse files
LoserCheemsCopilot
andauthored
Update examples/modeling/modeling_doge.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e8d38d0 commit a90271b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/modeling/modeling_doge.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@
4343
from transformers.utils.generic import OutputRecorder, check_model_inputs
4444
from .configuration_doge import DogeConfig
4545

46-
from flash_dmattn import flash_dmattn_func_auto
46+
try:
47+
from flash_dmattn import flash_dmattn_func_auto
48+
except ImportError:
49+
def flash_dmattn_func_auto(*args, **kwargs):
50+
raise ImportError(
51+
"flash_dmattn is not installed. Please install it to use flash_dmattn_func_auto. "
52+
"You can install it with `pip install flash-dmattn` or consult the documentation."
53+
)
4754

4855
if is_torch_flex_attn_available():
4956
from torch.nn.attention.flex_attention import BlockMask

0 commit comments

Comments
 (0)