





'''simple docstring'''


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


lowerCAmelCase :					int 							=logging.get_logger(__name__)

lowerCAmelCase :					Dict 							={
    's-JoL/Open-Llama-V1': 'https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json',
}
class 				a_       (    _UpperCamelCase							):
     __A								=      'open-llama'





     def __init__(			self		: Tuple     ,				lowercase		: List[str]=100_000     ,				lowercase		: List[Any]=4_096     ,				lowercase		: Any=11_008     ,				lowercase		: Optional[int]=32     ,				lowercase		: List[str]=32     ,				lowercase		: List[str]="silu"     ,				lowercase		: Any=2_048     ,				lowercase		: Dict=0.02     ,				lowercase		: str=1e-6     ,				lowercase		: Union[str, Any]=True     ,				lowercase		: Any=0     ,				lowercase		: int=1     ,				lowercase		: Dict=2     ,				lowercase		: Tuple=False     ,				lowercase		: int=True     ,				lowercase		: Tuple=0.1     ,				lowercase		: int=0.1     ,				lowercase		: Tuple=True     ,				lowercase		: str=True     ,				lowercase		: List[Any]=None     ,				**lowercase		: Any     ,				):





        """simple docstring"""




        lowercase_      :Optional[Any]         =			vocab_size
        lowercase_      :Union[str, Any]         =			max_position_embeddings
        lowercase_      :int         =			hidden_size
        lowercase_      :Any         =			intermediate_size
        lowercase_      :List[Any]         =			num_hidden_layers
        lowercase_      :Optional[Any]         =			num_attention_heads
        lowercase_      :int         =			hidden_act
        lowercase_      :List[str]         =			initializer_range
        lowercase_      :Optional[Any]         =			rms_norm_eps
        lowercase_      :Tuple         =			use_cache
        lowercase_      :List[Any]         =			kwargs.pop(
            "use_memorry_efficient_attention"     ,				_SCREAMING_SNAKE_CASE						)
        lowercase_      :List[Any]         =			hidden_dropout_prob
        lowercase_      :Dict         =			attention_dropout_prob
        lowercase_      :int         =			use_stable_embedding
        lowercase_      :Any         =			shared_input_output_embedding
        lowercase_      :Tuple         =			rope_scaling
        self._rope_scaling_validation()

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







     def 							lowercase__				(			self		: Optional[int]						):





        """simple docstring"""




        if self.rope_scaling is None:
           return

        if not isinstance(self.rope_scaling     ,				_SCREAMING_SNAKE_CASE						) 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}'						)
        lowercase_      :Union[str, Any]         =			self.rope_scaling.get("type"     ,				_SCREAMING_SNAKE_CASE						)
        lowercase_      :List[Any]         =			self.rope_scaling.get("factor"     ,				_SCREAMING_SNAKE_CASE						)
        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(_SCREAMING_SNAKE_CASE     ,				_SCREAMING_SNAKE_CASE						) 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'''


def 							UpperCAmelCase_  (						__lowerCamelCase : str     ,__lowerCamelCase : str			):
   lowercase_      :Optional[Any]         =			len(__lowerCamelCase			)
   lowercase_      :List[Any]         =			[]
   for i in range(len(__lowerCamelCase			) - pat_len + 1			):
      lowercase_      :Dict         =			True
      for j in range(__lowerCamelCase			):
         if s[i + j] != pattern[j]:
            lowercase_      :int         =			False
            break
      if match_found:
         position.append(__lowerCamelCase			)
   return position


if __name__ == "__main__":
 assert naive_pattern_search('''ABCDEFG''', '''DE''') == [3]
 print(naive_pattern_search('''ABAAABCDBBABCDDEBCABC''', '''ABC'''))


