

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


__UpperCAmelCase     :   Any    				=     logging.get_logger(__name__)

__UpperCAmelCase     :   List[Any]    				=     {'openai-gpt': 'https://huggingface.co/openai-gpt/resolve/main/config.json'}





class A__    ( __SCREAMING_SNAKE_CASE ):



 """simple docstring"""







 _lowercase     :					Optional[Any]      =						'''openai-gpt'''
 _lowercase     :					str      =						{
     '''max_position_embeddings''': '''n_positions''',
     '''hidden_size''': '''n_embd''',
     '''num_attention_heads''': '''n_head''',
     '''num_hidden_layers''': '''n_layer''',
 }

 def __init__(		self :	List[str]     ,						A_ :	Any=4_0_4_7_8     ,						A_ :	Any=5_1_2     ,						A_ :	str=7_6_8     ,						A_ :	List[Any]=1_2     ,						A_ :	Union[str, Any]=1_2     ,						A_ :	Optional[Any]="gelu"     ,						A_ :	Optional[int]=0.1     ,						A_ :	Dict=0.1     ,						A_ :	List[str]=0.1     ,						A_ :	Optional[int]=1E-5     ,						A_ :	Any=0.02     ,						A_ :	Dict="cls_index"     ,						A_ :	str=True     ,						A_ :	int=None     ,						A_ :	Union[str, Any]=True     ,						A_ :	Tuple=0.1     ,						**A_ :	List[Any]     ,						):






      '''simple docstring'''




      _lowerCAmelCase   :					Union[str, Any]        =    vocab_size
      _lowerCAmelCase   :					str        =    n_positions
      _lowerCAmelCase   :					Tuple        =    n_embd
      _lowerCAmelCase   :					Any        =    n_layer
      _lowerCAmelCase   :					Union[str, Any]        =    n_head
      _lowerCAmelCase   :					Optional[int]        =    afn
      _lowerCAmelCase   :					List[str]        =    resid_pdrop
      _lowerCAmelCase   :					Dict        =    embd_pdrop
      _lowerCAmelCase   :					str        =    attn_pdrop
      _lowerCAmelCase   :					Optional[int]        =    layer_norm_epsilon
      _lowerCAmelCase   :					Dict        =    initializer_range
      _lowerCAmelCase   :					Tuple        =    summary_type
      _lowerCAmelCase   :					int        =    summary_use_proj
      _lowerCAmelCase   :					Dict        =    summary_activation
      _lowerCAmelCase   :					Any        =    summary_first_dropout
      _lowerCAmelCase   :					Optional[int]        =    summary_proj_to_labels
      super().__init__(**_a       )









from typing import TYPE_CHECKING

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


__UpperCAmelCase    				=     {
    'configuration_ernie': ['ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ErnieConfig', 'ErnieOnnxConfig'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase    				=     [
      'ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST',
      'ErnieForCausalLM',
      'ErnieForMaskedLM',
      'ErnieForMultipleChoice',
      'ErnieForNextSentencePrediction',
      'ErnieForPreTraining',
      'ErnieForQuestionAnswering',
      'ErnieForSequenceClassification',
      'ErnieForTokenClassification',
      'ErnieModel',
      'ErniePreTrainedModel',
  ]

if TYPE_CHECKING:
  from .configuration_ernie import ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP, ErnieConfig, ErnieOnnxConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_ernie import (
        ERNIE_PRETRAINED_MODEL_ARCHIVE_LIST,
        ErnieForCausalLM,
        ErnieForMaskedLM,
        ErnieForMultipleChoice,
        ErnieForNextSentencePrediction,
        ErnieForPreTraining,
        ErnieForQuestionAnswering,
        ErnieForSequenceClassification,
        ErnieForTokenClassification,
        ErnieModel,
        ErniePreTrainedModel,
    )

else:
  import sys

  __UpperCAmelCase    				=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






