


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


UpperCamelCase					:       Optional[int]			    =     logging.get_logger(__name__)

UpperCamelCase					:       List[str]			    =     {
    """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 A__     ( A__  ):



  """simple docstring"""



  _lowercase									=		'falcon'
  _lowercase									=		['past_key_values']

  def __init__( self			:  Optional[Any]				,				lowerCamelCase__			:  Union[str, Any]=65_024				,				lowerCamelCase__			:  List[Any]=4_544				,				lowerCamelCase__			:  str=32				,				lowerCamelCase__			:  List[Any]=71				,				lowerCamelCase__			:  List[Any]=1E-5				,				lowerCamelCase__			:  List[Any]=0.02				,				lowerCamelCase__			:  Optional[int]=True				,				lowerCamelCase__			:  Optional[int]=0.0				,				lowerCamelCase__			:  Optional[int]=0.0				,				lowerCamelCase__			:  Optional[Any]=None				,				lowerCamelCase__			:  Optional[int]=False				,				lowerCamelCase__			:  Tuple=False				,				lowerCamelCase__			:  List[Any]=True				,				lowerCamelCase__			:  Any=True				,				lowerCamelCase__			:  List[Any]=False				,				lowerCamelCase__			:  int=11				,				lowerCamelCase__			:  List[Any]=11				,				**lowerCamelCase__			:  int				,				):
        a__	:  Any     =   vocab_size
        # Backward compatibility with n_embed kwarg
        a__	:  Dict     =   kwargs.pop("n_embed"				,				lowerCamelCase__       )
        a__	:  str     =   hidden_size if n_embed is None else n_embed
        a__	:  Tuple     =   num_hidden_layers
        a__	:  Dict     =   num_attention_heads
        a__	:  Tuple     =   layer_norm_epsilon
        a__	:  List[str]     =   initializer_range
        a__	:  Dict     =   use_cache
        a__	:  Tuple     =   hidden_dropout
        a__	:  str     =   attention_dropout

        a__	:  str     =   bos_token_id
        a__	:  Any     =   eos_token_id
        a__	:  Tuple     =   num_attention_heads if num_kv_heads is None else num_kv_heads
        a__	:  Union[str, Any]     =   alibi
        a__	:  List[str]     =   new_decoder_architecture
        a__	:  Optional[Any]     =   multi_query  # Ignored when new_decoder_architecture is True
        a__	:  int     =   parallel_attn
        a__	:  Any     =   bias

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

  @property
  def    _UpperCamelCase( self			:  Optional[Any]       ):
        return self.hidden_size // self.num_attention_heads

  @property
  def    _UpperCamelCase( self			:  Dict       ):
        return not self.alibi







'''simple docstring'''







import numpy as np

lowercase      :   str      =       [
    ["""a""", """b""", """c""", """d""", """e"""],
    ["""f""", """g""", """h""", """i""", """k"""],
    ["""l""", """m""", """n""", """o""", """p"""],
    ["""q""", """r""", """s""", """t""", """u"""],
    ["""v""", """w""", """x""", """y""", """z"""],
]







class 					_a :





     '''simple docstring'''



     def __init__(				self							)      ->				None:
          snake_case			:      Dict        =			np.array(__a							)







     def 			snake_case_      (				self							,__a							)      ->				np.ndarray:
          snake_case ,		snake_case			:      Optional[Any]        =			np.where(letter == self.SQUARE							)
          snake_case			:      List[Any]        =			np.concatenate([indexa + 1, indexa + 1]							)
          return indexes







     def 			snake_case_      (				self							,__a							,__a							)      ->				str:
          snake_case			:      List[Any]        =			self.SQUARE[indexa - 1, indexa - 1]
          return letter







     def 			snake_case_      (				self							,__a							)      ->				str:
          snake_case			:      List[Any]        =			message.lower()
          snake_case			:      Dict        =			message.replace(""" """							,""""""							)
          snake_case			:      List[str]        =			message.replace("""j"""							,"""i"""							)

          snake_case			:      Optional[int]        =			np.empty((2, len(__a							))							)
          for letter_index in range(len(__a							)							):
               snake_case			:      Tuple        =			self.letter_to_numbers(message[letter_index]							)

               snake_case			:      Optional[Any]        =			numbers[0]
               snake_case			:      List[str]        =			numbers[1]

          snake_case			:      List[str]        =			first_step.reshape(2 * len(__a							)							)
          snake_case			:      List[Any]        =			""""""
          for numbers_index in range(len(__a							)							):
               snake_case			:      List[str]        =			int(second_step[numbers_index * 2]							)
               snake_case			:      List[Any]        =			int(second_step[(numbers_index * 2) + 1]							)
               snake_case			:      str        =			self.numbers_to_letter(__a							,__a							)
               snake_case			:      Any        =			encoded_message + letter

          return encoded_message







     def 			snake_case_      (				self							,__a							)      ->				str:
          snake_case			:      Any        =			message.lower()
          message.replace(""" """							,""""""							)
          snake_case			:      Dict        =			np.empty(2 * len(__a							)							)
          for letter_index in range(len(__a							)							):
               snake_case			:      str        =			self.letter_to_numbers(message[letter_index]							)
               snake_case			:      Any        =			numbers[0]
               snake_case			:      int        =			numbers[1]

          snake_case			:      List[str]        =			first_step.reshape((2, len(__a							))							)
          snake_case			:      Dict        =			""""""
          for numbers_index in range(len(__a							)							):
               snake_case			:      Optional[Any]        =			int(second_step[0, numbers_index]							)
               snake_case			:      Optional[int]        =			int(second_step[1, numbers_index]							)
               snake_case			:      Tuple        =			self.numbers_to_letter(__a							,__a							)
               snake_case			:      int        =			decoded_message + letter

          return decoded_message



