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
2097aa18
Unverified
Commit
2097aa18
authored
Mar 16, 2021
by
Lysandre Debut
Committed by
GitHub
Mar 16, 2021
Browse files
Patches the full import failure and adds a test (#10750)
* Patches the full import failure and adds a test * Add comment
parent
1b5ce1e6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
src/transformers/__init__.py
src/transformers/__init__.py
+0
-2
src/transformers/models/ibert/__init__.py
src/transformers/models/ibert/__init__.py
+3
-1
tests/test_file_utils.py
tests/test_file_utils.py
+3
-0
No files found.
src/transformers/__init__.py
View file @
2097aa18
...
@@ -652,10 +652,8 @@ if is_torch_available():
...
@@ -652,10 +652,8 @@ if is_torch_available():
"IBertForQuestionAnswering"
,
"IBertForQuestionAnswering"
,
"IBertForSequenceClassification"
,
"IBertForSequenceClassification"
,
"IBertForTokenClassification"
,
"IBertForTokenClassification"
,
"IBertLayer"
,
"IBertModel"
,
"IBertModel"
,
"IBertPreTrainedModel"
,
"IBertPreTrainedModel"
,
"load_tf_weights_in_ibert"
,
]
]
)
)
_import_structure
[
"models.layoutlm"
].
extend
(
_import_structure
[
"models.layoutlm"
].
extend
(
...
...
src/transformers/models/ibert/__init__.py
View file @
2097aa18
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
from
typing
import
TYPE_CHECKING
from
typing
import
TYPE_CHECKING
from
...file_utils
import
_BaseLazyModule
,
is_tokenizers_available
,
is_torch_available
from
...file_utils
import
_BaseLazyModule
,
is_torch_available
_import_structure
=
{
_import_structure
=
{
...
@@ -28,6 +28,7 @@ _import_structure = {
...
@@ -28,6 +28,7 @@ _import_structure = {
if
is_torch_available
():
if
is_torch_available
():
_import_structure
[
"modeling_ibert"
]
=
[
_import_structure
[
"modeling_ibert"
]
=
[
"IBERT_PRETRAINED_MODEL_ARCHIVE_LIST"
,
"IBERT_PRETRAINED_MODEL_ARCHIVE_LIST"
,
"IBertPreTrainedModel"
,
"IBertForMaskedLM"
,
"IBertForMaskedLM"
,
"IBertForMultipleChoice"
,
"IBertForMultipleChoice"
,
"IBertForQuestionAnswering"
,
"IBertForQuestionAnswering"
,
...
@@ -48,6 +49,7 @@ if TYPE_CHECKING:
...
@@ -48,6 +49,7 @@ if TYPE_CHECKING:
IBertForSequenceClassification
,
IBertForSequenceClassification
,
IBertForTokenClassification
,
IBertForTokenClassification
,
IBertModel
,
IBertModel
,
IBertPreTrainedModel
,
)
)
else
:
else
:
...
...
tests/test_file_utils.py
View file @
2097aa18
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
import
unittest
import
unittest
import
requests
import
requests
# Try to import everything from transformers to ensure every object can be loaded.
from
transformers
import
*
# noqa F406
from
transformers.file_utils
import
CONFIG_NAME
,
WEIGHTS_NAME
,
filename_to_url
,
get_from_cache
,
hf_bucket_url
from
transformers.file_utils
import
CONFIG_NAME
,
WEIGHTS_NAME
,
filename_to_url
,
get_from_cache
,
hf_bucket_url
from
transformers.testing_utils
import
DUMMY_UNKWOWN_IDENTIFIER
from
transformers.testing_utils
import
DUMMY_UNKWOWN_IDENTIFIER
...
...
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