




import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


__a							     =					'scheduler_config.json'

class     __a(	_a  ):






    """simple docstring"""





    lowerCAmelCase         = 1
    lowerCAmelCase         = 2
    lowerCAmelCase         = 3
    lowerCAmelCase         = 4
    lowerCAmelCase         = 5
    lowerCAmelCase         = 6
    lowerCAmelCase         = 7
    lowerCAmelCase         = 8
    lowerCAmelCase         = 9
    lowerCAmelCase         = 10
    lowerCAmelCase         = 11
    lowerCAmelCase         = 12
    lowerCAmelCase         = 13
    lowerCAmelCase         = 14


@dataclass
class     __a(	_a  ):






    """simple docstring"""





    lowerCAmelCase         = 42


class     __a:






    """simple docstring"""





    lowerCAmelCase         = SCHEDULER_CONFIG_NAME
    lowerCAmelCase         = []
    lowerCAmelCase         = True





    @classmethod
    def 				a__ ( cls  ,_SCREAMING_SNAKE_CASE = None  ,_SCREAMING_SNAKE_CASE = None  ,_SCREAMING_SNAKE_CASE=False  ,**_SCREAMING_SNAKE_CASE  ,)					->						List[str]:
         UpperCAmelCase_,       UpperCAmelCase_,       UpperCAmelCase_     :				str  =     cls.load_config(
             pretrained_model_name_or_path=_SCREAMING_SNAKE_CASE  ,subfolder=_SCREAMING_SNAKE_CASE  ,return_unused_kwargs=_SCREAMING_SNAKE_CASE  ,return_commit_hash=_SCREAMING_SNAKE_CASE  ,**_SCREAMING_SNAKE_CASE  ,)
         return cls.from_config(_SCREAMING_SNAKE_CASE  ,return_unused_kwargs=_SCREAMING_SNAKE_CASE  ,**_SCREAMING_SNAKE_CASE    )





    def 				a__ ( self  ,_SCREAMING_SNAKE_CASE  ,_SCREAMING_SNAKE_CASE = False  ,**_SCREAMING_SNAKE_CASE    )					->						Dict:
         self.save_config(save_directory=_SCREAMING_SNAKE_CASE  ,push_to_hub=_SCREAMING_SNAKE_CASE  ,**_SCREAMING_SNAKE_CASE    )





    @property
    def 				a__ ( self    )					->						Tuple:
         return self._get_compatibles()





    @classmethod
    def 				a__ ( cls    )					->						Optional[Any]:
         UpperCAmelCase_     :				int  =     list(set([cls.__name__] + cls._compatibles    )    )
         UpperCAmelCase_     :				int  =     importlib.import_module(__name__.split('''.'''    )[0]    )
         UpperCAmelCase_     :				Any  =     [
             getattr(_SCREAMING_SNAKE_CASE  ,_SCREAMING_SNAKE_CASE    ) for c in compatible_classes_str if hasattr(_SCREAMING_SNAKE_CASE  ,_SCREAMING_SNAKE_CASE    )
         ]
         return compatible_classes




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


__snake_case     :List[str]			       =logging.get_logger(__name__)

__snake_case     :int			       ={'openai-gpt': 'https://huggingface.co/openai-gpt/resolve/main/config.json'}



class        lowerCAmelCase__					(  _lowerCamelCase       ):
				A_   :     Optional[Any]								=     'openai-gpt'
				A_   :     Any								=     {
				    'max_position_embeddings': 'n_positions',
				    'hidden_size': 'n_embd',
				    'num_attention_heads': 'n_head',
				    'num_hidden_layers': 'n_layer',
				}


				def __init__(							self      :  List[Any]						, __UpperCamelCase      :  List[str]=40_478						, __UpperCamelCase      :  List[Any]=512						, __UpperCamelCase      :  List[Any]=768						, __UpperCamelCase      :  Optional[int]=12						, __UpperCamelCase      :  Dict=12						, __UpperCamelCase      :  List[str]="gelu"						, __UpperCamelCase      :  str=0.1						, __UpperCamelCase      :  Optional[Any]=0.1						, __UpperCamelCase      :  Union[str, Any]=0.1						, __UpperCamelCase      :  List[str]=1e-5						, __UpperCamelCase      :  List[Any]=0.0_2						, __UpperCamelCase      :  str="cls_index"						, __UpperCamelCase      :  int=True						, __UpperCamelCase      :  int=None						, __UpperCamelCase      :  Optional[int]=True						, __UpperCamelCase      :  Tuple=0.1						, **__UpperCamelCase      :  List[Any]						, )		->     List[str]:
											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__(**__UpperCamelCase       )