




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


a_   		=     {
    "configuration_tapas": ["TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig"],
    "tokenization_tapas": ["TapasTokenizer"],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   		=     [
     "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
     "TapasForMaskedLM",
     "TapasForQuestionAnswering",
     "TapasForSequenceClassification",
     "TapasModel",
     "TapasPreTrainedModel",
     "load_tf_weights_in_tapas",
 ]
try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 a_   		=     [
     "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
     "TFTapasForMaskedLM",
     "TFTapasForQuestionAnswering",
     "TFTapasForSequenceClassification",
     "TFTapasModel",
     "TFTapasPreTrainedModel",
 ]


if TYPE_CHECKING:
 from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig
 from .tokenization_tapas import TapasTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tapas import (
      TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
      TapasForMaskedLM,
      TapasForQuestionAnswering,
      TapasForSequenceClassification,
      TapasModel,
      TapasPreTrainedModel,
      load_tf_weights_in_tapas,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_tapas import (
      TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFTapasForMaskedLM,
      TFTapasForQuestionAnswering,
      TFTapasForSequenceClassification,
      TFTapasModel,
      TFTapasPreTrainedModel,
  )


else:
 import sys

 a_   		=     _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_   		=     logging.get_logger(__name__)

a_   		=     {
    "google/bigbird-roberta-base": "https://huggingface.co/google/bigbird-roberta-base/resolve/main/config.json",
    "google/bigbird-roberta-large": "https://huggingface.co/google/bigbird-roberta-large/resolve/main/config.json",
    "google/bigbird-base-trivia-itc": "https://huggingface.co/google/bigbird-base-trivia-itc/resolve/main/config.json",
    # See all BigBird models at https://huggingface.co/models?filter=big_bird
}

class  _lowerCamelCase						(			_SCREAMING_SNAKE_CASE   ):

      """simple docstring"""

      lowerCAmelCase__			: str    =					"big_bird"







      def __init__(     self					: str ,       snake_case					: Optional[Any]=50358 ,       snake_case					: Union[str, Any]=768 ,       snake_case					: Dict=12 ,       snake_case					: List[Any]=12 ,       snake_case					: Tuple=3072 ,       snake_case					: Tuple="gelu_new" ,       snake_case					: Dict=0.1 ,       snake_case					: Any=0.1 ,       snake_case					: List[Any]=4096 ,       snake_case					: Union[str, Any]=2 ,       snake_case					: Union[str, Any]=0.02 ,       snake_case					: Union[str, Any]=1E-12 ,       snake_case					: List[Any]=True ,       snake_case					: List[Any]=0 ,       snake_case					: int=1 ,       snake_case					: int=2 ,       snake_case					: Any=66 ,       snake_case					: str="block_sparse" ,       snake_case					: Any=True ,       snake_case					: Tuple=False ,       snake_case					: List[Any]=64 ,       snake_case					: Dict=3 ,       snake_case					: Union[str, Any]=None ,       **snake_case					: Any ,       ):
          super().__init__(
              pad_token_id=snake_case ,       bos_token_id=snake_case ,       eos_token_id=snake_case ,       sep_token_id=snake_case ,       **snake_case ,       )

          __UpperCamelCase  		=						vocab_size
          __UpperCamelCase  		=						max_position_embeddings
          __UpperCamelCase  		=						hidden_size
          __UpperCamelCase  		=						num_hidden_layers
          __UpperCamelCase  		=						num_attention_heads
          __UpperCamelCase  		=						intermediate_size
          __UpperCamelCase  		=						hidden_act
          __UpperCamelCase  		=						hidden_dropout_prob
          __UpperCamelCase  		=						attention_probs_dropout_prob
          __UpperCamelCase  		=						initializer_range
          __UpperCamelCase  		=						type_vocab_size
          __UpperCamelCase  		=						layer_norm_eps
          __UpperCamelCase  		=						use_cache

          __UpperCamelCase  		=						rescale_embeddings
          __UpperCamelCase  		=						attention_type
          __UpperCamelCase  		=						use_bias
          __UpperCamelCase  		=						block_size
          __UpperCamelCase  		=						num_random_blocks
          __UpperCamelCase  		=						classifier_dropout







class  _lowerCamelCase						(			_SCREAMING_SNAKE_CASE   ):

      """simple docstring"""

      @property
      def       snake_case	(     self					: int				):
          if self.task == "multiple-choice":
              __UpperCamelCase  		=						{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
          else:
              __UpperCamelCase  		=						{0: '''batch''', 1: '''sequence'''}
          return OrderedDict(
              [
                  ('''input_ids''', dynamic_axis),
                  ('''attention_mask''', dynamic_axis),
              ]				)






