remove import/call to code no longer in latest transformers

#3
by winglian - opened
Files changed (1) hide show
  1. modeling_deepseek.py +1 -7
modeling_deepseek.py CHANGED
@@ -42,10 +42,7 @@ from transformers.modeling_outputs import (
42
  SequenceClassifierOutputWithPast,
43
  )
44
  from transformers.modeling_utils import PreTrainedModel
45
- from transformers.pytorch_utils import (
46
- ALL_LAYERNORM_LAYERS,
47
- is_torch_greater_or_equal_than_1_13,
48
- )
49
  from transformers.utils import (
50
  add_start_docstrings,
51
  add_start_docstrings_to_model_forward,
@@ -67,9 +64,6 @@ if is_flash_attn_2_available():
67
  # This makes `_prepare_4d_causal_attention_mask` a leaf function in the FX graph.
68
  # It means that the function will not be traced through and simply appear as a node in the graph.
69
  if is_torch_fx_available():
70
- if not is_torch_greater_or_equal_than_1_13:
71
- import torch.fx
72
-
73
  _prepare_4d_causal_attention_mask = torch.fx.wrap(_prepare_4d_causal_attention_mask)
74
 
75
 
 
42
  SequenceClassifierOutputWithPast,
43
  )
44
  from transformers.modeling_utils import PreTrainedModel
45
+ from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS
 
 
 
46
  from transformers.utils import (
47
  add_start_docstrings,
48
  add_start_docstrings_to_model_forward,
 
64
  # This makes `_prepare_4d_causal_attention_mask` a leaf function in the FX graph.
65
  # It means that the function will not be traced through and simply appear as a node in the graph.
66
  if is_torch_fx_available():
 
 
 
67
  _prepare_4d_causal_attention_mask = torch.fx.wrap(_prepare_4d_causal_attention_mask)
68
 
69