



UpperCAmelCase_		 =					{
    """meter""": """m""",
    """kilometer""": """km""",
    """megametre""": """Mm""",
    """gigametre""": """Gm""",
    """terametre""": """Tm""",
    """petametre""": """Pm""",
    """exametre""": """Em""",
    """zettametre""": """Zm""",
    """yottametre""": """Ym""",
}
# Exponent of the factor(meter)
UpperCAmelCase_		 =					{
    """m""": 0,
    """km""": 3,
    """Mm""": 6,
    """Gm""": 9,
    """Tm""": 1_2,
    """Pm""": 1_5,
    """Em""": 1_8,
    """Zm""": 2_1,
    """Ym""": 2_4,
}

def 	SCREAMING_SNAKE_CASE_							(	_snake_case	:float	,   _snake_case	:str	,   _snake_case	:str				)  ->     float:
   _A      =       from_type.lower().strip('''s'''				)
   _A      =       to_type.lower().strip('''s'''				)

   _A      =       UNIT_SYMBOL.get(_snake_case	,   _snake_case				)
   _A      =       UNIT_SYMBOL.get(_snake_case	,   _snake_case				)

   if from_sanitized not in METRIC_CONVERSION:
      _A      =       (
          F'''Invalid \'from_type\' value: {from_type!r}.\n'''
          F'''Conversion abbreviations are: {', '.join(_snake_case				)}'''
      )
      raise ValueError(_snake_case				)
   if to_sanitized not in METRIC_CONVERSION:
      _A      =       (
          F'''Invalid \'to_type\' value: {to_type!r}.\n'''
          F'''Conversion abbreviations are: {', '.join(_snake_case				)}'''
      )
      raise ValueError(_snake_case				)
   _A      =       METRIC_CONVERSION[from_sanitized]
   _A      =       METRIC_CONVERSION[to_sanitized]
   _A      =       1

   if from_exponent > to_exponent:
      _A      =       from_exponent - to_exponent
   else:
      _A      =       -(to_exponent - from_exponent)

   return value * pow(10	,   _snake_case				)


if __name__ == "__main__":
   from doctest import testmod

   testmod()








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


UpperCAmelCase_		 =					logging.get_logger(__name__)

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


class 	lowerCamelCase__	(       _A):



 """simple docstring"""

 a__					: int =  "openai-gpt"
 a__					: Dict =  {
     "max_position_embeddings": "n_positions",
     "hidden_size": "n_embd",
     "num_attention_heads": "n_head",
     "num_hidden_layers": "n_layer",
 }

 def __init__(    self					:					Union[str, Any]			,						__lowerCAmelCase					:					int=4_04_78			,						__lowerCAmelCase					:					Tuple=5_12			,						__lowerCAmelCase					:					str=7_68			,						__lowerCAmelCase					:					List[Any]=12			,						__lowerCAmelCase					:					Any=12			,						__lowerCAmelCase					:					Dict="gelu"			,						__lowerCAmelCase					:					Union[str, Any]=0.1			,						__lowerCAmelCase					:					Optional[int]=0.1			,						__lowerCAmelCase					:					Any=0.1			,						__lowerCAmelCase					:					List[str]=1E-5			,						__lowerCAmelCase					:					Optional[int]=0.02			,						__lowerCAmelCase					:					Optional[Any]="cls_index"			,						__lowerCAmelCase					:					str=True			,						__lowerCAmelCase					:					int=None			,						__lowerCAmelCase					:					Optional[int]=True			,						__lowerCAmelCase					:					Optional[Any]=0.1			,						**__lowerCAmelCase					:					Tuple			,						)   ->	Optional[Any]:
    _A      =       vocab_size
    _A      =       n_positions
    _A      =       n_embd
    _A      =       n_layer
    _A      =       n_head
    _A      =       afn
    _A      =       resid_pdrop
    _A      =       embd_pdrop
    _A      =       attn_pdrop
    _A      =       layer_norm_epsilon
    _A      =       initializer_range
    _A      =       summary_type
    _A      =       summary_use_proj
    _A      =       summary_activation
    _A      =       summary_first_dropout
    _A      =       summary_proj_to_labels
    super().__init__(**__lowerCAmelCase      )



