




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


SCREAMING_SNAKE_CASE:     Any									= logging.get_logger(__name__)

SCREAMING_SNAKE_CASE:     Optional[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    lowercase_		(SCREAMING_SNAKE_CASE__ ):
						lowerCAmelCase__			      ="falcon"
						lowerCAmelCase__			      =["past_key_values"]



						def __init__(			self	:   Any					,							snake_case__	:   Optional[int]=6_50_24					,							snake_case__	:   Optional[int]=45_44					,							snake_case__	:   List[str]=32					,							snake_case__	:   int=71					,							snake_case__	:   Tuple=1e-5					,							snake_case__	:   int=0.02					,							snake_case__	:   List[Any]=True					,							snake_case__	:   Union[str, Any]=0.0					,							snake_case__	:   Any=0.0					,							snake_case__	:   List[Any]=None					,							snake_case__	:   Tuple=False					,							snake_case__	:   Tuple=False					,							snake_case__	:   str=True					,							snake_case__	:   Dict=True					,							snake_case__	:   List[str]=False					,							snake_case__	:   Optional[Any]=11					,							snake_case__	:   Union[str, Any]=11					,							**snake_case__	:   str					,							):

								"""simple docstring"""

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

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

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



						@property
						def 	__a					(			self	:   int  ):

								"""simple docstring"""

								return self.hidden_size // self.num_attention_heads






						@property
						def 	__a					(			self	:   str  ):

								"""simple docstring"""

								return not self.alibi





from math import sqrt

import numpy as np
from sympy import symbols

# Coefficient
# Speed of light (m/s)
SCREAMING_SNAKE_CASE:     Optional[int]									= 2_9_9_7_9_2_4_5_8

# Symbols
SCREAMING_SNAKE_CASE				,					SCREAMING_SNAKE_CASE				,					SCREAMING_SNAKE_CASE				,					SCREAMING_SNAKE_CASE:     Tuple									= symbols('''ct x y z''')


def 					_a							(					lowerCAmelCase )->	float:
		if velocity > c:
				raise ValueError('Speed must not exceed light speed 299,792,458 [m/s]!' )
		elif velocity < 1:
				# Usually the speed should be much higher than 1 (c order of magnitude)
				raise ValueError('Speed must be greater than or equal to 1!' )

		return velocity / c


def 					_a							(					lowerCAmelCase )->	float:
		return 1 / sqrt(1 - beta(lowerCAmelCase ) ** 2 )


def 					_a							(					lowerCAmelCase )->	np.ndarray:
		return np.array(
		    [
		        [gamma(lowerCAmelCase ), -gamma(lowerCAmelCase ) * beta(lowerCAmelCase ), 0, 0],
		        [-gamma(lowerCAmelCase ) * beta(lowerCAmelCase ), gamma(lowerCAmelCase ), 0, 0],
		        [0, 0, 1, 0],
		        [0, 0, 0, 1],
		    ] )


def 					_a							(					lowerCAmelCase    ,						lowerCAmelCase = None )->	np.ndarray:
		# Ensure event is not empty
		if event is None:
				SCREAMING_SNAKE_CASE_					      =							np.array([ct, x, y, z] )  # Symbolic four vector
		else:
				event[0] *= c  # x0 is ct (speed of light * time)

		return transformation_matrix(lowerCAmelCase ) @ event


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						# Example of symbolic vector:
						SCREAMING_SNAKE_CASE:     int									= transform(2_9_9_7_9_2_4_5)
						print('''Example of four vector: ''')
						print(f"""ct' = {four_vector[0]}""")
						print(f"""x' = {four_vector[1]}""")
						print(f"""y' = {four_vector[2]}""")
						print(f"""z' = {four_vector[3]}""")

						# Substitute symbols with numerical values
						SCREAMING_SNAKE_CASE:     List[Any]									= {ct: c, x: 1, y: 1, z: 1}
						SCREAMING_SNAKE_CASE:     Optional[Any]									= [four_vector[i].subs(sub_dict) for i in range(4)]

						print(f"""\n{numerical_vector}""")