




"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available


a_				:    Union[str, Any]							=     {
    '''configuration_gpt_neo''': ['''GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GPTNeoConfig''', '''GPTNeoOnnxConfig'''],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					a_				:    str							=     [
					    '''GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''GPTNeoForCausalLM''',
					    '''GPTNeoForQuestionAnswering''',
					    '''GPTNeoForSequenceClassification''',
					    '''GPTNeoForTokenClassification''',
					    '''GPTNeoModel''',
					    '''GPTNeoPreTrainedModel''',
					    '''load_tf_weights_in_gpt_neo''',
					]

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					a_				:    Optional[int]							=     [
					    '''FlaxGPTNeoForCausalLM''',
					    '''FlaxGPTNeoModel''',
					    '''FlaxGPTNeoPreTrainedModel''',
					]


if TYPE_CHECKING:
					from .configuration_gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig, GPTNeoOnnxConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_gpt_neo import (
										    GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST,
										    GPTNeoForCausalLM,
										    GPTNeoForQuestionAnswering,
										    GPTNeoForSequenceClassification,
										    GPTNeoForTokenClassification,
										    GPTNeoModel,
										    GPTNeoPreTrainedModel,
										    load_tf_weights_in_gpt_neo,
										)

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_gpt_neo import FlaxGPTNeoForCausalLM, FlaxGPTNeoModel, FlaxGPTNeoPreTrainedModel


else:
					import sys

					a_				:    Any							=     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)









"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


a_				:    Tuple										=     logging.get_logger(__name__)

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

class __lowercase(      lowercase__				):




					'''simple docstring'''


					__a						:						Union[str, Any]     		= 'openai-gpt'
					__a						:						List[Any]     		= {
					    'max_position_embeddings': 'n_positions',
					    'hidden_size': 'n_embd',
					    'num_attention_heads': 'n_head',
					    'num_hidden_layers': 'n_layer',
					}
					def __init__(    self						,	__a=40478						,	__a=512						,	__a=768						,	__a=12						,	__a=12						,	__a="gelu"						,	__a=0.1						,	__a=0.1						,	__a=0.1						,	__a=1E-5						,	__a=0.02						,	__a="cls_index"						,	__a=True						,	__a=None						,	__a=True						,	__a=0.1						,	**__a						,	):
								__lowerCamelCase					:	List[str]	       =				vocab_size
								__lowerCamelCase					:	Union[str, Any]	       =				n_positions
								__lowerCamelCase					:	Optional[Any]	       =				n_embd
								__lowerCamelCase					:	int	       =				n_layer
								__lowerCamelCase					:	List[str]	       =				n_head
								__lowerCamelCase					:	Dict	       =				afn
								__lowerCamelCase					:	Optional[Any]	       =				resid_pdrop
								__lowerCamelCase					:	int	       =				embd_pdrop
								__lowerCamelCase					:	int	       =				attn_pdrop
								__lowerCamelCase					:	Dict	       =				layer_norm_epsilon
								__lowerCamelCase					:	List[str]	       =				initializer_range
								__lowerCamelCase					:	Any	       =				summary_type
								__lowerCamelCase					:	Tuple	       =				summary_use_proj
								__lowerCamelCase					:	List[Any]	       =				summary_activation
								__lowerCamelCase					:	str	       =				summary_first_dropout
								__lowerCamelCase					:	Tuple	       =				summary_proj_to_labels
								super().__init__(**__a     )



