
'''simple docstring'''

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


UpperCAmelCase__ :			Optional[Any]											=		logging.get_logger(__name__)

UpperCAmelCase__ :			List[Any]											=		{
    "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  (						SCREAMING_SNAKE_CASE__     ):
	snake_case__   :str   =  'falcon'
	snake_case__   :Optional[Any]   =  ['past_key_values']





	def __init__(       self      :							int   ,				__magic_name__      :							Dict=65024   ,				__magic_name__      :							Tuple=4544   ,				__magic_name__      :							Union[str, Any]=32   ,				__magic_name__      :							List[Any]=71   ,				__magic_name__      :							Tuple=1E-5   ,				__magic_name__      :							List[str]=0.02   ,				__magic_name__      :							Optional[Any]=True   ,				__magic_name__      :							List[str]=0.0   ,				__magic_name__      :							Dict=0.0   ,				__magic_name__      :							Any=None   ,				__magic_name__      :							Optional[int]=False   ,				__magic_name__      :							List[Any]=False   ,				__magic_name__      :							Optional[Any]=True   ,				__magic_name__      :							Tuple=True   ,				__magic_name__      :							int=False   ,				__magic_name__      :							Optional[Any]=11   ,				__magic_name__      :							Dict=11   ,				**__magic_name__      :							List[Any]   ,				):


				"""simple docstring"""

				lowerCAmelCase__										=				vocab_size
				# Backward compatibility with n_embed kwarg
				lowerCAmelCase__										=				kwargs.pop("n_embed"   ,				__magic_name__				)
				lowerCAmelCase__										=				hidden_size if n_embed is None else n_embed
				lowerCAmelCase__										=				num_hidden_layers
				lowerCAmelCase__										=				num_attention_heads
				lowerCAmelCase__										=				layer_norm_epsilon
				lowerCAmelCase__										=				initializer_range
				lowerCAmelCase__										=				use_cache
				lowerCAmelCase__										=				hidden_dropout
				lowerCAmelCase__										=				attention_dropout

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

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





	@property
	def 				__SCREAMING_SNAKE_CASE	(       self      :							Optional[Any]				):


				"""simple docstring"""

				return self.hidden_size // self.num_attention_heads







	@property
	def 				__SCREAMING_SNAKE_CASE	(       self      :							List[str]				):


				"""simple docstring"""

				return not self.alibi









__snake_case   							=						{
    '''a''': '''AAAAA''',
    '''b''': '''AAAAB''',
    '''c''': '''AAABA''',
    '''d''': '''AAABB''',
    '''e''': '''AABAA''',
    '''f''': '''AABAB''',
    '''g''': '''AABBA''',
    '''h''': '''AABBB''',
    '''i''': '''ABAAA''',
    '''j''': '''BBBAA''',
    '''k''': '''ABAAB''',
    '''l''': '''ABABA''',
    '''m''': '''ABABB''',
    '''n''': '''ABBAA''',
    '''o''': '''ABBAB''',
    '''p''': '''ABBBA''',
    '''q''': '''ABBBB''',
    '''r''': '''BAAAA''',
    '''s''': '''BAAAB''',
    '''t''': '''BAABA''',
    '''u''': '''BAABB''',
    '''v''': '''BBBAB''',
    '''w''': '''BABAA''',
    '''x''': '''BABAB''',
    '''y''': '''BABBA''',
    '''z''': '''BABBB''',
    ''' ''': ''' ''',
}


__snake_case   							=						{value: key for key, value in encode_dict.items()}






def 		_A		(		_lowercase )					-> str:


     """simple docstring"""


     __UpperCamelCase =			''
     for letter in word.lower():
          if letter.isalpha() or letter == " ":
               encoded += encode_dict[letter]
          else:
               raise Exception('encode() accepts only letters of the alphabet and spaces' )
     return encoded






def 		_A		(		_lowercase )					-> str:


     """simple docstring"""


     if set(_lowercase ) - {"A", "B", " "} != set():
          raise Exception('decode() accepts only \'A\', \'B\' and spaces' )
     __UpperCamelCase =			''
     for word in coded.split():
          while len(_lowercase ) != 0:
               decoded += decode_dict[word[:5]]
               __UpperCamelCase =			word[5:]
          decoded += " "
     return decoded.strip()


if __name__ == "__main__":
    from doctest import testmod

    testmod()


