

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


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

_UpperCAmelCase	:     Dict		       = {
    """tanreinama/GPTSAN-2.8B-spout_is_uniform""": (
        """https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"""
    ),
}







class 				lowercase       ( lowercase_    ):
						__SCREAMING_SNAKE_CASE      :				Union[str, Any]     =    '''gptsan-japanese'''
						__SCREAMING_SNAKE_CASE      :				Optional[Any]     =    [
						    '''past_key_values''',
						]
						__SCREAMING_SNAKE_CASE      :				List[str]     =    {
						    '''hidden_size''': '''d_model''',
						    '''num_attention_heads''': '''num_heads''',
						    '''num_hidden_layers''': '''num_layers''',
						}




						def __init__(      self   ,     snake_case=3_6000   ,     snake_case=1280   ,     snake_case=1024   ,     snake_case=8192   ,     snake_case=4096   ,     snake_case=128   ,     snake_case=10   ,     snake_case=0   ,     snake_case=16   ,     snake_case=16   ,     snake_case=128   ,     snake_case=0.0   ,     snake_case=1e-5   ,     snake_case=False   ,     snake_case=0.0   ,     snake_case="float32"   ,     snake_case=False   ,     snake_case=False   ,     snake_case=False   ,     snake_case=0.0_02   ,     snake_case=False   ,     snake_case=True   ,     snake_case=3_5998   ,     snake_case=3_5995   ,     snake_case=3_5999   ,     **snake_case   ,     ):
													snake_case_           =					vocab_size
													snake_case_           =					max_position_embeddings
													snake_case_           =					d_model
													snake_case_           =					d_ff
													snake_case_           =					d_ext
													snake_case_           =					d_spout
													snake_case_           =					num_switch_layers
													snake_case_           =					num_ext_layers
													snake_case_           =					num_switch_layers + num_ext_layers
													snake_case_           =					num_heads
													snake_case_           =					num_experts
													snake_case_           =					expert_capacity
													snake_case_           =					dropout_rate
													snake_case_           =					layer_norm_epsilon
													snake_case_           =					router_bias
													snake_case_           =					router_jitter_noise
													snake_case_           =					router_dtype
													snake_case_           =					router_ignore_padding_tokens
													snake_case_           =					output_hidden_states
													snake_case_           =					output_attentions
													snake_case_           =					initializer_factor
													snake_case_           =					output_router_logits
													snake_case_           =					use_cache

													super().__init__(
													    separator_token_id=snake_case   ,     pad_token_id=snake_case   ,     eos_token_id=snake_case   ,     **snake_case   ,     )







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




