





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


__A							   =							logging.get_logger(__name__)

__A							   =							{
    "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json",
}



class   _SCREAMING_SNAKE_CASE		(      __SCREAMING_SNAKE_CASE       ):







 '''simple docstring'''
 lowercase_						=     "gpt_bigcode"
 lowercase_						=     ["past_key_values"]
 lowercase_						=     {
     "hidden_size": "n_embd",
     "max_position_embeddings": "n_positions",
     "num_attention_heads": "n_head",
     "num_hidden_layers": "n_layer",
 }

 def __init__(self							:  str			,					UpperCAmelCase_							:  Optional[int]=50_257			,					UpperCAmelCase_							:  List[Any]=1_024			,					UpperCAmelCase_							:  Tuple=768			,					UpperCAmelCase_							:  List[Any]=12			,					UpperCAmelCase_							:  int=12			,					UpperCAmelCase_							:  Tuple=None			,					UpperCAmelCase_							:  Union[str, Any]="gelu_pytorch_tanh"			,					UpperCAmelCase_							:  Union[str, Any]=0.1			,					UpperCAmelCase_							:  Union[str, Any]=0.1			,					UpperCAmelCase_							:  Dict=0.1			,					UpperCAmelCase_							:  Optional[Any]=1E-5			,					UpperCAmelCase_							:  Optional[int]=0.02			,					UpperCAmelCase_							:  List[Any]=True			,					UpperCAmelCase_							:  int=True			,					UpperCAmelCase_							:  List[Any]=50_256			,					UpperCAmelCase_							:  List[str]=50_256			,					UpperCAmelCase_							:  Any=True			,					UpperCAmelCase_							:  List[str]=True			,					UpperCAmelCase_							:  Union[str, Any]=True			,					**UpperCAmelCase_							:  List[str]			,					)			->List[Any]:



   '''simple docstring'''



   lowerCamelCase__: Union[str, Any]         =vocab_size
   lowerCamelCase__: List[Any]         =n_positions
   lowerCamelCase__: List[Any]         =n_embd
   lowerCamelCase__: Tuple         =n_layer
   lowerCamelCase__: Optional[Any]         =n_head
   lowerCamelCase__: Any         =n_inner
   lowerCamelCase__: Optional[int]         =activation_function
   lowerCamelCase__: Any         =resid_pdrop
   lowerCamelCase__: Union[str, Any]         =embd_pdrop
   lowerCamelCase__: Union[str, Any]         =attn_pdrop
   lowerCamelCase__: List[str]         =layer_norm_epsilon
   lowerCamelCase__: List[str]         =initializer_range
   lowerCamelCase__: Optional[int]         =scale_attn_weights
   lowerCamelCase__: List[Any]         =use_cache
   lowerCamelCase__: Any         =attention_softmax_in_fpaa
   lowerCamelCase__: Dict         =scale_attention_softmax_in_fpaa
   lowerCamelCase__: List[Any]         =multi_query

   lowerCamelCase__: Optional[int]         =bos_token_id
   lowerCamelCase__: int         =eos_token_id

   super().__init__(bos_token_id=UpperCAmelCase_			,					eos_token_id=UpperCAmelCase_			,					**UpperCAmelCase_)







'''simple docstring'''






import functools






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   int:
      snake_case__       :   Any	      =    len(__SCREAMING_SNAKE_CASE		)
      snake_case__       :   List[str]	      =    len(__SCREAMING_SNAKE_CASE		)

      @functools.cache
      def min_distance(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		) -> int:
            # if first word index is overflow - delete all from the second word
            if indexa >= len_worda:
                  return len_worda - indexa
            # if second word index is overflow - delete all from the first word
            if indexa >= len_worda:
                  return len_worda - indexa
            snake_case__       :   Union[str, Any]	      =    int(worda[indexa] != worda[indexa]		)  # current letters not identical
            return min(
                1 + min_distance(indexa + 1				,      __SCREAMING_SNAKE_CASE		)				,      1 + min_distance(__SCREAMING_SNAKE_CASE				,      indexa + 1		)				,      diff + min_distance(indexa + 1				,      indexa + 1		)				,      )

      return min_distance(0				,      0		)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
