

"""simple docstring"""






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


__lowerCamelCase										=		logging.get_logger(__name__)

__lowerCamelCase										=		{
    "tiiuae/falcon-40b": "https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json",
    "tiiuae/falcon-7b": "https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json",
}
class        _lowercase					(     __UpperCAmelCase     ):
     _lowerCamelCase     =       '''falcon'''
     _lowerCamelCase     =       ['''past_key_values''']







     def __init__(      self ,						UpperCamelCase_=6_5024 ,						UpperCamelCase_=4544 ,						UpperCamelCase_=32 ,						UpperCamelCase_=71 ,						UpperCamelCase_=1E-5 ,						UpperCamelCase_=0.0_2 ,						UpperCamelCase_=True ,						UpperCamelCase_=0.0 ,						UpperCamelCase_=0.0 ,						UpperCamelCase_=None ,						UpperCamelCase_=False ,						UpperCamelCase_=False ,						UpperCamelCase_=True ,						UpperCamelCase_=True ,						UpperCamelCase_=False ,						UpperCamelCase_=11 ,						UpperCamelCase_=11 ,						**UpperCamelCase_ ,						):
      __magic_name__     =      vocab_size
      # Backward compatibility with n_embed kwarg
      __magic_name__     =      kwargs.pop('''n_embed''' ,						UpperCAmelCase__       )
      __magic_name__     =      hidden_size if n_embed is None else n_embed
      __magic_name__     =      num_hidden_layers
      __magic_name__     =      num_attention_heads
      __magic_name__     =      layer_norm_epsilon
      __magic_name__     =      initializer_range
      __magic_name__     =      use_cache
      __magic_name__     =      hidden_dropout
      __magic_name__     =      attention_dropout

      __magic_name__     =      bos_token_id
      __magic_name__     =      eos_token_id
      __magic_name__     =      num_attention_heads if num_kv_heads is None else num_kv_heads
      __magic_name__     =      alibi
      __magic_name__     =      new_decoder_architecture
      __magic_name__     =      multi_query  # Ignored when new_decoder_architecture is True
      __magic_name__     =      parallel_attn
      __magic_name__     =      bias

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







     @property
     def 	lowerCAmelCase__    (      self       ):
      return self.hidden_size // self.num_attention_heads







     @property
     def 	lowerCAmelCase__    (      self       ):
      return not self.alibi





"""simple docstring"""






class        _lowercase					:







     def __init__(      self ,						UpperCamelCase_       ):
      __magic_name__     =      size
      __magic_name__     =      [0] * size
      __magic_name__     =      [0] * size







     @staticmethod
     def 	lowerCAmelCase__    (      UpperCamelCase_       ):
      return index | (index + 1)







     @staticmethod
     def 	lowerCAmelCase__    (      UpperCamelCase_       ):
      return (index & (index + 1)) - 1







     def 	lowerCAmelCase__    (      self ,						UpperCamelCase_ ,						UpperCamelCase_       ):
      __magic_name__     =      value
      while index < self.size:
       __magic_name__     =      self.get_prev(UpperCamelCase_       ) + 1
       if current_left_border == index:
        __magic_name__     =      value
       else:
        __magic_name__     =      max(UpperCamelCase_ ,						UpperCamelCase_ ,						UpperCamelCase_       )
       __magic_name__     =      self.get_next(UpperCamelCase_       )







     def 	lowerCAmelCase__    (      self ,						UpperCamelCase_ ,						UpperCamelCase_       ):
      right -= 1  # Because of right is exclusive
      __magic_name__     =      0
      while left <= right:
       __magic_name__     =      self.get_prev(UpperCamelCase_       )
       if left <= current_left:
        __magic_name__     =      max(UpperCamelCase_ ,						self.tree[right]       )
        __magic_name__     =      current_left
       else:
        __magic_name__     =      max(UpperCamelCase_ ,						self.arr[right]       )
        right -= 1
      return result


if __name__ == "__main__":
 import doctest

 doctest.testmod()

