





from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCAmelCase_           =	logging.get_logger(__name__)

UpperCAmelCase_           =	{
    "facebook/levit-128S": "https://huggingface.co/facebook/levit-128S/resolve/main/config.json",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}




class 			__UpperCamelCase    (							A__    ):
     __A	:  Tuple							  =   """levit"""





     def __init__(     self				,							_UpperCamelCase=224				,							_UpperCamelCase=3				,							_UpperCamelCase=3				,							_UpperCamelCase=2				,							_UpperCamelCase=1				,							_UpperCamelCase=16				,							_UpperCamelCase=[128, 256, 384]				,							_UpperCamelCase=[4, 8, 12]				,							_UpperCamelCase=[4, 4, 4]				,							_UpperCamelCase=[16, 16, 16]				,							_UpperCamelCase=0				,							_UpperCamelCase=[2, 2, 2]				,							_UpperCamelCase=[2, 2, 2]				,							_UpperCamelCase=0.02				,							**_UpperCamelCase				,							):
        super().__init__(**_UpperCamelCase					)
        _UpperCAmelCase           =   image_size
        _UpperCAmelCase           =   num_channels
        _UpperCAmelCase           =   kernel_size
        _UpperCAmelCase           =   stride
        _UpperCAmelCase           =   padding
        _UpperCAmelCase           =   hidden_sizes
        _UpperCAmelCase           =   num_attention_heads
        _UpperCAmelCase           =   depths
        _UpperCAmelCase           =   key_dim
        _UpperCAmelCase           =   drop_path_rate
        _UpperCAmelCase           =   patch_size
        _UpperCAmelCase           =   attention_ratio
        _UpperCAmelCase           =   mlp_ratio
        _UpperCAmelCase           =   initializer_range
        _UpperCAmelCase           =   [
            ['''Subsample''', key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
            ['''Subsample''', key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
        ]




class 			__UpperCamelCase    (							A__    ):
     __A	:  List[Any]							  =   version.parse("""1.11"""    )





     @property
     def 		UpperCamelCase(     self					):
        return OrderedDict(
            [
                ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
            ]					)





     @property
     def 		UpperCamelCase(     self					):
        return 1e-4






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


UpperCAmelCase_           =	logging.get_logger(__name__)

UpperCAmelCase_           =	{
    "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 			__UpperCamelCase    (							A__    ):
     __A	:  Tuple							  =   """rwkv"""
     __A	:  Any							  =   {"""max_position_embeddings""": """context_length"""}





     def __init__(     self				,							_UpperCamelCase=50277				,							_UpperCamelCase=1024				,							_UpperCamelCase=4096				,							_UpperCamelCase=32				,							_UpperCamelCase=None				,							_UpperCamelCase=None				,							_UpperCamelCase=1e-5				,							_UpperCamelCase=0				,							_UpperCamelCase=0				,							_UpperCamelCase=6				,							_UpperCamelCase=False				,							_UpperCamelCase=True				,							**_UpperCamelCase				,							):
        _UpperCAmelCase           =   vocab_size
        _UpperCAmelCase           =   context_length
        _UpperCAmelCase           =   hidden_size
        _UpperCAmelCase           =   num_hidden_layers
        _UpperCAmelCase           =   attention_hidden_size if attention_hidden_size is not None else hidden_size
        _UpperCAmelCase           =   intermediate_size if intermediate_size is not None else 4 * hidden_size
        _UpperCAmelCase           =   layer_norm_epsilon
        _UpperCAmelCase           =   rescale_every
        _UpperCAmelCase           =   use_cache

        _UpperCAmelCase           =   bos_token_id
        _UpperCAmelCase           =   eos_token_id

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