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


lowercase						:      Optional[Any]									= logging.get_logger(__name__)

lowercase						:      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 				lowerCamelCase__							(       __lowercase):




	'''simple docstring'''




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







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

								__UpperCamelCase			:     int         =      bos_token_id
								__UpperCamelCase			:     Tuple         =      eos_token_id

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

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowercase						:      Optional[Any]									= logging.get_logger(__name__)

lowercase						:      List[str]									= {
    'shi-labs/nat-mini-in1k-224': 'https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json',
    # See all Nat models at https://huggingface.co/models?filter=nat
}




class 				lowerCamelCase__							(       __lowercase  ,		__lowercase):




	'''simple docstring'''




	_A			=  'nat'

	_A			=  {
	    'num_attention_heads': 'num_heads',
	    'num_hidden_layers': 'num_layers',
	}







	def __init__(      self	:Optional[Any]  ,     a	:Any=4  ,     a	:Any=3  ,     a	:int=6_4  ,     a	:Dict=[3, 4, 6, 5]  ,     a	:Dict=[2, 4, 8, 1_6]  ,     a	:Optional[Any]=7  ,     a	:Any=3.0  ,     a	:Optional[int]=True  ,     a	:int=0.0  ,     a	:Union[str, Any]=0.0  ,     a	:List[Any]=0.1  ,     a	:str="gelu"  ,     a	:Union[str, Any]=0.02  ,     a	:Tuple=1E-5  ,     a	:str=0.0  ,     a	:Optional[int]=None  ,     a	:Dict=None  ,     **a	:Optional[Any]  ,     )	->				int:
								super().__init__(**a		)

								__UpperCamelCase			:     Any         =      patch_size
								__UpperCamelCase			:     str         =      num_channels
								__UpperCamelCase			:     List[Any]         =      embed_dim
								__UpperCamelCase			:     str         =      depths
								__UpperCamelCase			:     str         =      len(a		)
								__UpperCamelCase			:     Optional[Any]         =      num_heads
								__UpperCamelCase			:     Dict         =      kernel_size
								__UpperCamelCase			:     Union[str, Any]         =      mlp_ratio
								__UpperCamelCase			:     Union[str, Any]         =      qkv_bias
								__UpperCamelCase			:     List[str]         =      hidden_dropout_prob
								__UpperCamelCase			:     Any         =      attention_probs_dropout_prob
								__UpperCamelCase			:     Any         =      drop_path_rate
								__UpperCamelCase			:     Any         =      hidden_act
								__UpperCamelCase			:     Tuple         =      layer_norm_eps
								__UpperCamelCase			:     Dict         =      initializer_range
								# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
								# this indicates the channel dimension after the last stage of the model
								__UpperCamelCase			:     int         =      int(embed_dim * 2 ** (len(a		) - 1)		)
								__UpperCamelCase			:     List[Any]         =      layer_scale_init_value
								__UpperCamelCase			:     Optional[Any]         =      ["stem"] + [f'stage{idx}' for idx in range(1  ,     len(a		) + 1		)]
								__UpperCamelCase     ,		__UpperCamelCase			:     Any         =      get_aligned_output_features_output_indices(
								    out_features=a  ,     out_indices=a  ,     stage_names=self.stage_names		)