


'''simple docstring'''



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


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

_lowercase    :    List[Any]			 =  {
    """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  UpperCamelCase__(     lowerCAmelCase ):
				__magic_name__       :   Tuple							= "cvt"




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

										"""simple docstring"""




										super().__init__(**lowerCAmelCase   )
										UpperCAmelCase         =			num_channels
										UpperCAmelCase         =			patch_sizes
										UpperCAmelCase         =			patch_stride
										UpperCAmelCase         =			patch_padding
										UpperCAmelCase         =			embed_dim
										UpperCAmelCase         =			num_heads
										UpperCAmelCase         =			depth
										UpperCAmelCase         =			mlp_ratio
										UpperCAmelCase         =			attention_drop_rate
										UpperCAmelCase         =			drop_rate
										UpperCAmelCase         =			drop_path_rate
										UpperCAmelCase         =			qkv_bias
										UpperCAmelCase         =			cls_token
										UpperCAmelCase         =			qkv_projection_method
										UpperCAmelCase         =			kernel_qkv
										UpperCAmelCase         =			padding_kv
										UpperCAmelCase         =			stride_kv
										UpperCAmelCase         =			padding_q
										UpperCAmelCase         =			stride_q
										UpperCAmelCase         =			initializer_range
										UpperCAmelCase         =			layer_norm_eps









'''simple docstring'''



from argparse import ArgumentParser

from . import BaseTransformersCLICommand


def    lowerCamelCase__   ( A     :    List[Any]  ):




						'''simple docstring'''






						return DownloadCommand(args.model   ,     args.cache_dir   ,     args.force   ,     args.trust_remote_code  )






class  UpperCamelCase__(     lowerCAmelCase ):




				@staticmethod
				def   a__(	lowerCAmelCase    :				ArgumentParser   )->  Optional[Any]:

										"""simple docstring"""




										UpperCAmelCase         =			parser.add_parser('''download'''   )
										download_parser.add_argument(
										    '''--cache-dir'''   ,					type=lowerCAmelCase   ,					default=lowerCAmelCase   ,					help='''Path to location to store the models'''   )
										download_parser.add_argument(
										    '''--force'''   ,					action='''store_true'''   ,					help='''Force the model to be download even if already in cache-dir'''   )
										download_parser.add_argument(
										    '''--trust-remote-code'''   ,					action='''store_true'''   ,					help='''Whether or not to allow for custom models defined on the Hub in their own modeling files. Use only if you\'ve reviewed the code as it will execute on your local machine'''   ,					)
										download_parser.add_argument('''model'''   ,					type=lowerCAmelCase   ,					help='''Name of the model to download'''   )
										download_parser.set_defaults(func=lowerCAmelCase   )




				def __init__(	self    :				Dict   ,					lowerCAmelCase    :				str   ,					lowerCAmelCase    :				str   ,					lowerCAmelCase    :				bool   ,					lowerCAmelCase    :				bool   )->  Any:

										"""simple docstring"""




										UpperCAmelCase         =			model
										UpperCAmelCase         =			cache
										UpperCAmelCase         =			force
										UpperCAmelCase         =			trust_remote_code





				def   a__(	self    :				int   )->  Optional[Any]:

										"""simple docstring"""




										from ..models.auto import AutoModel, AutoTokenizer

										AutoModel.from_pretrained(
										    self._model   ,					cache_dir=self._cache   ,					force_download=self._force   ,					trust_remote_code=self._trust_remote_code   )
										AutoTokenizer.from_pretrained(
										    self._model   ,					cache_dir=self._cache   ,					force_download=self._force   ,					trust_remote_code=self._trust_remote_code   )





