Crystalcareai
commited on
Update modeling_gemmoe.py
Browse files- modeling_gemmoe.py +8 -8
modeling_gemmoe.py
CHANGED
@@ -25,15 +25,15 @@ import torch.utils.checkpoint
|
|
25 |
from torch import nn
|
26 |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
27 |
|
28 |
-
from
|
29 |
-
from
|
30 |
-
from
|
31 |
_prepare_4d_causal_attention_mask,
|
32 |
)
|
33 |
-
from
|
34 |
-
from
|
35 |
-
from
|
36 |
-
from
|
37 |
add_start_docstrings,
|
38 |
add_start_docstrings_to_model_forward,
|
39 |
is_flash_attn_2_available,
|
@@ -41,7 +41,7 @@ from ...utils import (
|
|
41 |
logging,
|
42 |
replace_return_docstrings,
|
43 |
)
|
44 |
-
from
|
45 |
from .configuration_gemmoe import GemmoeConfig
|
46 |
|
47 |
from math import sqrt as math_sqrt
|
|
|
25 |
from torch import nn
|
26 |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
27 |
|
28 |
+
from transformers.activations import ACT2FN
|
29 |
+
from transformers.cache_utils import Cache, DynamicCache, StaticCache
|
30 |
+
from transformers.modeling_attn_mask_utils import (
|
31 |
_prepare_4d_causal_attention_mask,
|
32 |
)
|
33 |
+
from transformers.modeling_outputs import SequenceClassifierOutputWithPast, MoeModelOutputWithPast, MoeCausalLMOutputWithPast
|
34 |
+
from transformers.modeling_utils import PreTrainedModel
|
35 |
+
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS, is_torch_greater_or_equal_than_1_13
|
36 |
+
from transformers.utils import (
|
37 |
add_start_docstrings,
|
38 |
add_start_docstrings_to_model_forward,
|
39 |
is_flash_attn_2_available,
|
|
|
41 |
logging,
|
42 |
replace_return_docstrings,
|
43 |
)
|
44 |
+
from transformers.utils.import_utils import is_torch_fx_available
|
45 |
from .configuration_gemmoe import GemmoeConfig
|
46 |
|
47 |
from math import sqrt as math_sqrt
|