

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


_UpperCAmelCase	:     Tuple		       = logging.get_logger(__name__)

_UpperCAmelCase	:     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 				lowercase       ( lowercase__    ):
						__SCREAMING_SNAKE_CASE      :				Dict     =    '''mctct'''




						def __init__(      self   ,     snake_case=8065   ,     snake_case=1536   ,     snake_case=36   ,     snake_case=6144   ,     snake_case=4   ,     snake_case=384   ,     snake_case=920   ,     snake_case=1e-5   ,     snake_case=0.3   ,     snake_case="relu"   ,     snake_case=0.02   ,     snake_case=0.3   ,     snake_case=0.3   ,     snake_case=1   ,     snake_case=0   ,     snake_case=2   ,     snake_case=1   ,     snake_case=0.3   ,     snake_case=1   ,     snake_case=(7,)   ,     snake_case=(3,)   ,     snake_case=80   ,     snake_case=1   ,     snake_case=None   ,     snake_case="sum"   ,     snake_case=False   ,     **snake_case   ,     ):
													super().__init__(**UpperCAmelCase__   ,     pad_token_id=UpperCAmelCase__   ,     bos_token_id=UpperCAmelCase__   ,     eos_token_id=UpperCAmelCase__ )
													snake_case_           =					vocab_size
													snake_case_           =					hidden_size
													snake_case_           =					num_hidden_layers
													snake_case_           =					intermediate_size
													snake_case_           =					num_attention_heads
													snake_case_           =					attention_head_dim
													snake_case_           =					max_position_embeddings
													snake_case_           =					layer_norm_eps
													snake_case_           =					layerdrop
													snake_case_           =					hidden_act
													snake_case_           =					initializer_range
													snake_case_           =					hidden_dropout_prob
													snake_case_           =					attention_probs_dropout_prob
													snake_case_           =					pad_token_id
													snake_case_           =					bos_token_id
													snake_case_           =					eos_token_id
													snake_case_           =					conv_glu_dim
													snake_case_           =					conv_dropout
													snake_case_           =					num_conv_layers
													snake_case_           =					input_feat_per_channel
													snake_case_           =					input_channels
													snake_case_           =					conv_channels
													snake_case_           =					ctc_loss_reduction
													snake_case_           =					ctc_zero_infinity

													# prevents config testing fail with exporting to json
													snake_case_           =					list(UpperCAmelCase__ )
													snake_case_           =					list(UpperCAmelCase__ )

													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}`.''' )







import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


_UpperCAmelCase	:     Dict		       = logging.get_logger(__name__)







class 				lowercase       ( lowercase_    ):
				__SCREAMING_SNAKE_CASE      :				Any     =    '''upernet'''




				def __init__(      self   ,     snake_case=None   ,     snake_case=512   ,     snake_case=0.02   ,     snake_case=[1, 2, 3, 6]   ,     snake_case=True   ,     snake_case=0.4   ,     snake_case=384   ,     snake_case=256   ,     snake_case=1   ,     snake_case=False   ,     snake_case=255   ,     **snake_case   ,     ):
											super().__init__(**snake_case )

											if backbone_config is None:
																		logger.info('`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.' )
																		snake_case_           =					CONFIG_MAPPING['resnet'](out_features=['stage1', 'stage2', 'stage3', 'stage4'] )
											elif isinstance(snake_case   ,     snake_case ):
																		snake_case_           =					backbone_config.get('model_type' )
																		snake_case_           =					CONFIG_MAPPING[backbone_model_type]
																		snake_case_           =					config_class.from_dict(snake_case )

											snake_case_           =					backbone_config
											snake_case_           =					hidden_size
											snake_case_           =					initializer_range
											snake_case_           =					pool_scales
											snake_case_           =					use_auxiliary_head
											snake_case_           =					auxiliary_loss_weight
											snake_case_           =					auxiliary_in_channels
											snake_case_           =					auxiliary_channels
											snake_case_           =					auxiliary_num_convs
											snake_case_           =					auxiliary_concat_input
											snake_case_           =					loss_ignore_index




				def 					a							(      self ):
											snake_case_           =					copy.deepcopy(self.__dict__ )
											snake_case_           =					self.backbone_config.to_dict()
											snake_case_           =					self.__class__.model_type
											return output




