
"""simple docstring"""




import functools
import operator

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


_A     :			List[str]  						=			logging.get_logger(__name__)

_A     :			List[Any]  						=			{
    """asapp/sew-tiny-100k""": """https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json""",
    # See all SEW models at https://huggingface.co/models?filter=sew
}

class 						a__		( a_		):
   __lowerCAmelCase				=							"""sew"""
   def __init__(     self      ,       _a=32      ,       _a=768      ,       _a=12      ,       _a=12      ,       _a=3_072      ,       _a=2      ,       _a="gelu"      ,       _a=0.1      ,       _a=0.1      ,       _a=0.1      ,       _a=0.0      ,       _a=0.1      ,       _a=0.1      ,       _a=0.0_2      ,       _a=1E-5      ,       _a="group"      ,       _a="gelu"      ,       _a=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)      ,       _a=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)      ,       _a=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)      ,       _a=False      ,       _a=128      ,       _a=16      ,       _a=True      ,       _a=0.0_5      ,       _a=10      ,       _a=2      ,       _a=0.0      ,       _a=10      ,       _a=0      ,       _a="mean"      ,       _a=False      ,       _a=False      ,       _a=256      ,       _a=0      ,       _a=1      ,       _a=2      ,       **_a      ,       ):
          super().__init__(**_a      ,       pad_token_id=_a      ,       bos_token_id=_a      ,       eos_token_id=_a							)
          lowercase       :							Union[str, Any]									=				hidden_size
          lowercase       :							Dict									=				feat_extract_norm
          lowercase       :							Any									=				feat_extract_activation
          lowercase       :							List[Any]									=				list(_a							)
          lowercase       :							Optional[int]									=				list(_a							)
          lowercase       :							Optional[Any]									=				list(_a							)
          lowercase       :							Dict									=				conv_bias
          lowercase       :							List[str]									=				num_conv_pos_embeddings
          lowercase       :							str									=				num_conv_pos_embedding_groups
          lowercase       :							Any									=				len(self.conv_dim							)
          lowercase       :							int									=				num_hidden_layers
          lowercase       :							Any									=				intermediate_size
          lowercase       :							Optional[Any]									=				squeeze_factor
          lowercase       :							str									=				hidden_act
          lowercase       :							Union[str, Any]									=				num_attention_heads
          lowercase       :							Optional[Any]									=				hidden_dropout
          lowercase       :							Union[str, Any]									=				attention_dropout
          lowercase       :							Any									=				activation_dropout
          lowercase       :							Union[str, Any]									=				feat_proj_dropout
          lowercase       :							Union[str, Any]									=				final_dropout
          lowercase       :							int									=				layerdrop
          lowercase       :							Dict									=				layer_norm_eps
          lowercase       :							Any									=				initializer_range
          lowercase       :							Tuple									=				vocab_size

          if (
              (len(self.conv_stride							) != self.num_feat_extract_layers)
              or (len(self.conv_kernel							) != self.num_feat_extract_layers)
              or (len(self.conv_dim							) != self.num_feat_extract_layers)
          ):
                 raise ValueError(
                     "Configuration for convolutional layers is incorrect."
                     "It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,"
                     f"""but is `len(config.conv_dim) = {len(self.conv_dim							)}`, `len(config.conv_stride)"""
                     f"""= {len(self.conv_stride							)}`, `len(config.conv_kernel) = {len(self.conv_kernel							)}`."""							)

          # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
          lowercase       :							int									=				apply_spec_augment
          lowercase       :							int									=				mask_time_prob
          lowercase       :							Optional[int]									=				mask_time_length
          lowercase       :							int									=				mask_time_min_masks
          lowercase       :							str									=				mask_feature_prob
          lowercase       :							Dict									=				mask_feature_length
          lowercase       :							Any									=				mask_feature_min_masks

          # ctc loss
          lowercase       :							str									=				ctc_loss_reduction
          lowercase       :							Union[str, Any]									=				ctc_zero_infinity

          # sequence classification
          lowercase       :							List[str]									=				use_weighted_layer_sum
          lowercase       :							Optional[int]									=				classifier_proj_size

   @property
   def      __magic_name__     (     self							):
          return functools.reduce(operator.mul      ,       self.conv_stride      ,       1							)




"""simple docstring"""




from collections import OrderedDict
from typing import Mapping

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


_A     :			str  						=			logging.get_logger(__name__)

_A     :			Tuple  						=			{
    """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 						a__		( a_		):
   __lowerCAmelCase				=							"""big_bird"""
   def __init__(     self      ,       _a=50_358      ,       _a=768      ,       _a=12      ,       _a=12      ,       _a=3_072      ,       _a="gelu_new"      ,       _a=0.1      ,       _a=0.1      ,       _a=4_096      ,       _a=2      ,       _a=0.0_2      ,       _a=1E-12      ,       _a=True      ,       _a=0      ,       _a=1      ,       _a=2      ,       _a=66      ,       _a="block_sparse"      ,       _a=True      ,       _a=False      ,       _a=64      ,       _a=3      ,       _a=None      ,       **_a      ,       ):
          super().__init__(
              pad_token_id=_a      ,       bos_token_id=_a      ,       eos_token_id=_a      ,       sep_token_id=_a      ,       **_a      ,       )

          lowercase       :							List[Any]									=				vocab_size
          lowercase       :							Optional[Any]									=				max_position_embeddings
          lowercase       :							str									=				hidden_size
          lowercase       :							int									=				num_hidden_layers
          lowercase       :							Optional[Any]									=				num_attention_heads
          lowercase       :							List[Any]									=				intermediate_size
          lowercase       :							int									=				hidden_act
          lowercase       :							str									=				hidden_dropout_prob
          lowercase       :							List[Any]									=				attention_probs_dropout_prob
          lowercase       :							Tuple									=				initializer_range
          lowercase       :							Optional[int]									=				type_vocab_size
          lowercase       :							str									=				layer_norm_eps
          lowercase       :							Tuple									=				use_cache

          lowercase       :							Any									=				rescale_embeddings
          lowercase       :							List[str]									=				attention_type
          lowercase       :							int									=				use_bias
          lowercase       :							Dict									=				block_size
          lowercase       :							List[str]									=				num_random_blocks
          lowercase       :							int									=				classifier_dropout


class 						a__		( a_		):
   @property
   def      __magic_name__     (     self							):
          if self.task == "multiple-choice":
                 lowercase       :							Union[str, Any]									=				{0: "batch", 1: "choice", 2: "sequence"}
          else:
                 lowercase       :							Dict									=				{0: "batch", 1: "sequence"}
          return OrderedDict(
              [
                  ("input_ids", dynamic_axis),
                  ("attention_mask", dynamic_axis),
              ]							)


