|
14 | 14 | # limitations under the License. |
15 | 15 |
|
16 | 16 | from typing import Optional, Tuple |
17 | | -from paddle import Tensor |
| 17 | + |
18 | 18 | import paddle |
19 | 19 | import paddle.nn as nn |
| 20 | +from paddle import Tensor |
| 21 | +from paddle.common_ops_import import convert_dtype |
20 | 22 |
|
21 | 23 | from .. import PretrainedModel, register_base_model |
22 | | -from ..albert.modeling import get_activation |
| 24 | +from ..activations import get_activation |
23 | 25 | from ..model_outputs import ( |
24 | 26 | BaseModelOutputWithPoolingAndCrossAttentions, |
| 27 | + CausalLMOutputWithCrossAttentions, |
| 28 | + MaskedLMOutput, |
| 29 | + MultipleChoiceModelOutput, |
| 30 | + QuestionAnsweringModelOutput, |
25 | 31 | SequenceClassifierOutput, |
26 | 32 | TokenClassifierOutput, |
27 | | - QuestionAnsweringModelOutput, |
28 | | - MultipleChoiceModelOutput, |
29 | | - MaskedLMOutput, |
30 | | - CausalLMOutputWithCrossAttentions, |
31 | 33 | tuple_output, |
32 | 34 | ) |
33 | | -from paddle.common_ops_import import convert_dtype |
34 | 35 |
|
35 | 36 | __all__ = [ |
36 | 37 | "RoFormerModel", |
@@ -712,18 +713,6 @@ def forward( |
712 | 713 | attentions=encoder_outputs.attentions, |
713 | 714 | ) |
714 | 715 |
|
715 | | - def get_input_embeddings(self) -> nn.Embedding: |
716 | | - return self.embeddings.word_embeddings |
717 | | - |
718 | | - def set_input_embeddings(self, embedding: nn.Embedding): |
719 | | - self.embeddings.word_embeddings = embedding |
720 | | - |
721 | | - def get_input_embeddings(self) -> nn.Embedding: |
722 | | - return self.embeddings.word_embeddings |
723 | | - |
724 | | - def set_input_embeddings(self, embedding: nn.Embedding): |
725 | | - self.embeddings.word_embeddings = embedding |
726 | | - |
727 | 716 |
|
728 | 717 | class RoFormerForQuestionAnswering(RoFormerPretrainedModel): |
729 | 718 | r""" |
|
0 commit comments