



"""simple docstring"""





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


lowerCamelCase      =		logging.get_logger(__name__)

lowerCamelCase      =		{}
class    lowercase__     (					SCREAMING_SNAKE_CASE   ):







       '''simple docstring'''


       UpperCamelCase		=  '''llama'''
       UpperCamelCase		=  ['''past_key_values''']



       def __init__(							self    :						str	,       _UpperCAmelCase    :						Dict=32000	,       _UpperCAmelCase    :						Any=4096	,       _UpperCAmelCase    :						Optional[int]=11008	,       _UpperCAmelCase    :						Any=32	,       _UpperCAmelCase    :						Dict=32	,       _UpperCAmelCase    :						Optional[Any]=None	,       _UpperCAmelCase    :						Dict="silu"	,       _UpperCAmelCase    :						List[str]=2048	,       _UpperCAmelCase    :						List[Any]=0.02	,       _UpperCAmelCase    :						Any=1e-6	,       _UpperCAmelCase    :						List[Any]=True	,       _UpperCAmelCase    :						Optional[Any]=0	,       _UpperCAmelCase    :						Optional[Any]=1	,       _UpperCAmelCase    :						Optional[Any]=2	,       _UpperCAmelCase    :						Optional[int]=1	,       _UpperCAmelCase    :						Optional[int]=False	,       _UpperCAmelCase    :						Optional[int]=None	,       **_UpperCAmelCase    :						Union[str, Any]	,       )				->		Tuple:


             '''simple docstring'''




             UpperCAmelCase_    				=							vocab_size
             UpperCAmelCase_    				=							max_position_embeddings
             UpperCAmelCase_    				=							hidden_size
             UpperCAmelCase_    				=							intermediate_size
             UpperCAmelCase_    				=							num_hidden_layers
             UpperCAmelCase_    				=							num_attention_heads

             # for backward compatibility
             if num_key_value_heads is None:
                   UpperCAmelCase_    				=							num_attention_heads

             UpperCAmelCase_    				=							num_key_value_heads
             UpperCAmelCase_    				=							hidden_act
             UpperCAmelCase_    				=							initializer_range
             UpperCAmelCase_    				=							rms_norm_eps
             UpperCAmelCase_    				=							pretraining_tp
             UpperCAmelCase_    				=							use_cache
             UpperCAmelCase_    				=							rope_scaling
             self._rope_scaling_validation()

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







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


             '''simple docstring'''




             if self.rope_scaling is None:
                   return

             if not isinstance(self.rope_scaling	,       _UpperCAmelCase					) 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_    				=							self.rope_scaling.get("type"	,       _UpperCAmelCase					)
             UpperCAmelCase_    				=							self.rope_scaling.get("factor"	,       _UpperCAmelCase					)
             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(_UpperCAmelCase	,       _UpperCAmelCase					) or rope_scaling_factor <= 1.0:
                   raise ValueError(F"""`rope_scaling`'s factor field must be an float > 1, got {rope_scaling_factor}"""					)









"""simple docstring"""





from __future__ import annotations
def      a__			(   lowerCAmelCase__   ):
      if len(lowerCAmelCase__   ) == 0:
            return []
      UpperCAmelCase_				,					UpperCAmelCase_    				=							min(lowerCAmelCase__   ), max(lowerCAmelCase__   )
      UpperCAmelCase_    				=							int(max_value - min_value   ) + 1
      UpperCAmelCase_    				=							[[] for _ in range(lowerCAmelCase__   )]

      for i in my_list:
            buckets[int(i - min_value   )].append(lowerCAmelCase__   )

      return [v for bucket in buckets for v in sorted(lowerCAmelCase__   )]


if __name__ == "__main__":
  from doctest import testmod

  testmod()
  assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
  assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]




