


import copy

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


lowerCAmelCase	=							logging.get_logger(__name__)


class 	_a							(      UpperCamelCase__      ):
							_lowercase     :      Dict  				=			'''upernet'''

							def __init__(							self:     Dict   ,						UpperCamelCase_:     Optional[int]=None   ,						UpperCamelCase_:     Dict=512   ,						UpperCamelCase_:     List[Any]=0.02   ,						UpperCamelCase_:     List[Any]=[1, 2, 3, 6]   ,						UpperCamelCase_:     Tuple=True   ,						UpperCamelCase_:     Optional[int]=0.4   ,						UpperCamelCase_:     int=384   ,						UpperCamelCase_:     Optional[int]=256   ,						UpperCamelCase_:     Tuple=1   ,						UpperCamelCase_:     Dict=False   ,						UpperCamelCase_:     int=255   ,						**UpperCamelCase_:     Union[str, Any]   ,						)      ->       List[Any]:





									"""simple docstring"""







									super().__init__(**UpperCamelCase_							)

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

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


							def 				lowerCamelCase_			(							self:     Any							)      ->       Tuple:





									"""simple docstring"""







									lowercase__						=				copy.deepcopy(self.__dict__							)
									lowercase__						=				self.backbone_config.to_dict()
									lowercase__						=				self.__class__.model_type
									return output






import logging

from transformers import PretrainedConfig


lowerCAmelCase	=							logging.getLogger(__name__)


lowerCAmelCase	=							{
    'bertabs-finetuned-cnndm': 'https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json',
}


class 	_a							(      UpperCamelCase__      ):
							_lowercase     :      List[Any]  				=			'''bertabs'''

							def __init__(							self:     List[str]   ,						UpperCamelCase_:     Dict=30_522   ,						UpperCamelCase_:     Union[str, Any]=512   ,						UpperCamelCase_:     Optional[int]=6   ,						UpperCamelCase_:     int=512   ,						UpperCamelCase_:     Optional[int]=8   ,						UpperCamelCase_:     List[Any]=512   ,						UpperCamelCase_:     Tuple=0.2   ,						UpperCamelCase_:     List[Any]=6   ,						UpperCamelCase_:     Tuple=768   ,						UpperCamelCase_:     List[Any]=8   ,						UpperCamelCase_:     Union[str, Any]=2_048   ,						UpperCamelCase_:     str=0.2   ,						**UpperCamelCase_:     Any   ,						)      ->       List[str]:





									"""simple docstring"""







									super().__init__(**UpperCamelCase_							)

									lowercase__						=				vocab_size
									lowercase__						=				max_pos

									lowercase__						=				enc_layers
									lowercase__						=				enc_hidden_size
									lowercase__						=				enc_heads
									lowercase__						=				enc_ff_size
									lowercase__						=				enc_dropout

									lowercase__						=				dec_layers
									lowercase__						=				dec_hidden_size
									lowercase__						=				dec_heads
									lowercase__						=				dec_ff_size
									lowercase__						=				dec_dropout


