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
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
23 deletions
+25
-23
tests/test_modeling_tf_xlnet.py
tests/test_modeling_tf_xlnet.py
+5
-5
tests/test_modeling_transfo_xl.py
tests/test_modeling_transfo_xl.py
+2
-1
tests/test_modeling_xlm.py
tests/test_modeling_xlm.py
+6
-5
tests/test_modeling_xlm_roberta.py
tests/test_modeling_xlm_roberta.py
+1
-0
tests/test_modeling_xlnet.py
tests/test_modeling_xlnet.py
+4
-4
tests/test_optimization_tf.py
tests/test_optimization_tf.py
+2
-1
tests/test_tokenization_common.py
tests/test_tokenization_common.py
+2
-5
tests/test_tokenization_reformer.py
tests/test_tokenization_reformer.py
+2
-1
tests/test_tokenization_transfo_xl.py
tests/test_tokenization_transfo_xl.py
+1
-1
No files found.
tests/test_modeling_tf_xlnet.py
View file @
a5737779
...
...
@@ -28,13 +28,13 @@ if is_tf_available():
import
tensorflow
as
tf
from
transformers.modeling_tf_xlnet
import
(
TFXLNetModel
,
TFXLNetLMHeadModel
,
TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFXLNetForMultipleChoice
,
TFXLNetForQuestionAnsweringSimple
,
TFXLNetForSequenceClassification
,
TFXLNetForTokenClassification
,
TFXLNetForQuestionAnsweringSimple
,
TFXLNetForMultipleChoice
,
TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST
,
TFXLNetLMHeadModel
,
TFXLNetModel
,
)
...
...
tests/test_modeling_transfo_xl.py
View file @
a5737779
...
...
@@ -25,7 +25,8 @@ from .test_modeling_common import ModelTesterMixin, ids_tensor
if
is_torch_available
():
import
torch
from
transformers
import
TransfoXLConfig
,
TransfoXLModel
,
TransfoXLLMHeadModel
from
transformers
import
TransfoXLConfig
,
TransfoXLLMHeadModel
,
TransfoXLModel
from
transformers.modeling_transfo_xl
import
TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST
...
...
tests/test_modeling_xlm.py
View file @
a5737779
...
...
@@ -25,15 +25,16 @@ from .test_modeling_common import ModelTesterMixin, ids_tensor, random_attention
if
is_torch_available
():
import
torch
from
transformers
import
(
XLMConfig
,
XLMModel
,
XLMWithLMHeadModel
,
XLMForTokenClassification
,
XLMForMultipleChoice
,
XLMForQuestionAnswering
,
XLMForSequenceClassification
,
XLMForQuestionAnsweringSimple
,
XLMForMultipleChoice
,
XLMForSequenceClassification
,
XLMForTokenClassification
,
XLMModel
,
XLMWithLMHeadModel
,
)
from
transformers.modeling_xlm
import
XLM_PRETRAINED_MODEL_ARCHIVE_LIST
...
...
tests/test_modeling_xlm_roberta.py
View file @
a5737779
...
...
@@ -22,6 +22,7 @@ from transformers.testing_utils import slow
if
is_torch_available
():
import
torch
from
transformers
import
XLMRobertaModel
...
...
tests/test_modeling_xlnet.py
View file @
a5737779
...
...
@@ -29,13 +29,13 @@ if is_torch_available():
from
transformers
import
(
XLNetConfig
,
XLNetModel
,
XLNetLMHeadModel
,
XLNetForMultipleChoice
,
XLNetForSequenceClassification
,
XLNetForTokenClassification
,
XLNetForQuestionAnswering
,
XLNetForQuestionAnsweringSimple
,
XLNetForSequenceClassification
,
XLNetForTokenClassification
,
XLNetLMHeadModel
,
XLNetModel
,
)
from
transformers.modeling_xlnet
import
XLNET_PRETRAINED_MODEL_ARCHIVE_LIST
...
...
tests/test_optimization_tf.py
View file @
a5737779
...
...
@@ -8,7 +8,8 @@ if is_tf_available():
import
tensorflow
as
tf
from
tensorflow.python.eager
import
context
from
tensorflow.python.framework
import
ops
from
transformers
import
create_optimizer
,
GradientAccumulator
from
transformers
import
GradientAccumulator
,
create_optimizer
@
require_tf
...
...
tests/test_tokenization_common.py
View file @
a5737779
...
...
@@ -28,11 +28,7 @@ from transformers.tokenization_utils import AddedToken
if
TYPE_CHECKING
:
from
transformers
import
(
PretrainedConfig
,
PreTrainedModel
,
TFPreTrainedModel
,
)
from
transformers
import
PretrainedConfig
,
PreTrainedModel
,
TFPreTrainedModel
def
merge_model_tokenizer_mappings
(
...
...
@@ -1398,6 +1394,7 @@ class TokenizerTesterMixin:
@
require_torch
def
test_torch_encode_plus_sent_to_model
(
self
):
import
torch
from
transformers
import
MODEL_MAPPING
,
TOKENIZER_MAPPING
MODEL_TOKENIZER_MAPPING
=
merge_model_tokenizer_mappings
(
MODEL_MAPPING
,
TOKENIZER_MAPPING
)
...
...
tests/test_tokenization_reformer.py
View file @
a5737779
...
...
@@ -232,7 +232,8 @@ class ReformerTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
@
require_torch
def
test_torch_encode_plus_sent_to_model
(
self
):
import
torch
from
transformers
import
ReformerModel
,
ReformerConfig
from
transformers
import
ReformerConfig
,
ReformerModel
# Build sequence
first_ten_tokens
=
list
(
self
.
big_tokenizer
.
get_vocab
().
keys
())[:
10
]
...
...
tests/test_tokenization_transfo_xl.py
View file @
a5737779
...
...
@@ -24,7 +24,7 @@ from .test_tokenization_common import TokenizerTesterMixin
if
is_torch_available
():
from
transformers.tokenization_transfo_xl
import
TransfoXLTokenizer
,
VOCAB_FILES_NAMES
from
transformers.tokenization_transfo_xl
import
VOCAB_FILES_NAMES
,
TransfoXLTokenizer
@
require_torch
...
...
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