
'''simple docstring'''



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


UpperCamelCase__      :		Tuple       							=  logging.get_logger(__name__)

UpperCamelCase__      :		List[str]       							=  {
    "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    _a				(_lowerCamelCase):





       """simple docstring"""




       SCREAMING_SNAKE_CASE      =  'rwkv'
       SCREAMING_SNAKE_CASE      =  {'max_position_embeddings': 'context_length'}






       def __init__(							self       ,							A__=5_02_77       ,							A__=10_24       ,							A__=40_96       ,							A__=32       ,							A__=None       ,							A__=None       ,							A__=1E-5       ,							A__=0       ,							A__=0       ,							A__=6       ,							A__=False       ,							A__=True       ,							**A__       ,							)    ->			Any:
          _SCREAMING_SNAKE_CASE      =				vocab_size
          _SCREAMING_SNAKE_CASE      =				context_length
          _SCREAMING_SNAKE_CASE      =				hidden_size
          _SCREAMING_SNAKE_CASE      =				num_hidden_layers
          _SCREAMING_SNAKE_CASE      =				attention_hidden_size if attention_hidden_size is not None else hidden_size
          _SCREAMING_SNAKE_CASE      =				intermediate_size if intermediate_size is not None else 4 * hidden_size
          _SCREAMING_SNAKE_CASE      =				layer_norm_epsilon
          _SCREAMING_SNAKE_CASE      =				rescale_every
          _SCREAMING_SNAKE_CASE      =				use_cache

          _SCREAMING_SNAKE_CASE      =				bos_token_id
          _SCREAMING_SNAKE_CASE      =				eos_token_id

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








'''simple docstring'''



def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_						)     ->     str:




   """simple docstring"""
   return "".join([hex(SCREAMING_SNAKE_CASE_						)[2:].zfill(2						).upper() for byte in list(SCREAMING_SNAKE_CASE_						)]						)
def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_						)     ->     bytes:




   """simple docstring"""
   # Check data validity, following RFC3548
   # https://www.ietf.org/rfc/rfc3548.txt
   if (len(SCREAMING_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(SCREAMING_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]    ,      16						) for i in range(0    ,      len(SCREAMING_SNAKE_CASE_						)    ,      2						)						)


if __name__ == "__main__":
     import doctest

     doctest.testmod()






