





"""simple docstring"""


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


__magic_name__       :					str						=			logging.get_logger(__name__)

__magic_name__       :					Union[str, Any]						=			{
    """RWKV/rwkv-4-169m-pile""": """https://huggingface.co/RWKV/rwkv-4-169m-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-430m-pile""": """https://huggingface.co/RWKV/rwkv-4-430m-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-1b5-pile""": """https://huggingface.co/RWKV/rwkv-4-1b5-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-3b-pile""": """https://huggingface.co/RWKV/rwkv-4-3b-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-7b-pile""": """https://huggingface.co/RWKV/rwkv-4-7b-pile/resolve/main/config.json""",
    """RWKV/rwkv-4-14b-pile""": """https://huggingface.co/RWKV/rwkv-4-14b-pile/resolve/main/config.json""",
    """RWKV/rwkv-raven-1b5""": """https://huggingface.co/RWKV/rwkv-raven-1b5/resolve/main/config.json""",
    """RWKV/rwkv-raven-3b""": """https://huggingface.co/RWKV/rwkv-raven-3b/resolve/main/config.json""",
    """RWKV/rwkv-raven-7b""": """https://huggingface.co/RWKV/rwkv-raven-7b/resolve/main/config.json""",
    """RWKV/rwkv-raven-14b""": """https://huggingface.co/RWKV/rwkv-raven-14b/resolve/main/config.json""",
}






class 							lowercase__			(   __SCREAMING_SNAKE_CASE	):

			"""simple docstring"""
			__lowerCAmelCase     :				Any										=  """rwkv"""
			__lowerCAmelCase     :				List[str]										=  {"""max_position_embeddings""": """context_length"""}







			def __init__(      self						,   _A=5_0_2_7_7						,   _A=1_0_2_4						,   _A=4_0_9_6						,   _A=3_2						,   _A=None						,   _A=None						,   _A=1e-5						,   _A=0						,   _A=0						,   _A=6						,   _A=False						,   _A=True						,   **_A						,   ):






									'''simple docstring'''







									UpperCamelCase				:		Any				   =			vocab_size
									UpperCamelCase				:		Optional[Any]				   =			context_length
									UpperCamelCase				:		str				   =			hidden_size
									UpperCamelCase				:		int				   =			num_hidden_layers
									UpperCamelCase				:		Dict				   =			attention_hidden_size if attention_hidden_size is not None else hidden_size
									UpperCamelCase				:		Any				   =			intermediate_size if intermediate_size is not None else 4 * hidden_size
									UpperCamelCase				:		Any				   =			layer_norm_epsilon
									UpperCamelCase				:		Optional[int]				   =			rescale_every
									UpperCamelCase				:		Optional[int]				   =			use_cache

									UpperCamelCase				:		Union[str, Any]				   =			bos_token_id
									UpperCamelCase				:		Any				   =			eos_token_id

									super().__init__(
									    tie_word_embeddings=_A						,   bos_token_id=_A						,   eos_token_id=_A						,   **_A    )






def 			lowerCamelCase__			(       _a				,      _a):
	SCREAMING_SNAKE_CASE :   Optional[int]					  =							0
	while b > 0:
		if b & 1:
			res += a

		a += a
		b >>= 1

	return res

def 			lowerCamelCase__			(       _a				,      _a				,      _a):
	SCREAMING_SNAKE_CASE :   Optional[int]					  =							0
	while b > 0:
		if b & 1:
			SCREAMING_SNAKE_CASE :   Optional[Any]					  =							((res % c) + (a % c)) % c

		a += a
		b >>= 1

	return res