d-Matrix
commited on
Update modeling_opt.py
Browse files- modeling_opt.py +5 -5
modeling_opt.py
CHANGED
|
@@ -21,15 +21,15 @@ import torch.utils.checkpoint
|
|
| 21 |
from torch import nn
|
| 22 |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
| 23 |
|
| 24 |
-
from
|
| 25 |
-
from
|
| 26 |
BaseModelOutputWithPast,
|
| 27 |
CausalLMOutputWithPast,
|
| 28 |
QuestionAnsweringModelOutput,
|
| 29 |
SequenceClassifierOutputWithPast,
|
| 30 |
)
|
| 31 |
-
from
|
| 32 |
-
from
|
| 33 |
add_code_sample_docstrings,
|
| 34 |
add_start_docstrings,
|
| 35 |
add_start_docstrings_to_model_forward,
|
|
@@ -37,7 +37,7 @@ from ...utils import (
|
|
| 37 |
replace_return_docstrings,
|
| 38 |
)
|
| 39 |
from .configuration_opt import OPTConfig
|
| 40 |
-
from
|
| 41 |
|
| 42 |
|
| 43 |
logger = logging.get_logger(__name__)
|
|
|
|
| 21 |
from torch import nn
|
| 22 |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
| 23 |
|
| 24 |
+
from transformers.activations import ACT2FN
|
| 25 |
+
from transformers.modeling_outputs import (
|
| 26 |
BaseModelOutputWithPast,
|
| 27 |
CausalLMOutputWithPast,
|
| 28 |
QuestionAnsweringModelOutput,
|
| 29 |
SequenceClassifierOutputWithPast,
|
| 30 |
)
|
| 31 |
+
from transformers.modeling_utils import PreTrainedModel
|
| 32 |
+
from transformers.utils import (
|
| 33 |
add_code_sample_docstrings,
|
| 34 |
add_start_docstrings,
|
| 35 |
add_start_docstrings_to_model_forward,
|
|
|
|
| 37 |
replace_return_docstrings,
|
| 38 |
)
|
| 39 |
from .configuration_opt import OPTConfig
|
| 40 |
+
from transformers.utils.model_parallel_utils import assert_device_map, get_device_map
|
| 41 |
|
| 42 |
|
| 43 |
logger = logging.get_logger(__name__)
|