Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a5737779
Unverified
Commit
a5737779
authored
Aug 24, 2020
by
Sylvain Gugger
Committed by
GitHub
Aug 24, 2020
Browse files
Update repo to isort v5 (#6686)
* Run new isort * More changes * Update CI, CONTRIBUTING and benchmarks
parent
d329c9b0
Changes
89
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
92 additions
and
76 deletions
+92
-76
tests/test_modeling_roberta.py
tests/test_modeling_roberta.py
+7
-3
tests/test_modeling_t5.py
tests/test_modeling_t5.py
+2
-1
tests/test_modeling_tf_albert.py
tests/test_modeling_tf_albert.py
+5
-4
tests/test_modeling_tf_auto.py
tests/test_modeling_tf_auto.py
+16
-16
tests/test_modeling_tf_bert.py
tests/test_modeling_tf_bert.py
+5
-4
tests/test_modeling_tf_camembert.py
tests/test_modeling_tf_camembert.py
+2
-1
tests/test_modeling_tf_common.py
tests/test_modeling_tf_common.py
+8
-7
tests/test_modeling_tf_ctrl.py
tests/test_modeling_tf_ctrl.py
+2
-1
tests/test_modeling_tf_distilbert.py
tests/test_modeling_tf_distilbert.py
+4
-3
tests/test_modeling_tf_electra.py
tests/test_modeling_tf_electra.py
+2
-2
tests/test_modeling_tf_flaubert.py
tests/test_modeling_tf_flaubert.py
+6
-6
tests/test_modeling_tf_gpt2.py
tests/test_modeling_tf_gpt2.py
+4
-3
tests/test_modeling_tf_longformer.py
tests/test_modeling_tf_longformer.py
+2
-1
tests/test_modeling_tf_mobilebert.py
tests/test_modeling_tf_mobilebert.py
+4
-3
tests/test_modeling_tf_openai.py
tests/test_modeling_tf_openai.py
+4
-3
tests/test_modeling_tf_roberta.py
tests/test_modeling_tf_roberta.py
+6
-5
tests/test_modeling_tf_t5.py
tests/test_modeling_tf_t5.py
+2
-1
tests/test_modeling_tf_transfo_xl.py
tests/test_modeling_tf_transfo_xl.py
+2
-5
tests/test_modeling_tf_xlm.py
tests/test_modeling_tf_xlm.py
+7
-6
tests/test_modeling_tf_xlm_roberta.py
tests/test_modeling_tf_xlm_roberta.py
+2
-1
No files found.
tests/test_modeling_roberta.py
View file @
a5737779
...
@@ -25,18 +25,22 @@ from .test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, r
...
@@ -25,18 +25,22 @@ from .test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, r
if
is_torch_available
():
if
is_torch_available
():
import
torch
import
torch
from
transformers
import
(
from
transformers
import
(
RobertaConfig
,
RobertaConfig
,
RobertaModel
,
RobertaForCausalLM
,
RobertaForCausalLM
,
RobertaForMaskedLM
,
RobertaForMaskedLM
,
RobertaForMultipleChoice
,
RobertaForMultipleChoice
,
RobertaForQuestionAnswering
,
RobertaForQuestionAnswering
,
RobertaForSequenceClassification
,
RobertaForSequenceClassification
,
RobertaForTokenClassification
,
RobertaForTokenClassification
,
RobertaModel
,
)
from
transformers.modeling_roberta
import
(
ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST
,
RobertaEmbeddings
,
create_position_ids_from_input_ids
,
)
)
from
transformers.modeling_roberta
import
RobertaEmbeddings
,
create_position_ids_from_input_ids
from
transformers.modeling_roberta
import
ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST
class
RobertaModelTester
:
class
RobertaModelTester
:
...
...
tests/test_modeling_t5.py
View file @
a5737779
...
@@ -28,7 +28,8 @@ from .test_modeling_common import ModelTesterMixin, ids_tensor
...
@@ -28,7 +28,8 @@ from .test_modeling_common import ModelTesterMixin, ids_tensor
if
is_torch_available
():
if
is_torch_available
():
import
torch
import
torch
from
transformers
import
T5Config
,
T5Model
,
T5ForConditionalGeneration
from
transformers
import
T5Config
,
T5ForConditionalGeneration
,
T5Model
from
transformers.modeling_t5
import
T5_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_t5
import
T5_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.tokenization_t5
import
T5Tokenizer
from
transformers.tokenization_t5
import
T5Tokenizer
...
...
tests/test_modeling_tf_albert.py
View file @
a5737779
...
@@ -25,15 +25,16 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,15 +25,16 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_albert
import
(
from
transformers.modeling_tf_albert
import
(
TFAlbertModel
,
TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFAlbertForPreTraining
,
TFAlbertForMaskedLM
,
TFAlbertForMaskedLM
,
TFAlbertForMultipleChoice
,
TFAlbertForMultipleChoice
,
TFAlbertFor
SequenceClassification
,
TFAlbertFor
PreTraining
,
TFAlbertForQuestionAnswering
,
TFAlbertForQuestionAnswering
,
TFAlbertForSequenceClassification
,
TFAlbertForTokenClassification
,
TFAlbertForTokenClassification
,
TF
_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST
,
TF
AlbertModel
,
)
)
...
...
tests/test_modeling_tf_auto.py
View file @
a5737779
...
@@ -27,36 +27,36 @@ if is_tf_available():
...
@@ -27,36 +27,36 @@ if is_tf_available():
GPT2Config
,
GPT2Config
,
T5Config
,
T5Config
,
TFAutoModel
,
TFAutoModel
,
TFBertModel
,
TFAutoModelForCausalLM
,
TFAutoModelForMaskedLM
,
TFAutoModelForPreTraining
,
TFAutoModelForPreTraining
,
TFBertForPreTraining
,
TFAutoModelForQuestionAnswering
,
TFAutoModelForSeq2SeqLM
,
TFAutoModelForSequenceClassification
,
TFAutoModelWithLMHead
,
TFAutoModelWithLMHead
,
TFBertForMaskedLM
,
TFBertForMaskedLM
,
TFRobertaForMaskedLM
,
TFBertForPreTraining
,
TFAutoModelForSequenceClassification
,
TFBertForSequenceClassification
,
TFAutoModelForQuestionAnswering
,
TFBertForQuestionAnswering
,
TFBertForQuestionAnswering
,
TFAutoModelForCausalLM
,
TFBertForSequenceClassification
,
TFBertModel
,
TFGPT2LMHeadModel
,
TFGPT2LMHeadModel
,
TFAutoModelForMaskedLM
,
TFRobertaForMaskedLM
,
TFAutoModelForSeq2SeqLM
,
TFT5ForConditionalGeneration
,
TFT5ForConditionalGeneration
,
)
)
from
transformers.modeling_tf_bert
import
TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_tf_gpt2
import
TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_tf_t5
import
TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_tf_auto
import
(
from
transformers.modeling_tf_auto
import
(
TF_MODEL_MAPPING
,
TF_MODEL_FOR_CAUSAL_LM_MAPPING
,
TF_MODEL_FOR_MASKED_LM_MAPPING
,
TF_MODEL_FOR_PRETRAINING_MAPPING
,
TF_MODEL_FOR_PRETRAINING_MAPPING
,
TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING
,
TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING
,
TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
,
TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
,
TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
,
TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
,
TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
,
TF_MODEL_MAPPING
,
TF_MODEL_WITH_LM_HEAD_MAPPING
,
TF_MODEL_WITH_LM_HEAD_MAPPING
,
TF_MODEL_FOR_CAUSAL_LM_MAPPING
,
TF_MODEL_FOR_MASKED_LM_MAPPING
,
TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
,
)
)
from
transformers.modeling_tf_bert
import
TF_BERT_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_tf_gpt2
import
TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_tf_t5
import
TF_T5_PRETRAINED_MODEL_ARCHIVE_LIST
@
require_tf
@
require_tf
...
...
tests/test_modeling_tf_bert.py
View file @
a5737779
...
@@ -25,16 +25,17 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,16 +25,17 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_bert
import
(
from
transformers.modeling_tf_bert
import
(
TFBertModel
,
TFBertLMHeadModel
,
TFBertForMaskedLM
,
TFBertForMaskedLM
,
TFBertForMultipleChoice
,
TFBertForNextSentencePrediction
,
TFBertForNextSentencePrediction
,
TFBertForPreTraining
,
TFBertForPreTraining
,
TFBertForQuestionAnswering
,
TFBertForSequenceClassification
,
TFBertForSequenceClassification
,
TFBertForMultipleChoice
,
TFBertForTokenClassification
,
TFBertForTokenClassification
,
TFBertForQuestionAnswering
,
TFBertLMHeadModel
,
TFBertModel
,
)
)
...
...
tests/test_modeling_tf_camembert.py
View file @
a5737779
...
@@ -20,8 +20,9 @@ from transformers.testing_utils import require_tf, slow
...
@@ -20,8 +20,9 @@ from transformers.testing_utils import require_tf, slow
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
numpy
as
np
import
numpy
as
np
import
tensorflow
as
tf
from
transformers
import
TFCamembertModel
from
transformers
import
TFCamembertModel
...
...
tests/test_modeling_tf_common.py
View file @
a5737779
...
@@ -28,20 +28,20 @@ from transformers.testing_utils import _tf_gpu_memory_limit, require_tf, slow
...
@@ -28,20 +28,20 @@ from transformers.testing_utils import _tf_gpu_memory_limit, require_tf, slow
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
numpy
as
np
import
numpy
as
np
import
tensorflow
as
tf
from
transformers
import
(
from
transformers
import
(
tf_top_k_top_p_filtering
,
TF_MODEL_FOR_CAUSAL_LM_MAPPING
,
TFAdaptiveEmbedding
,
TF_MODEL_FOR_MASKED_LM_MAPPING
,
TFSharedEmbeddings
,
TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING
,
TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING
,
TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING
,
TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING
,
TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
,
TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
,
TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
,
TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
,
TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
,
TF
_MODEL_FOR_CAUSAL_LM_MAPPING
,
TF
AdaptiveEmbedding
,
TF
_MODEL_FOR_MASKED_LM_MAPPING
,
TF
SharedEmbeddings
,
TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
,
tf_top_k_top_p_filtering
,
)
)
if
_tf_gpu_memory_limit
is
not
None
:
if
_tf_gpu_memory_limit
is
not
None
:
...
@@ -260,6 +260,7 @@ class TFModelTesterMixin:
...
@@ -260,6 +260,7 @@ class TFModelTesterMixin:
return
return
import
torch
import
torch
import
transformers
import
transformers
config
,
inputs_dict
=
self
.
model_tester
.
prepare_config_and_inputs_for_common
()
config
,
inputs_dict
=
self
.
model_tester
.
prepare_config_and_inputs_for_common
()
...
...
tests/test_modeling_tf_ctrl.py
View file @
a5737779
...
@@ -25,7 +25,8 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,7 +25,8 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_ctrl
import
TFCTRLModel
,
TFCTRLLMHeadModel
,
TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST
from
transformers.modeling_tf_ctrl
import
TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFCTRLLMHeadModel
,
TFCTRLModel
class
TFCTRLModelTester
(
object
):
class
TFCTRLModelTester
(
object
):
...
...
tests/test_modeling_tf_distilbert.py
View file @
a5737779
...
@@ -25,14 +25,15 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,14 +25,15 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_distilbert
import
(
from
transformers.modeling_tf_distilbert
import
(
TF
DistilBertModel
,
TF
_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFDistilBertForMaskedLM
,
TFDistilBertForMaskedLM
,
TFDistilBertForMultipleChoice
,
TFDistilBertForQuestionAnswering
,
TFDistilBertForQuestionAnswering
,
TFDistilBertForSequenceClassification
,
TFDistilBertForSequenceClassification
,
TFDistilBertForTokenClassification
,
TFDistilBertForTokenClassification
,
TFDistilBertForMultipleChoice
,
TFDistilBertModel
,
TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST
,
)
)
...
...
tests/test_modeling_tf_electra.py
View file @
a5737779
...
@@ -27,13 +27,13 @@ if is_tf_available():
...
@@ -27,13 +27,13 @@ if is_tf_available():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_electra
import
(
from
transformers.modeling_tf_electra
import
(
TFElectraModel
,
TFElectraForMaskedLM
,
TFElectraForMaskedLM
,
TFElectraForMultipleChoice
,
TFElectraForMultipleChoice
,
TFElectraForPreTraining
,
TFElectraForPreTraining
,
TFElectraForQuestionAnswering
,
TFElectraForSequenceClassification
,
TFElectraForSequenceClassification
,
TFElectraForTokenClassification
,
TFElectraForTokenClassification
,
TFElectra
ForQuestionAnswering
,
TFElectra
Model
,
)
)
...
...
tests/test_modeling_tf_flaubert.py
View file @
a5737779
...
@@ -23,18 +23,18 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -23,18 +23,18 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
numpy
as
np
import
numpy
as
np
import
tensorflow
as
tf
from
transformers
import
(
from
transformers
import
(
TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST
,
FlaubertConfig
,
FlaubertConfig
,
TFFlaubertModel
,
TFFlaubertForMultipleChoice
,
TFFlaubertWithLMHeadModel
,
TFFlaubertForSequenceClassification
,
TFFlaubertForQuestionAnsweringSimple
,
TFFlaubertForQuestionAnsweringSimple
,
TFFlaubertForSequenceClassification
,
TFFlaubertForTokenClassification
,
TFFlaubertForTokenClassification
,
TFFlaubert
ForMultipleChoice
,
TFFlaubert
Model
,
TF
_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST
,
TF
FlaubertWithLMHeadModel
,
)
)
...
...
tests/test_modeling_tf_gpt2.py
View file @
a5737779
...
@@ -25,11 +25,12 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,11 +25,12 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_gpt2
import
(
from
transformers.modeling_tf_gpt2
import
(
TFGPT2Model
,
TFGPT2LMHeadModel
,
TFGPT2DoubleHeadsModel
,
TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST
,
TF_GPT2_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFGPT2DoubleHeadsModel
,
TFGPT2LMHeadModel
,
TFGPT2Model
,
shape_list
,
shape_list
,
)
)
...
...
tests/test_modeling_tf_longformer.py
View file @
a5737779
...
@@ -25,11 +25,12 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,11 +25,12 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers
import
(
from
transformers
import
(
LongformerConfig
,
LongformerConfig
,
TFLongformerModel
,
TFLongformerForMaskedLM
,
TFLongformerForMaskedLM
,
TFLongformerForQuestionAnswering
,
TFLongformerForQuestionAnswering
,
TFLongformerModel
,
TFLongformerSelfAttention
,
TFLongformerSelfAttention
,
)
)
...
...
tests/test_modeling_tf_mobilebert.py
View file @
a5737779
...
@@ -25,15 +25,16 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,15 +25,16 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_mobilebert
import
(
from
transformers.modeling_tf_mobilebert
import
(
TFMobileBertModel
,
TFMobileBertForMaskedLM
,
TFMobileBertForMaskedLM
,
TFMobileBertForMultipleChoice
,
TFMobileBertForNextSentencePrediction
,
TFMobileBertForNextSentencePrediction
,
TFMobileBertForPreTraining
,
TFMobileBertForPreTraining
,
TFMobileBertForQuestionAnswering
,
TFMobileBertForSequenceClassification
,
TFMobileBertForSequenceClassification
,
TFMobileBertForMultipleChoice
,
TFMobileBertForTokenClassification
,
TFMobileBertForTokenClassification
,
TFMobileBert
ForQuestionAnswering
,
TFMobileBert
Model
,
)
)
...
...
tests/test_modeling_tf_openai.py
View file @
a5737779
...
@@ -25,11 +25,12 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,11 +25,12 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers.modeling_tf_openai
import
(
from
transformers.modeling_tf_openai
import
(
TFOpenAIGPTModel
,
TFOpenAIGPTLMHeadModel
,
TFOpenAIGPTDoubleHeadsModel
,
TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST
,
TF_OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFOpenAIGPTDoubleHeadsModel
,
TFOpenAIGPTLMHeadModel
,
TFOpenAIGPTModel
,
)
)
...
...
tests/test_modeling_tf_roberta.py
View file @
a5737779
...
@@ -24,16 +24,17 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -24,16 +24,17 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
numpy
import
numpy
import
tensorflow
as
tf
from
transformers.modeling_tf_roberta
import
(
from
transformers.modeling_tf_roberta
import
(
TF
RobertaModel
,
TF
_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFRobertaForMaskedLM
,
TFRobertaForMaskedLM
,
TFRobertaForMultipleChoice
,
TFRobertaForQuestionAnswering
,
TFRobertaForSequenceClassification
,
TFRobertaForSequenceClassification
,
TFRobertaForTokenClassification
,
TFRobertaForTokenClassification
,
TFRobertaForQuestionAnswering
,
TFRobertaModel
,
TFRobertaForMultipleChoice
,
TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST
,
)
)
...
...
tests/test_modeling_tf_t5.py
View file @
a5737779
...
@@ -26,7 +26,8 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -26,7 +26,8 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers
import
TFT5Model
,
TFT5ForConditionalGeneration
,
T5Tokenizer
from
transformers
import
T5Tokenizer
,
TFT5ForConditionalGeneration
,
TFT5Model
class
TFT5ModelTester
:
class
TFT5ModelTester
:
...
...
tests/test_modeling_tf_transfo_xl.py
View file @
a5737779
...
@@ -26,11 +26,8 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -26,11 +26,8 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers
import
(
TFTransfoXLModel
,
from
transformers
import
TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFTransfoXLLMHeadModel
,
TFTransfoXLModel
TFTransfoXLLMHeadModel
,
TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST
,
)
class
TFTransfoXLModelTester
:
class
TFTransfoXLModelTester
:
...
...
tests/test_modeling_tf_xlm.py
View file @
a5737779
...
@@ -25,15 +25,16 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
...
@@ -25,15 +25,16 @@ from .test_modeling_tf_common import TFModelTesterMixin, ids_tensor
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
tensorflow
as
tf
from
transformers
import
(
from
transformers
import
(
XLMConfig
,
TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFXLMModel
,
TFXLMForMultipleChoice
,
TFXLMWithLMHeadModel
,
TFXLMForSequenceClassification
,
TFXLMForQuestionAnsweringSimple
,
TFXLMForQuestionAnsweringSimple
,
TFXLMForSequenceClassification
,
TFXLMForTokenClassification
,
TFXLMForTokenClassification
,
TFXLMForMultipleChoice
,
TFXLMModel
,
TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFXLMWithLMHeadModel
,
XLMConfig
,
)
)
...
...
tests/test_modeling_tf_xlm_roberta.py
View file @
a5737779
...
@@ -20,8 +20,9 @@ from transformers.testing_utils import require_tf, slow
...
@@ -20,8 +20,9 @@ from transformers.testing_utils import require_tf, slow
if
is_tf_available
():
if
is_tf_available
():
import
tensorflow
as
tf
import
numpy
as
np
import
numpy
as
np
import
tensorflow
as
tf
from
transformers
import
TFXLMRobertaModel
from
transformers
import
TFXLMRobertaModel
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment