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


lowerCamelCase     :							Tuple    =logging.get_logger(__name__)

lowerCamelCase     :							Optional[Any]    ={
    "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json",
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}





class       __a  (   UpperCAmelCase__	):
 _lowerCAmelCase	:	Any				=			'mctct'







 def __init__(		self :       str							,       SCREAMING_SNAKE_CASE :       List[Any]=80_65							,       SCREAMING_SNAKE_CASE :       Any=15_36							,       SCREAMING_SNAKE_CASE :       Any=36							,       SCREAMING_SNAKE_CASE :       Optional[Any]=61_44							,       SCREAMING_SNAKE_CASE :       Optional[int]=4							,       SCREAMING_SNAKE_CASE :       Optional[int]=3_84							,       SCREAMING_SNAKE_CASE :       List[Any]=9_20							,       SCREAMING_SNAKE_CASE :       Dict=1e-5							,       SCREAMING_SNAKE_CASE :       Any=0.3							,       SCREAMING_SNAKE_CASE :       List[Any]="relu"							,       SCREAMING_SNAKE_CASE :       str=0.0_2							,       SCREAMING_SNAKE_CASE :       List[str]=0.3							,       SCREAMING_SNAKE_CASE :       Union[str, Any]=0.3							,       SCREAMING_SNAKE_CASE :       Dict=1							,       SCREAMING_SNAKE_CASE :       Tuple=0							,       SCREAMING_SNAKE_CASE :       Union[str, Any]=2							,       SCREAMING_SNAKE_CASE :       Dict=1							,       SCREAMING_SNAKE_CASE :       Tuple=0.3							,       SCREAMING_SNAKE_CASE :       Any=1							,       SCREAMING_SNAKE_CASE :       Optional[Any]=(7,)							,       SCREAMING_SNAKE_CASE :       Tuple=(3,)							,       SCREAMING_SNAKE_CASE :       List[str]=80							,       SCREAMING_SNAKE_CASE :       Union[str, Any]=1							,       SCREAMING_SNAKE_CASE :       List[Any]=None							,       SCREAMING_SNAKE_CASE :       Dict="sum"							,       SCREAMING_SNAKE_CASE :       List[Any]=False							,       **SCREAMING_SNAKE_CASE :       Union[str, Any]							,       ):


      '''simple docstring'''






      super().__init__(**_SCREAMING_SNAKE_CASE							,       pad_token_id=_SCREAMING_SNAKE_CASE							,       bos_token_id=_SCREAMING_SNAKE_CASE							,       eos_token_id=_SCREAMING_SNAKE_CASE						)
      UpperCamelCase__      :       int	    =  vocab_size
      UpperCamelCase__      :       str	    =  hidden_size
      UpperCamelCase__      :       str	    =  num_hidden_layers
      UpperCamelCase__      :       Dict	    =  intermediate_size
      UpperCamelCase__      :       List[str]	    =  num_attention_heads
      UpperCamelCase__      :       List[Any]	    =  attention_head_dim
      UpperCamelCase__      :       Union[str, Any]	    =  max_position_embeddings
      UpperCamelCase__      :       Optional[int]	    =  layer_norm_eps
      UpperCamelCase__      :       int	    =  layerdrop
      UpperCamelCase__      :       Tuple	    =  hidden_act
      UpperCamelCase__      :       Optional[int]	    =  initializer_range
      UpperCamelCase__      :       str	    =  hidden_dropout_prob
      UpperCamelCase__      :       Optional[int]	    =  attention_probs_dropout_prob
      UpperCamelCase__      :       Dict	    =  pad_token_id
      UpperCamelCase__      :       List[Any]	    =  bos_token_id
      UpperCamelCase__      :       List[str]	    =  eos_token_id
      UpperCamelCase__      :       Optional[int]	    =  conv_glu_dim
      UpperCamelCase__      :       Tuple	    =  conv_dropout
      UpperCamelCase__      :       Dict	    =  num_conv_layers
      UpperCamelCase__      :       Tuple	    =  input_feat_per_channel
      UpperCamelCase__      :       int	    =  input_channels
      UpperCamelCase__      :       str	    =  conv_channels
      UpperCamelCase__      :       Any	    =  ctc_loss_reduction
      UpperCamelCase__      :       Tuple	    =  ctc_zero_infinity

      # prevents config testing fail with exporting to json
      UpperCamelCase__      :       Optional[Any]	    =  list(_SCREAMING_SNAKE_CASE						)
      UpperCamelCase__      :       str	    =  list(_SCREAMING_SNAKE_CASE						)

      if len(self.conv_kernel						) != self.num_conv_layers:
           raise ValueError(
               "Configuration for convolutional module is incorrect. "
               "It is required that `len(config.conv_kernel)` == `config.num_conv_layers` "
               F'but is `len(config.conv_kernel) = {len(self.conv_kernel						)}`, '
               F'`config.num_conv_layers = {self.num_conv_layers}`.'						)







from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowerCamelCase     :							List[Any]    =logging.get_logger(__name__)

lowerCamelCase     :							Optional[Any]    ={
    '''google/bit-50''': '''https://huggingface.co/google/bit-50/resolve/main/config.json''',
}





class       __a  (   A__	,       A__	):
 _lowerCAmelCase	:	Union[str, Any]				=			'''bit'''
 _lowerCAmelCase	:	List[str]				=			['''preactivation''', '''bottleneck''']
 _lowerCAmelCase	:	Any				=			['''SAME''', '''VALID''']







 def __init__(		self :       str							,       SCREAMING_SNAKE_CASE :       Tuple=3							,       SCREAMING_SNAKE_CASE :       str=64							,       SCREAMING_SNAKE_CASE :       List[Any]=[2_56, 5_12, 10_24, 20_48]							,       SCREAMING_SNAKE_CASE :       Union[str, Any]=[3, 4, 6, 3]							,       SCREAMING_SNAKE_CASE :       str="preactivation"							,       SCREAMING_SNAKE_CASE :       Any="relu"							,       SCREAMING_SNAKE_CASE :       Dict=None							,       SCREAMING_SNAKE_CASE :       List[Any]=32							,       SCREAMING_SNAKE_CASE :       Tuple=0.0							,       SCREAMING_SNAKE_CASE :       Dict=False							,       SCREAMING_SNAKE_CASE :       int=32							,       SCREAMING_SNAKE_CASE :       str=1							,       SCREAMING_SNAKE_CASE :       List[str]=None							,       SCREAMING_SNAKE_CASE :       Optional[int]=None							,       **SCREAMING_SNAKE_CASE :       int							,       ):


      '''simple docstring'''






      super().__init__(**SCREAMING_SNAKE_CASE						)
      if layer_type not in self.layer_types:
           raise ValueError(F'layer_type={layer_type} is not one of {",".join(self.layer_types						)}'						)
      if global_padding is not None:
           if global_padding.upper() in self.supported_padding:
                UpperCamelCase__      :       Any	    =  global_padding.upper()
           else:
                raise ValueError(F'Padding strategy {global_padding} not supported'						)
      UpperCamelCase__      :       Dict	    =  num_channels
      UpperCamelCase__      :       Dict	    =  embedding_size
      UpperCamelCase__      :       Tuple	    =  hidden_sizes
      UpperCamelCase__      :       Any	    =  depths
      UpperCamelCase__      :       Optional[int]	    =  layer_type
      UpperCamelCase__      :       int	    =  hidden_act
      UpperCamelCase__      :       str	    =  global_padding
      UpperCamelCase__      :       Any	    =  num_groups
      UpperCamelCase__      :       str	    =  drop_path_rate
      UpperCamelCase__      :       Optional[Any]	    =  embedding_dynamic_padding
      UpperCamelCase__      :       Tuple	    =  output_stride
      UpperCamelCase__      :       List[str]	    =  width_factor

      UpperCamelCase__      :       Any	    =  ["stem"] + [F'stage{idx}' for idx in range(1							,       len(SCREAMING_SNAKE_CASE						) + 1						)]
      UpperCamelCase__    ,					UpperCamelCase__      :       Union[str, Any]	    =  get_aligned_output_features_output_indices(
          out_features=SCREAMING_SNAKE_CASE							,       out_indices=SCREAMING_SNAKE_CASE							,       stage_names=self.stage_names						)