

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


SCREAMING_SNAKE_CASE		:List[Any]						=     logging.get_logger(__name__)

SCREAMING_SNAKE_CASE		:Optional[int]						=     {
    """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 						__magic_name__					(							snake_case				):
     UpperCamelCase_	:Union[str, Any]										=      """falcon"""
     UpperCamelCase_	:str										=      ["""past_key_values"""]






     def __init__(				self		,						_lowercase=65_024		,						_lowercase=4_544		,						_lowercase=32		,						_lowercase=71		,						_lowercase=1e-5		,						_lowercase=0.02		,						_lowercase=True		,						_lowercase=0.0		,						_lowercase=0.0		,						_lowercase=None		,						_lowercase=False		,						_lowercase=False		,						_lowercase=True		,						_lowercase=True		,						_lowercase=False		,						_lowercase=11		,						_lowercase=11		,						**_lowercase		,						)->     Dict:
         UpperCamelCase_			  =						vocab_size
         # Backward compatibility with n_embed kwarg
         UpperCamelCase_			  =						kwargs.pop("n_embed"		,						_lowercase	)
         UpperCamelCase_			  =						hidden_size if n_embed is None else n_embed
         UpperCamelCase_			  =						num_hidden_layers
         UpperCamelCase_			  =						num_attention_heads
         UpperCamelCase_			  =						layer_norm_epsilon
         UpperCamelCase_			  =						initializer_range
         UpperCamelCase_			  =						use_cache
         UpperCamelCase_			  =						hidden_dropout
         UpperCamelCase_			  =						attention_dropout

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

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






     @property
     def 	UpperCAmelCase_				(				self	)->     str:
         return self.hidden_size // self.num_attention_heads






     @property
     def 	UpperCAmelCase_				(				self	)->     List[str]:
         return not self.alibi



def 			lowerCAmelCase(      SCREAMING_SNAKE_CASE_			)->						list:



    """simple docstring"""






    if bit_count < 0:
        raise ValueError("The given input must be positive"			)

    # get the generated string sequence
    UpperCamelCase_			  =						gray_code_sequence_string(SCREAMING_SNAKE_CASE_			)
    #
    # convert them to integers
    for i in range(len(SCREAMING_SNAKE_CASE_			)			):
        UpperCamelCase_			  =						int(sequence[i]			,						2			)

    return sequence




def 			lowerCAmelCase(      SCREAMING_SNAKE_CASE_			)->						list:



    """simple docstring"""






    if bit_count == 0:
        return ["0"]

    if bit_count == 1:
        return ["0", "1"]

    UpperCamelCase_			  =						1 << bit_count  # defines the length of the sequence
    # 1<< n is equivalent to 2^n

    # recursive answer will generate answer for n-1 bits
    UpperCamelCase_			  =						gray_code_sequence_string(bit_count - 1			)

    UpperCamelCase_			  =						[]

    # append 0 to first half of the smaller sequence generated
    for i in range(seq_len // 2			):
        UpperCamelCase_			  =						"0" + smaller_sequence[i]
        sequence.append(SCREAMING_SNAKE_CASE_			)

    # append 1 to second half ... start from the end of the list
    for i in reversed(range(seq_len // 2			)			):
        UpperCamelCase_			  =						"1" + smaller_sequence[i]
        sequence.append(SCREAMING_SNAKE_CASE_			)

    return sequence


if __name__ == "__main__":
 import doctest

 doctest.testmod()
