
'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_lowercase          =						{"""configuration_xlnet""": ["""XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """XLNetConfig"""]}

try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase          =						["""XLNetTokenizer"""]

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase          =						["""XLNetTokenizerFast"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase          =						[
						    """XLNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """XLNetForMultipleChoice""",
						    """XLNetForQuestionAnswering""",
						    """XLNetForQuestionAnsweringSimple""",
						    """XLNetForSequenceClassification""",
						    """XLNetForTokenClassification""",
						    """XLNetLMHeadModel""",
						    """XLNetModel""",
						    """XLNetPreTrainedModel""",
						    """load_tf_weights_in_xlnet""",
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase          =						[
						    """TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """TFXLNetForMultipleChoice""",
						    """TFXLNetForQuestionAnsweringSimple""",
						    """TFXLNetForSequenceClassification""",
						    """TFXLNetForTokenClassification""",
						    """TFXLNetLMHeadModel""",
						    """TFXLNetMainLayer""",
						    """TFXLNetModel""",
						    """TFXLNetPreTrainedModel""",
						]


if TYPE_CHECKING:
						from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig

						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_xlnet import XLNetTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_xlnet_fast import XLNetTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_xlnet import (
												    XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    XLNetForMultipleChoice,
												    XLNetForQuestionAnswering,
												    XLNetForQuestionAnsweringSimple,
												    XLNetForSequenceClassification,
												    XLNetForTokenClassification,
												    XLNetLMHeadModel,
												    XLNetModel,
												    XLNetPreTrainedModel,
												    load_tf_weights_in_xlnet,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_xlnet import (
												    TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFXLNetForMultipleChoice,
												    TFXLNetForQuestionAnsweringSimple,
												    TFXLNetForSequenceClassification,
												    TFXLNetForTokenClassification,
												    TFXLNetLMHeadModel,
												    TFXLNetMainLayer,
												    TFXLNetModel,
												    TFXLNetPreTrainedModel,
												)

else:
						import sys

						_lowercase          =						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





'''simple docstring'''






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


lowerCAmelCase:   Optional[int]					=		logging.get_logger(__name__)

lowerCAmelCase:   int					=		{'ctrl': 'https://huggingface.co/ctrl/resolve/main/config.json'}

class 				a__(   lowerCamelCase__      ):
    lowercase__					=       """ctrl"""
    lowercase__					=       ["""past_key_values"""]
    lowercase__					=       {
        """max_position_embeddings""": """n_positions""",
        """hidden_size""": """n_embd""",
        """num_attention_heads""": """n_head""",
        """num_hidden_layers""": """n_layer""",
    }







    def __init__( self					:    Optional[int]		,     __snake_case					:    Union[str, Any]=24_65_34		,     __snake_case					:    Dict=2_56		,     __snake_case					:    Optional[int]=12_80		,     __snake_case					:    Optional[int]=81_92		,     __snake_case					:    Union[str, Any]=48		,     __snake_case					:    str=16		,     __snake_case					:    Any=0.1		,     __snake_case					:    List[Any]=0.1		,     __snake_case					:    str=1e-6		,     __snake_case					:    List[str]=0.02		,     __snake_case					:    int=True		,     **__snake_case					:    Any		,     ):
      a		:   int	  =	vocab_size
      a		:   Union[str, Any]	  =	n_positions
      a		:   Optional[int]	  =	n_embd
      a		:   Dict	  =	n_layer
      a		:   Union[str, Any]	  =	n_head
      a		:   Tuple	  =	dff
      a		:   Union[str, Any]	  =	resid_pdrop
      a		:   Tuple	  =	embd_pdrop
      a		:   int	  =	layer_norm_epsilon
      a		:   str	  =	initializer_range

      a		:   Any	  =	use_cache

      super().__init__(**__snake_case      )