



def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase    ):
    __a							=    0
    __a							=    len(_UpperCAmelCase    ) - 1

    while left <= right:
        # avoid divided by 0 during interpolation
        if sorted_collection[left] == sorted_collection[right]:
            if sorted_collection[left] == item:
                return left
            else:
                return None

        __a							=    left + ((item - sorted_collection[left]) * (right - left)) // (
            sorted_collection[right] - sorted_collection[left]
        )

        # out of range check
        if point < 0 or point >= len(_UpperCAmelCase    ):
            return None

        __a							=    sorted_collection[point]
        if current_item == item:
            return point
        else:
            if point < left:
                __a							=    left
                __a							=    point
            elif point > right:
                __a							=    right
                __a							=    point
            else:
                if item < current_item:
                    __a							=    point - 1
                else:
                    __a							=    point + 1
    return None





def 					__snake_case     (      _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase    ):

    # avoid divided by 0 during interpolation
    if sorted_collection[left] == sorted_collection[right]:
        if sorted_collection[left] == item:
            return left
        else:
            return None

    __a							=    left + ((item - sorted_collection[left]) * (right - left)) // (
        sorted_collection[right] - sorted_collection[left]
    )

    # out of range check
    if point < 0 or point >= len(_UpperCAmelCase    ):
        return None

    if sorted_collection[point] == item:
        return point
    elif point < left:
        return interpolation_search_by_recursion(_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase    )
    elif point > right:
        return interpolation_search_by_recursion(_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase    )
    else:
        if sorted_collection[point] > item:
            return interpolation_search_by_recursion(
                _UpperCAmelCase       ,			_UpperCAmelCase       ,			_UpperCAmelCase       ,			point - 1    )
        else:
            return interpolation_search_by_recursion(
                _UpperCAmelCase       ,			_UpperCAmelCase       ,			point + 1       ,			_UpperCAmelCase    )





def 					__snake_case     (      _UpperCAmelCase    ):
    if collection != sorted(_UpperCAmelCase    ):
        raise ValueError('''Collection must be ascending sorted'''    )
    return True


if __name__ == "__main__":
   import sys
   __snake_case						:Dict						=					0
   if debug == 1:
      __snake_case						:Dict						=					[10, 30, 40, 45, 50, 66, 77, 93]
      try:
         __assert_sorted(collection)
      except ValueError:
         sys.exit('''Sequence must be ascending sorted to apply interpolation search''')
      __snake_case						:List[str]						=					67

   __snake_case						:Dict						=					interpolation_search(collection, target)
   if result is not None:
      print(f'{target} found at positions: {result}')
   else:
      print('''Not found''')










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


__snake_case						:Dict						=					logging.get_logger(__name__)

__snake_case						:List[Any]						=					{
    '''tanreinama/GPTSAN-2.8B-spout_is_uniform''': (
        '''https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json'''
    ),
}

class    _A	(     __UpperCAmelCase   ):
       UpperCamelCase__  :   List[str]						 =						'''gptsan-japanese'''
       UpperCamelCase__  :   Dict						 =						[
           '''past_key_values''',
       ]
       UpperCamelCase__  :   Dict						 =						{
           '''hidden_size''': '''d_model''',
           '''num_attention_heads''': '''num_heads''',
           '''num_hidden_layers''': '''num_layers''',
       }



       def __init__(		self							:					List[str]					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=36_000					,		__SCREAMING_SNAKE_CASE							:					Tuple=1_280					,		__SCREAMING_SNAKE_CASE							:					List[Any]=1_024					,		__SCREAMING_SNAKE_CASE							:					List[Any]=8_192					,		__SCREAMING_SNAKE_CASE							:					str=4_096					,		__SCREAMING_SNAKE_CASE							:					Any=128					,		__SCREAMING_SNAKE_CASE							:					int=10					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=0					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=16					,		__SCREAMING_SNAKE_CASE							:					List[Any]=16					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=128					,		__SCREAMING_SNAKE_CASE							:					Tuple=0.0					,		__SCREAMING_SNAKE_CASE							:					List[Any]=1E-5					,		__SCREAMING_SNAKE_CASE							:					str=False					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=0.0					,		__SCREAMING_SNAKE_CASE							:					List[str]="float32"					,		__SCREAMING_SNAKE_CASE							:					List[str]=False					,		__SCREAMING_SNAKE_CASE							:					Any=False					,		__SCREAMING_SNAKE_CASE							:					Any=False					,		__SCREAMING_SNAKE_CASE							:					int=0.0_02					,		__SCREAMING_SNAKE_CASE							:					Any=False					,		__SCREAMING_SNAKE_CASE							:					Tuple=True					,		__SCREAMING_SNAKE_CASE							:					int=35_998					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=35_995					,		__SCREAMING_SNAKE_CASE							:					List[str]=35_999					,		**__SCREAMING_SNAKE_CASE							:					List[str]					,		):


           '''simple docstring'''

           __a							=    vocab_size
           __a							=    max_position_embeddings
           __a							=    d_model
           __a							=    d_ff
           __a							=    d_ext
           __a							=    d_spout
           __a							=    num_switch_layers
           __a							=    num_ext_layers
           __a							=    num_switch_layers + num_ext_layers
           __a							=    num_heads
           __a							=    num_experts
           __a							=    expert_capacity
           __a							=    dropout_rate
           __a							=    layer_norm_epsilon
           __a							=    router_bias
           __a							=    router_jitter_noise
           __a							=    router_dtype
           __a							=    router_ignore_padding_tokens
           __a							=    output_hidden_states
           __a							=    output_attentions
           __a							=    initializer_factor
           __a							=    output_router_logits
           __a							=    use_cache

           super().__init__(
               separator_token_id=__SCREAMING_SNAKE_CASE					,		pad_token_id=__SCREAMING_SNAKE_CASE					,		eos_token_id=__SCREAMING_SNAKE_CASE					,		**__SCREAMING_SNAKE_CASE					,		)





