





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


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

__lowercase	: Optional[int]       ={"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}

class   A							(						__lowercase    ):
      _snake_case				  ='''openai-gpt'''
      _snake_case				  ={
          '''max_position_embeddings''': '''n_positions''',
          '''hidden_size''': '''n_embd''',
          '''num_attention_heads''': '''n_head''',
          '''num_hidden_layers''': '''n_layer''',
      }



      def __init__(						self:    List[str]		,	_lowerCAmelCase:    List[str]=4_0478		,	_lowerCAmelCase:    Any=512		,	_lowerCAmelCase:    Optional[Any]=768		,	_lowerCAmelCase:    str=12		,	_lowerCAmelCase:    str=12		,	_lowerCAmelCase:    Any="gelu"		,	_lowerCAmelCase:    str=0.1		,	_lowerCAmelCase:    Optional[int]=0.1		,	_lowerCAmelCase:    str=0.1		,	_lowerCAmelCase:    Optional[Any]=1e-5		,	_lowerCAmelCase:    Optional[int]=0.02		,	_lowerCAmelCase:    Dict="cls_index"		,	_lowerCAmelCase:    List[Any]=True		,	_lowerCAmelCase:    List[Any]=None		,	_lowerCAmelCase:    Tuple=True		,	_lowerCAmelCase:    List[str]=0.1		,	**_lowerCAmelCase:    int		,	)    ->     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__(**_lowerCAmelCase							)








SCREAMING_SNAKE_CASE__					:     dict[str, float]       =     {
    "joule": 1.0,
    "kilojoule": 1_000,
    "megajoule": 1_000_000,
    "gigajoule": 1_000_000_000,
    "wattsecond": 1.0,
    "watthour": 3_600,
    "kilowatthour": 3_600_000,
    "newtonmeter": 1.0,
    "calorie_nutr": 4_186.8,
    "kilocalorie_nutr": 4_186_800.00,
    "electronvolt": 1.602176634e-19,
    "britishthermalunit_it": 1_055.05_585,
    "footpound": 1.355_818,
}




def    a__    (		snake_case__					:							str						,   snake_case__					:							str						,   snake_case__					:							float     ):
  if to_type not in ENERGY_CONVERSION or from_type not in ENERGY_CONVERSION:
    _UpperCAmelCase		:							Optional[Any]							=     (
        f'''Incorrect \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'''
        f'''Valid values are: {", ".join(snake_case__     )}'''
    )
    raise ValueError(snake_case__     )
  return value * ENERGY_CONVERSION[from_type] / ENERGY_CONVERSION[to_type]


if __name__ == "__main__":
 import doctest

 doctest.testmod()





