




import math

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


lowercase__				:      int	   = logging.get_logger(__name__)

lowercase__				:      Optional[int]	   = {
    "facebook/data2vec-base-960h": "https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json",
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}




class       a__	( UpperCamelCase__				):
     a		:      Any		 =     """data2vec-audio"""







     def __init__(     self  ,		A=32  ,		A=768  ,		A=12  ,		A=12  ,		A=3072  ,		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="gelu"  ,		A=(512, 512, 512, 512, 512, 512, 512)  ,		A=(5, 2, 2, 2, 2, 2, 2)  ,		A=(10, 3, 3, 3, 3, 2, 2)  ,		A=False  ,		A=16  ,		A=19  ,		A=5  ,		A=0.0_5  ,		A=10  ,		A=2  ,		A=0.0  ,		A=10  ,		A=0  ,		A="sum"  ,		A=False  ,		A=False  ,		A=256  ,		A=(512, 512, 512, 512, 1500)  ,		A=(5, 3, 3, 1, 1)  ,		A=(1, 2, 3, 1, 1)  ,		A=512  ,		A=0  ,		A=1  ,		A=2  ,		A=False  ,		A=3  ,		A=2  ,		A=3  ,		A=None  ,		**A  ,		)  ->   int:



          '''simple docstring'''



          super().__init__(**A  ,		pad_token_id=A  ,		bos_token_id=A  ,		eos_token_id=A			)
          a     =				hidden_size
          a     =				feat_extract_activation
          a     =				list(A			)
          a     =				list(A			)
          a     =				list(A			)
          a     =				conv_bias
          a     =				num_conv_pos_embeddings
          a     =				num_conv_pos_embedding_groups
          a     =				conv_pos_kernel_size
          a     =				len(self.conv_dim			)
          a     =				num_hidden_layers
          a     =				intermediate_size
          a     =				hidden_act
          a     =				num_attention_heads
          a     =				hidden_dropout
          a     =				attention_dropout
          a     =				activation_dropout
          a     =				feat_proj_dropout
          a     =				final_dropout
          a     =				layerdrop
          a     =				layer_norm_eps
          a     =				initializer_range
          a     =				vocab_size
          a     =				use_weighted_layer_sum

          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)`, but is `len(config.conv_dim) ="
                   F''' {len(self.conv_dim			)}`, `len(config.conv_stride) = {len(self.conv_stride			)}`,'''
                   F''' `len(config.conv_kernel) = {len(self.conv_kernel			)}`.'''			)

          # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
          a     =				mask_time_prob
          a     =				mask_time_length
          a     =				mask_time_min_masks
          a     =				mask_feature_prob
          a     =				mask_feature_length
          a     =				mask_feature_min_masks

          # ctc loss
          a     =				ctc_loss_reduction
          a     =				ctc_zero_infinity

          # adapter
          a     =				add_adapter
          a     =				adapter_kernel_size
          a     =				adapter_stride
          a     =				num_adapter_layers
          a     =				output_hidden_size or hidden_size

          # SequenceClassification-specific parameter. Feel free to ignore for other classes.
          a     =				classifier_proj_size

          # XVector-specific parameters. Feel free to ignore for other classes.
          a     =				list(A			)
          a     =				list(A			)
          a     =				list(A			)
          a     =				xvector_output_dim







     @property
     def       lowerCAmelCase_    (     self			)  ->   Tuple:



          '''simple docstring'''



          return math.prod(self.conv_stride			)







from collections import OrderedDict
from typing import Mapping

from packaging import version

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


lowercase__				:      Optional[Any]	   = logging.get_logger(__name__)

lowercase__				:      str	   = {
    "microsoft/table-transformer-detection": (
        "https://huggingface.co/microsoft/table-transformer-detection/resolve/main/config.json"
    ),
}




class       a__	( UpperCamelCase__				):
     a		:      Optional[int]		 =     """table-transformer"""
     a		:      Tuple		 =     ["""past_key_values"""]
     a		:      int		 =     {
         """hidden_size""": """d_model""",
         """num_attention_heads""": """encoder_attention_heads""",
     }







     def __init__(     self  ,		A=True  ,		A=None  ,		A=3  ,		A=100  ,		A=6  ,		A=2048  ,		A=8  ,		A=6  ,		A=2048  ,		A=8  ,		A=0.0  ,		A=0.0  ,		A=True  ,		A="relu"  ,		A=256  ,		A=0.1  ,		A=0.0  ,		A=0.0  ,		A=0.0_2  ,		A=1.0  ,		A=False  ,		A="sine"  ,		A="resnet50"  ,		A=True  ,		A=False  ,		A=1  ,		A=5  ,		A=2  ,		A=1  ,		A=1  ,		A=5  ,		A=2  ,		A=0.1  ,		**A  ,		)  ->   List[str]:



          '''simple docstring'''



          if backbone_config is not None and use_timm_backbone:
               raise ValueError("You can't specify both `backbone_config` and `use_timm_backbone`."			)

          if not use_timm_backbone:
               if backbone_config is None:
                    logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."			)
                    a     =				CONFIG_MAPPING["resnet"](out_features=["stage4"]			)
               elif isinstance(A  ,		A			):
                    a     =				backbone_config.get("model_type"			)
                    a     =				CONFIG_MAPPING[backbone_model_type]
                    a     =				config_class.from_dict(A			)
               # set timm attributes to None
               a  ,				a  ,				a     =				None, None, None

          a     =				use_timm_backbone
          a     =				backbone_config
          a     =				num_channels
          a     =				num_queries
          a     =				d_model
          a     =				encoder_ffn_dim
          a     =				encoder_layers
          a     =				encoder_attention_heads
          a     =				decoder_ffn_dim
          a     =				decoder_layers
          a     =				decoder_attention_heads
          a     =				dropout
          a     =				attention_dropout
          a     =				activation_dropout
          a     =				activation_function
          a     =				init_std
          a     =				init_xavier_std
          a     =				encoder_layerdrop
          a     =				decoder_layerdrop
          a     =				encoder_layers
          a     =				auxiliary_loss
          a     =				position_embedding_type
          a     =				backbone
          a     =				use_pretrained_backbone
          a     =				dilation
          # Hungarian matcher
          a     =				class_cost
          a     =				bbox_cost
          a     =				giou_cost
          # Loss coefficients
          a     =				mask_loss_coefficient
          a     =				dice_loss_coefficient
          a     =				bbox_loss_coefficient
          a     =				giou_loss_coefficient
          a     =				eos_coefficient
          super().__init__(is_encoder_decoder=A  ,		**A			)







     @property
     def       lowerCAmelCase_    (     self			)  ->   int:



          '''simple docstring'''



          return self.encoder_attention_heads







     @property
     def       lowerCAmelCase_    (     self			)  ->   int:



          '''simple docstring'''



          return self.d_model







class       a__	( UpperCamelCase__				):
     a		:      Any		 =     version.parse("""1.11"""				)







     @property
     def       lowerCAmelCase_    (     self			)  ->   Mapping[str, Mapping[int, str]]:



          '''simple docstring'''



          return OrderedDict(
              [
                  ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
                  ("pixel_mask", {0: "batch"}),
              ]			)







     @property
     def       lowerCAmelCase_    (     self			)  ->   float:



          '''simple docstring'''



          return 1e-5







     @property
     def       lowerCAmelCase_    (     self			)  ->   int:



          '''simple docstring'''



          return 12

