






'''simple docstring'''




import warnings

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


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

__lowerCamelCase   :					Tuple   							=					{
    '''xlnet-base-cased''': '''https://huggingface.co/xlnet-base-cased/resolve/main/config.json''',
    '''xlnet-large-cased''': '''https://huggingface.co/xlnet-large-cased/resolve/main/config.json''',
}







class    A_	(a_							):
							"""simple docstring"""




							a__   		=	'''xlnet'''
							a__   		=	['''mems''']
							a__   		=	{
							    '''n_token''': '''vocab_size''',  # Backward compatibility
							    '''hidden_size''': '''d_model''',
							    '''num_attention_heads''': '''n_head''',
							    '''num_hidden_layers''': '''n_layer''',
							}

							def __init__(		self			:Any       ,							lowerCAmelCase__			:Optional[int]=32_000       ,							lowerCAmelCase__			:Any=1_024       ,							lowerCAmelCase__			:Tuple=24       ,							lowerCAmelCase__			:str=16       ,							lowerCAmelCase__			:Optional[Any]=4_096       ,							lowerCAmelCase__			:Optional[Any]="gelu"       ,							lowerCAmelCase__			:Optional[int]=True       ,							lowerCAmelCase__			:Optional[int]="bi"       ,							lowerCAmelCase__			:Any=0.0_2       ,							lowerCAmelCase__			:int=1E-1_2       ,							lowerCAmelCase__			:Dict=0.1       ,							lowerCAmelCase__			:Any=512       ,							lowerCAmelCase__			:List[Any]=None       ,							lowerCAmelCase__			:Tuple=True       ,							lowerCAmelCase__			:Tuple=False       ,							lowerCAmelCase__			:Optional[int]=False       ,							lowerCAmelCase__			:Tuple=-1       ,							lowerCAmelCase__			:Any=False       ,							lowerCAmelCase__			:Optional[int]="last"       ,							lowerCAmelCase__			:Dict=True       ,							lowerCAmelCase__			:str="tanh"       ,							lowerCAmelCase__			:Optional[int]=0.1       ,							lowerCAmelCase__			:int=5       ,							lowerCAmelCase__			:Optional[int]=5       ,							lowerCAmelCase__			:Any=5       ,							lowerCAmelCase__			:List[Any]=1       ,							lowerCAmelCase__			:Dict=2       ,							**lowerCAmelCase__			:Tuple       ,							)				->  Any:


										'''simple docstring'''




										snake_case_				:					Optional[Any]   =       vocab_size
										snake_case_				:					int   =       d_model
										snake_case_				:					List[str]   =       n_layer
										snake_case_				:					Optional[int]   =       n_head
										if d_model % n_head != 0:
													raise ValueError(F'''\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'''				)
										if "d_head" in kwargs:
													if kwargs["d_head"] != d_model // n_head:
																raise ValueError(
																    F'''`d_head` ({kwargs['d_head']}) should be equal to `d_model // n_head` ({d_model // n_head})'''				)
										snake_case_				:					Any   =       d_model // n_head
										snake_case_				:					int   =       ff_activation
										snake_case_				:					str   =       d_inner
										snake_case_				:					Optional[Any]   =       untie_r
										snake_case_				:					Tuple   =       attn_type

										snake_case_				:					Dict   =       initializer_range
										snake_case_				:					int   =       layer_norm_eps

										snake_case_				:					Optional[Any]   =       dropout
										snake_case_				:					Union[str, Any]   =       mem_len
										snake_case_				:					Optional[int]   =       reuse_len
										snake_case_				:					Any   =       bi_data
										snake_case_				:					Any   =       clamp_len
										snake_case_				:					int   =       same_length

										snake_case_				:					Any   =       summary_type
										snake_case_				:					Dict   =       summary_use_proj
										snake_case_				:					str   =       summary_activation
										snake_case_				:					Tuple   =       summary_last_dropout
										snake_case_				:					int   =       start_n_top
										snake_case_				:					str   =       end_n_top

										snake_case_				:					List[Any]   =       bos_token_id
										snake_case_				:					List[str]   =       pad_token_id
										snake_case_				:					Optional[int]   =       eos_token_id

										if "use_cache" in kwargs:
													warnings.warn(
													    "The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`"
													    " instead."       ,							lowerCAmelCase__       ,							)
													snake_case_				:					Optional[int]   =       kwargs["use_cache"]

										snake_case_				:					Optional[int]   =       use_mems_eval
										snake_case_				:					Optional[Any]   =       use_mems_train
										super().__init__(pad_token_id=lowerCAmelCase__       ,							bos_token_id=lowerCAmelCase__       ,							eos_token_id=lowerCAmelCase__       ,							**lowerCAmelCase__				)

							@property
							def 							_A	(		self			:List[str]				)				->  Any:


										'''simple docstring'''




										logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)
										return -1






							@max_position_embeddings.setter
							def 							_A	(		self			:int       ,							lowerCAmelCase__			:Dict				)				->  Union[str, Any]:


										'''simple docstring'''




										raise NotImplementedError(
										    F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)












'''simple docstring'''




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


__lowerCamelCase   :					List[str]   							=					logging.get_logger(__name__)

__lowerCamelCase   :					int   							=					{
    '''microsoft/cvt-13''': '''https://huggingface.co/microsoft/cvt-13/resolve/main/config.json''',
    # See all Cvt models at https://huggingface.co/models?filter=cvt
}







class    A_	(a_							):
							"""simple docstring"""




							a__   		=	'''cvt'''

							def __init__(		self			:List[Any]       ,							lowerCAmelCase__			:Optional[int]=3       ,							lowerCAmelCase__			:Any=[7, 3, 3]       ,							lowerCAmelCase__			:Dict=[4, 2, 2]       ,							lowerCAmelCase__			:Union[str, Any]=[2, 1, 1]       ,							lowerCAmelCase__			:Any=[64, 192, 384]       ,							lowerCAmelCase__			:List[str]=[1, 3, 6]       ,							lowerCAmelCase__			:str=[1, 2, 10]       ,							lowerCAmelCase__			:Any=[4.0, 4.0, 4.0]       ,							lowerCAmelCase__			:int=[0.0, 0.0, 0.0]       ,							lowerCAmelCase__			:Optional[Any]=[0.0, 0.0, 0.0]       ,							lowerCAmelCase__			:Dict=[0.0, 0.0, 0.1]       ,							lowerCAmelCase__			:List[Any]=[True, True, True]       ,							lowerCAmelCase__			:List[Any]=[False, False, True]       ,							lowerCAmelCase__			:Dict=["dw_bn", "dw_bn", "dw_bn"]       ,							lowerCAmelCase__			:Any=[3, 3, 3]       ,							lowerCAmelCase__			:Tuple=[1, 1, 1]       ,							lowerCAmelCase__			:Optional[int]=[2, 2, 2]       ,							lowerCAmelCase__			:Union[str, Any]=[1, 1, 1]       ,							lowerCAmelCase__			:Any=[1, 1, 1]       ,							lowerCAmelCase__			:List[str]=0.0_2       ,							lowerCAmelCase__			:Dict=1E-1_2       ,							**lowerCAmelCase__			:Optional[Any]       ,							)				->  str:


										'''simple docstring'''




										super().__init__(**lowerCAmelCase__				)
										snake_case_				:					int   =       num_channels
										snake_case_				:					int   =       patch_sizes
										snake_case_				:					Optional[Any]   =       patch_stride
										snake_case_				:					Dict   =       patch_padding
										snake_case_				:					Tuple   =       embed_dim
										snake_case_				:					Optional[int]   =       num_heads
										snake_case_				:					Union[str, Any]   =       depth
										snake_case_				:					Optional[int]   =       mlp_ratio
										snake_case_				:					Tuple   =       attention_drop_rate
										snake_case_				:					str   =       drop_rate
										snake_case_				:					Tuple   =       drop_path_rate
										snake_case_				:					Any   =       qkv_bias
										snake_case_				:					Union[str, Any]   =       cls_token
										snake_case_				:					int   =       qkv_projection_method
										snake_case_				:					Any   =       kernel_qkv
										snake_case_				:					Union[str, Any]   =       padding_kv
										snake_case_				:					str   =       stride_kv
										snake_case_				:					Dict   =       padding_q
										snake_case_				:					Tuple   =       stride_q
										snake_case_				:					Any   =       initializer_range
										snake_case_				:					Any   =       layer_norm_eps




