






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


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

SCREAMING_SNAKE_CASE__   :      Tuple				=		{
    """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     lowerCamelCase_					(   lowerCamelCase			):
				a__       							=	'''rwkv'''
				a__       							=	{'''max_position_embeddings''': '''context_length'''}







				def __init__(    self							,       __lowerCAmelCase=5_0_2_7_7							,       __lowerCAmelCase=1_0_2_4							,       __lowerCAmelCase=4_0_9_6							,       __lowerCAmelCase=3_2							,       __lowerCAmelCase=None							,       __lowerCAmelCase=None							,       __lowerCAmelCase=1E-5							,       __lowerCAmelCase=0							,       __lowerCAmelCase=0							,       __lowerCAmelCase=6							,       __lowerCAmelCase=False							,       __lowerCAmelCase=True							,       **__lowerCAmelCase							,       ):
								"""simple docstring"""
								__magic_name__		:Tuple   =   vocab_size
								__magic_name__		:int   =   context_length
								__magic_name__		:Optional[int]   =   hidden_size
								__magic_name__		:Tuple   =   num_hidden_layers
								__magic_name__		:Optional[Any]   =   attention_hidden_size if attention_hidden_size is not None else hidden_size
								__magic_name__		:str   =   intermediate_size if intermediate_size is not None else 4 * hidden_size
								__magic_name__		:List[Any]   =   layer_norm_epsilon
								__magic_name__		:str   =   rescale_every
								__magic_name__		:List[Any]   =   use_cache

								__magic_name__		:List[Any]   =   bos_token_id
								__magic_name__		:Optional[int]   =   eos_token_id

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














def   __lowercase       (			snake_case			):







				"""simple docstring"""






				return "".join([hex(snake_case			)[2:].zfill(2			).upper() for byte in list(snake_case			)]			)

def   __lowercase       (			snake_case			):







				"""simple docstring"""






				if (len(snake_case			) % 2) != 0:
								raise ValueError(
								    '''Base16 encoded data is invalid:
Data does not have an even number of hex digits.'''			)
				# Check the character set - the standard base16 alphabet
				# is uppercase according to RFC3548 section 6
				if not set(snake_case			) <= set('''0123456789ABCDEF'''			):
								raise ValueError(
								    '''Base16 encoded data is invalid:
Data is not uppercase hex or it contains invalid characters.'''			)
				# For every two hexadecimal digits (= a byte), turn it into an integer.
				# Then, string the result together into bytes, and return it.
				return bytes(int(data[i] + data[i + 1],	1_6			) for i in range(0,	len(snake_case			),	2			)			)


if __name__ == "__main__":
					import doctest

					doctest.testmod()






