mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Patches the full import failure and adds a test (#10750)
* Patches the full import failure and adds a test * Add comment
This commit is contained in:
parent
1b5ce1e63b
commit
2097aa1826
@ -652,10 +652,8 @@ if is_torch_available():
|
||||
"IBertForQuestionAnswering",
|
||||
"IBertForSequenceClassification",
|
||||
"IBertForTokenClassification",
|
||||
"IBertLayer",
|
||||
"IBertModel",
|
||||
"IBertPreTrainedModel",
|
||||
"load_tf_weights_in_ibert",
|
||||
]
|
||||
)
|
||||
_import_structure["models.layoutlm"].extend(
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
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 = {
|
||||
@ -28,6 +28,7 @@ _import_structure = {
|
||||
if is_torch_available():
|
||||
_import_structure["modeling_ibert"] = [
|
||||
"IBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
|
||||
"IBertPreTrainedModel",
|
||||
"IBertForMaskedLM",
|
||||
"IBertForMultipleChoice",
|
||||
"IBertForQuestionAnswering",
|
||||
@ -48,6 +49,7 @@ if TYPE_CHECKING:
|
||||
IBertForSequenceClassification,
|
||||
IBertForTokenClassification,
|
||||
IBertModel,
|
||||
IBertPreTrainedModel,
|
||||
)
|
||||
|
||||
else:
|
||||
|
@ -15,6 +15,9 @@
|
||||
import unittest
|
||||
|
||||
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.testing_utils import DUMMY_UNKWOWN_IDENTIFIER
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user