"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "d8e3bdbb4cce939e8f95e0f1fa33bdd7350f4b79"
Unverified Commit 7bc88c05 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Fix forward reference imports in DeBERTa configs (#17800)

parent 27e90738
...@@ -14,14 +14,17 @@ ...@@ -14,14 +14,17 @@
# limitations under the License. # limitations under the License.
""" DeBERTa model configuration""" """ DeBERTa model configuration"""
from collections import OrderedDict from collections import OrderedDict
from typing import Any, Mapping, Optional, Union from typing import TYPE_CHECKING, Any, Mapping, Optional, Union
from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType
from ...configuration_utils import PretrainedConfig from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig from ...onnx import OnnxConfig
from ...utils import logging from ...utils import logging
if TYPE_CHECKING:
from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType
logger = logging.get_logger(__name__) logger = logging.get_logger(__name__)
DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = { DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP = {
...@@ -169,7 +172,7 @@ class DebertaOnnxConfig(OnnxConfig): ...@@ -169,7 +172,7 @@ class DebertaOnnxConfig(OnnxConfig):
seq_length: int = -1, seq_length: int = -1,
num_choices: int = -1, num_choices: int = -1,
is_pair: bool = False, is_pair: bool = False,
framework: Optional[TensorType] = None, framework: Optional["TensorType"] = None,
num_channels: int = 3, num_channels: int = 3,
image_width: int = 40, image_width: int = 40,
image_height: int = 40, image_height: int = 40,
......
...@@ -14,14 +14,17 @@ ...@@ -14,14 +14,17 @@
# limitations under the License. # limitations under the License.
""" DeBERTa-v2 model configuration""" """ DeBERTa-v2 model configuration"""
from collections import OrderedDict from collections import OrderedDict
from typing import Any, Mapping, Optional, Union from typing import TYPE_CHECKING, Any, Mapping, Optional, Union
from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType
from ...configuration_utils import PretrainedConfig from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig from ...onnx import OnnxConfig
from ...utils import logging from ...utils import logging
if TYPE_CHECKING:
from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType
logger = logging.get_logger(__name__) logger = logging.get_logger(__name__)
DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = { DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP = {
...@@ -170,7 +173,7 @@ class DebertaV2OnnxConfig(OnnxConfig): ...@@ -170,7 +173,7 @@ class DebertaV2OnnxConfig(OnnxConfig):
seq_length: int = -1, seq_length: int = -1,
num_choices: int = -1, num_choices: int = -1,
is_pair: bool = False, is_pair: bool = False,
framework: Optional[TensorType] = None, framework: Optional["TensorType"] = None,
num_channels: int = 3, num_channels: int = 3,
image_width: int = 40, image_width: int = 40,
image_height: int = 40, image_height: int = 40,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment