






from typing import TYPE_CHECKING

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


lowerCamelCase__							=     {"""configuration_xlnet""": ["""XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """XLNetConfig"""]}

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

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase__							=     ["""XLNetTokenizerFast"""]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase__							=     [
         """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:
     lowerCamelCase__							=     [
         """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

     lowerCamelCase__							=     _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)












from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase__							=     logging.get_logger(__name__)

lowerCamelCase__							=     {
    """uclanlp/visualbert-vqa""": """https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json""",
    """uclanlp/visualbert-vqa-pre""": """https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json""",
    """uclanlp/visualbert-vqa-coco-pre""": (
        """https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json"""
    ),
    """uclanlp/visualbert-vcr""": """https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json""",
    """uclanlp/visualbert-vcr-pre""": """https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json""",
    """uclanlp/visualbert-vcr-coco-pre""": (
        """https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json"""
    ),
    """uclanlp/visualbert-nlvr2""": """https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json""",
    """uclanlp/visualbert-nlvr2-pre""": """https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json""",
    """uclanlp/visualbert-nlvr2-coco-pre""": (
        """https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json"""
    )
    # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert
}




class 			snake_case__   (							lowercase_):

       '''simple docstring'''
       lowerCamelCase							:				Optional[int] 				= "visual_bert"



       def __init__(							self			,						a__=3_05_22			,						a__=7_68			,						a__=5_12			,						a__=12			,						a__=12			,						a__=30_72			,						a__="gelu"			,						a__=0.1			,						a__=0.1			,						a__=5_12			,						a__=2			,						a__=0.02			,						a__=1e-12			,						a__=False			,						a__=True			,						a__=1			,						a__=0			,						a__=2			,						**a__			,						) ->      Any:






            '''simple docstring'''





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

            __snake_case			:Tuple          =						vocab_size
            __snake_case			:Any          =						max_position_embeddings
            __snake_case			:int          =						hidden_size
            __snake_case			:List[str]          =						visual_embedding_dim
            __snake_case			:List[str]          =						num_hidden_layers
            __snake_case			:Tuple          =						num_attention_heads
            __snake_case			:str          =						intermediate_size
            __snake_case			:Union[str, Any]          =						hidden_act
            __snake_case			:Union[str, Any]          =						hidden_dropout_prob
            __snake_case			:str          =						attention_probs_dropout_prob
            __snake_case			:Tuple          =						initializer_range
            __snake_case			:str          =						type_vocab_size
            __snake_case			:Optional[Any]          =						layer_norm_eps
            __snake_case			:Union[str, Any]          =						bypass_transformer
            __snake_case			:Tuple          =						special_visual_initialize


