
"""simple docstring"""


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


SCREAMING_SNAKE_CASE      =     logging.get_logger(__name__)

SCREAMING_SNAKE_CASE      =     {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}



class   __a  (      _lowerCAmelCase	):
       UpperCamelCase_		:					Union[str, Any]   =			'''openai-gpt'''
       UpperCamelCase_		:					Union[str, Any]   =			{
           '''max_position_embeddings''': '''n_positions''',
           '''hidden_size''': '''n_embd''',
           '''num_attention_heads''': '''n_head''',
           '''num_hidden_layers''': '''n_layer''',
       }






       def __init__(  self :							Optional[Any]       ,      UpperCAmelCase_ :							Optional[int]=40_478       ,      UpperCAmelCase_ :							Union[str, Any]=512       ,      UpperCAmelCase_ :							int=768       ,      UpperCAmelCase_ :							List[str]=12       ,      UpperCAmelCase_ :							Optional[int]=12       ,      UpperCAmelCase_ :							Union[str, Any]="gelu"       ,      UpperCAmelCase_ :							Optional[int]=0.1       ,      UpperCAmelCase_ :							str=0.1       ,      UpperCAmelCase_ :							Tuple=0.1       ,      UpperCAmelCase_ :							Dict=1e-5       ,      UpperCAmelCase_ :							List[str]=0.02       ,      UpperCAmelCase_ :							Tuple="cls_index"       ,      UpperCAmelCase_ :							List[str]=True       ,      UpperCAmelCase_ :							Dict=None       ,      UpperCAmelCase_ :							str=True       ,      UpperCAmelCase_ :							Dict=0.1       ,      **UpperCAmelCase_ :							str       ,      )->  Dict:







              """simple docstring"""
              UpperCamelCase					 =		vocab_size
              UpperCamelCase					 =		n_positions
              UpperCamelCase					 =		n_embd
              UpperCamelCase					 =		n_layer
              UpperCamelCase					 =		n_head
              UpperCamelCase					 =		afn
              UpperCamelCase					 =		resid_pdrop
              UpperCamelCase					 =		embd_pdrop
              UpperCamelCase					 =		attn_pdrop
              UpperCamelCase					 =		layer_norm_epsilon
              UpperCamelCase					 =		initializer_range
              UpperCamelCase					 =		summary_type
              UpperCamelCase					 =		summary_use_proj
              UpperCamelCase					 =		summary_activation
              UpperCamelCase					 =		summary_first_dropout
              UpperCamelCase					 =		summary_proj_to_labels
              super().__init__(**UpperCAmelCase_			)







"""simple docstring"""


import copy

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


SCREAMING_SNAKE_CASE      =     logging.get_logger(__name__)



class   __a  (      _lowerCAmelCase	):
       UpperCamelCase_		:					Optional[int]   =			'''upernet'''






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







              """simple docstring"""
              super().__init__(**UpperCAmelCase_			)

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

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






       def 	_SCREAMING_SNAKE_CASE       (  self :							Optional[int]			)->  Dict:







              """simple docstring"""
              UpperCamelCase					 =		copy.deepcopy(self.__dict__			)
              UpperCamelCase					 =		self.backbone_config.to_dict()
              UpperCamelCase					 =		self.__class__.model_type
              return output





