


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


UpperCamelCase					:       Any			    =     logging.get_logger(__name__)

UpperCamelCase					:       int			    =     {}



class A__     ( A__  ):



  """simple docstring"""



  _lowercase									=		'llama'
  _lowercase									=		['past_key_values']

  def __init__( self			:  Dict				,				lowerCamelCase__			:  str=32_000				,				lowerCamelCase__			:  Dict=4_096				,				lowerCamelCase__			:  Tuple=11_008				,				lowerCamelCase__			:  str=32				,				lowerCamelCase__			:  Tuple=32				,				lowerCamelCase__			:  int=None				,				lowerCamelCase__			:  Union[str, Any]="silu"				,				lowerCamelCase__			:  Any=2_048				,				lowerCamelCase__			:  Tuple=0.02				,				lowerCamelCase__			:  Dict=1E-6				,				lowerCamelCase__			:  int=True				,				lowerCamelCase__			:  List[Any]=0				,				lowerCamelCase__			:  Optional[int]=1				,				lowerCamelCase__			:  List[str]=2				,				lowerCamelCase__			:  Optional[int]=1				,				lowerCamelCase__			:  Tuple=False				,				lowerCamelCase__			:  Optional[int]=None				,				**lowerCamelCase__			:  Union[str, Any]				,				):
        a__	:  List[str]     =   vocab_size
        a__	:  str     =   max_position_embeddings
        a__	:  Dict     =   hidden_size
        a__	:  List[str]     =   intermediate_size
        a__	:  Dict     =   num_hidden_layers
        a__	:  Optional[Any]     =   num_attention_heads

        # for backward compatibility
        if num_key_value_heads is None:
              a__	:  Tuple     =   num_attention_heads

        a__	:  str     =   num_key_value_heads
        a__	:  Dict     =   hidden_act
        a__	:  Optional[int]     =   initializer_range
        a__	:  str     =   rms_norm_eps
        a__	:  Optional[Any]     =   pretraining_tp
        a__	:  int     =   use_cache
        a__	:  Union[str, Any]     =   rope_scaling
        self._rope_scaling_validation()

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

  def    _UpperCamelCase( self			:  Any       ):
        if self.rope_scaling is None:
              return

        if not isinstance(self.rope_scaling				,				lowerCamelCase__       ) 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}'''       )
        a__	:  Tuple     =   self.rope_scaling.get("type"				,				lowerCamelCase__       )
        a__	:  Tuple     =   self.rope_scaling.get("factor"				,				lowerCamelCase__       )
        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(lowerCamelCase__				,				lowerCamelCase__       ) 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_torch_available


__a    :	Tuple         =    {
    """configuration_luke""": ["""LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LukeConfig"""],
    """tokenization_luke""": ["""LukeTokenizer"""],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__a    :	Dict         =    [
		    """LUKE_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """LukeForEntityClassification""",
		    """LukeForEntityPairClassification""",
		    """LukeForEntitySpanClassification""",
		    """LukeForMultipleChoice""",
		    """LukeForQuestionAnswering""",
		    """LukeForSequenceClassification""",
		    """LukeForTokenClassification""",
		    """LukeForMaskedLM""",
		    """LukeModel""",
		    """LukePreTrainedModel""",
		]


if TYPE_CHECKING:
		from .configuration_luke import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig
		from .tokenization_luke import LukeTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_luke import (
				    LUKE_PRETRAINED_MODEL_ARCHIVE_LIST,
				    LukeForEntityClassification,
				    LukeForEntityPairClassification,
				    LukeForEntitySpanClassification,
				    LukeForMaskedLM,
				    LukeForMultipleChoice,
				    LukeForQuestionAnswering,
				    LukeForSequenceClassification,
				    LukeForTokenClassification,
				    LukeModel,
				    LukePreTrainedModel,
				)

else:
		import sys

		__a    :	Any         =    _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)