






'''simple docstring'''





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


_UpperCamelCase		:		Tuple            = logging.get_logger(__name__)

_UpperCamelCase		:		str            = {
    's-JoL/Open-Llama-V1': 'https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json',
}


class       snake_case__	( UpperCamelCase):
					a_								= "open-llama"




					def __init__(   self   :						Any							,      _A   :						List[str]=10_00_00							,      _A   :						Dict=40_96							,      _A   :						Union[str, Any]=1_10_08							,      _A   :						Optional[Any]=32							,      _A   :						str=32							,      _A   :						Union[str, Any]="silu"							,      _A   :						Optional[int]=20_48							,      _A   :						Optional[Any]=0.02							,      _A   :						Optional[int]=1e-6							,      _A   :						Optional[int]=True							,      _A   :						str=0							,      _A   :						Dict=1							,      _A   :						Optional[int]=2							,      _A   :						int=False							,      _A   :						Optional[Any]=True							,      _A   :						int=0.1							,      _A   :						Optional[Any]=0.1							,      _A   :						Dict=True							,      _A   :						int=True							,      _A   :						Any=None							,      **_A   :						Optional[int]							,      )  ->				Tuple:
								UpperCAmelCase_	:    Optional[int]	  =    vocab_size
								UpperCAmelCase_	:    Optional[Any]	  =    max_position_embeddings
								UpperCAmelCase_	:    Dict	  =    hidden_size
								UpperCAmelCase_	:    Optional[Any]	  =    intermediate_size
								UpperCAmelCase_	:    Optional[Any]	  =    num_hidden_layers
								UpperCAmelCase_	:    Any	  =    num_attention_heads
								UpperCAmelCase_	:    Optional[int]	  =    hidden_act
								UpperCAmelCase_	:    str	  =    initializer_range
								UpperCAmelCase_	:    Dict	  =    rms_norm_eps
								UpperCAmelCase_	:    List[str]	  =    use_cache
								UpperCAmelCase_	:    Tuple	  =    kwargs.pop(
								    '''use_memorry_efficient_attention'''							,      _A	)
								UpperCAmelCase_	:    Union[str, Any]	  =    hidden_dropout_prob
								UpperCAmelCase_	:    Any	  =    attention_dropout_prob
								UpperCAmelCase_	:    List[str]	  =    use_stable_embedding
								UpperCAmelCase_	:    Optional[int]	  =    shared_input_output_embedding
								UpperCAmelCase_	:    Any	  =    rope_scaling
								self._rope_scaling_validation()

								super().__init__(
								    pad_token_id=_A							,      bos_token_id=_A							,      eos_token_id=_A							,      tie_word_embeddings=_A							,      **_A							,      )





					def 						A	(   self   :						Tuple	)  ->				Union[str, Any]:






								if self.rope_scaling is None:
											return

								if not isinstance(self.rope_scaling							,      _A	) or len(self.rope_scaling	) != 2:
											raise ValueError(
											    '''`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '''
											    F"got {self.rope_scaling}"	)
								UpperCAmelCase_	:    List[Any]	  =    self.rope_scaling.get('''type'''							,      _A	)
								UpperCAmelCase_	:    Union[str, Any]	  =    self.rope_scaling.get('''factor'''							,      _A	)
								if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
											raise ValueError(
											    F"`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}"	)
								if rope_scaling_factor is None or not isinstance(_A							,      _A	) or rope_scaling_factor <= 1.0:
											raise ValueError(F"`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}"	)





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__)


