


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


A   :					Any	=      {"configuration_xlnet": ["XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLNetConfig"]}

try:
    if not is_sentencepiece_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A   :					str	=      ["XLNetTokenizer"]

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A   :					Union[str, Any]	=      ["XLNetTokenizerFast"]

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A   :					int	=      [
        "XLNET_PRETRAINED_MODEL_ARCHIVE_LIST",
        "XLNetForMultipleChoice",
        "XLNetForQuestionAnswering",
        "XLNetForQuestionAnsweringSimple",
        "XLNetForSequenceClassification",
        "XLNetForTokenClassification",
        "XLNetLMHeadModel",
        "XLNetModel",
        "XLNetPreTrainedModel",
        "load_tf_weights_in_xlnet",
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A   :					Dict	=      [
        "TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST",
        "TFXLNetForMultipleChoice",
        "TFXLNetForQuestionAnsweringSimple",
        "TFXLNetForSequenceClassification",
        "TFXLNetForTokenClassification",
        "TFXLNetLMHeadModel",
        "TFXLNetMainLayer",
        "TFXLNetModel",
        "TFXLNetPreTrainedModel",
    ]


if TYPE_CHECKING:
    from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig

    try:
        if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_xlnet import XLNetTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_xlnet_fast import XLNetTokenizerFast

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_xlnet import (
            XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
            XLNetForMultipleChoice,
            XLNetForQuestionAnswering,
            XLNetForQuestionAnsweringSimple,
            XLNetForSequenceClassification,
            XLNetForTokenClassification,
            XLNetLMHeadModel,
            XLNetModel,
            XLNetPreTrainedModel,
            load_tf_weights_in_xlnet,
        )

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_xlnet import (
            TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFXLNetForMultipleChoice,
            TFXLNetForQuestionAnsweringSimple,
            TFXLNetForSequenceClassification,
            TFXLNetForTokenClassification,
            TFXLNetLMHeadModel,
            TFXLNetMainLayer,
            TFXLNetModel,
            TFXLNetPreTrainedModel,
        )

else:
    import sys

    A   :					List[Any]	=      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


A   :					Union[str, Any]	=      logging.get_logger(__name__)

A   :					Dict	=      {
    "kssteven/ibert-roberta-base": "https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json",
    "kssteven/ibert-roberta-large": "https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json",
    "kssteven/ibert-roberta-large-mnli": (
        "https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json"
    ),
}







class     _lowercase				(							lowercase__):


       """simple docstring"""




       A__      		=    "ibert"





       def __init__(     self							:    int      ,   __lowerCamelCase							:    List[str]=30522      ,   __lowerCamelCase							:    Optional[int]=768      ,   __lowerCamelCase							:    List[Any]=12      ,   __lowerCamelCase							:    str=12      ,   __lowerCamelCase							:    List[str]=3072      ,   __lowerCamelCase							:    Dict="gelu"      ,   __lowerCamelCase							:    Dict=0.1      ,   __lowerCamelCase							:    Optional[int]=0.1      ,   __lowerCamelCase							:    Any=512      ,   __lowerCamelCase							:    List[str]=2      ,   __lowerCamelCase							:    Union[str, Any]=0.0_2      ,   __lowerCamelCase							:    Any=1E-1_2      ,   __lowerCamelCase							:    int=1      ,   __lowerCamelCase							:    Optional[Any]=0      ,   __lowerCamelCase							:    int=2      ,   __lowerCamelCase							:    int="absolute"      ,   __lowerCamelCase							:    Tuple=False      ,   __lowerCamelCase							:    Dict="none"      ,   **__lowerCamelCase							:    Tuple      ,   ):


             '''simple docstring'''



             super().__init__(pad_token_id=__lowerCamelCase      ,   bos_token_id=__lowerCamelCase      ,   eos_token_id=__lowerCamelCase      ,   **__lowerCamelCase )

             lowerCamelCase__	:       Any					=						vocab_size
             lowerCamelCase__	:       Optional[Any]					=						hidden_size
             lowerCamelCase__	:       Optional[int]					=						num_hidden_layers
             lowerCamelCase__	:       int					=						num_attention_heads
             lowerCamelCase__	:       List[str]					=						hidden_act
             lowerCamelCase__	:       List[str]					=						intermediate_size
             lowerCamelCase__	:       Optional[int]					=						hidden_dropout_prob
             lowerCamelCase__	:       Any					=						attention_probs_dropout_prob
             lowerCamelCase__	:       Tuple					=						max_position_embeddings
             lowerCamelCase__	:       Any					=						type_vocab_size
             lowerCamelCase__	:       Optional[int]					=						initializer_range
             lowerCamelCase__	:       Tuple					=						layer_norm_eps
             lowerCamelCase__	:       int					=						position_embedding_type
             lowerCamelCase__	:       List[str]					=						quant_mode
             lowerCamelCase__	:       int					=						force_dequant







class     _lowercase				(							lowercase__):


       """simple docstring"""




       @property
       def 		lowerCAmelCase  (     self							:    List[Any] ):


             '''simple docstring'''



             if self.task == "multiple-choice":
                   lowerCamelCase__	:       Any					=						{0: "batch", 1: "choice", 2: "sequence"}
             else:
                   lowerCamelCase__	:       Any					=						{0: "batch", 1: "sequence"}
             return OrderedDict(
                 [
                     ("input_ids", dynamic_axis),
                     ("attention_mask", dynamic_axis),
                 ] )


