






'''simple docstring'''







import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_mobilebert import MobileBertTokenizer


_A	:			Any         =logging.get_logger(__name__)

_A	:			Any         ={'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

_A	:			Union[str, Any]         ={
    'vocab_file': {'mobilebert-uncased': 'https://huggingface.co/google/mobilebert-uncased/resolve/main/vocab.txt'},
    'tokenizer_file': {
        'mobilebert-uncased': 'https://huggingface.co/google/mobilebert-uncased/resolve/main/tokenizer.json'
    },
}

_A	:			Tuple         ={'mobilebert-uncased': 512}


_A	:			int         ={}

class _lowercase	(				lowercase_		):
							a				      =       VOCAB_FILES_NAMES
							a				      =       PRETRAINED_VOCAB_FILES_MAP
							a				      =       PRETRAINED_INIT_CONFIGURATION
							a				      =       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							a				      =       MobileBertTokenizer




							def __init__(							self:				Optional[int]			,							UpperCamelCase__:				Dict=None			,							UpperCamelCase__:				Tuple=None			,							UpperCamelCase__:				Tuple=True			,							UpperCamelCase__:				Union[str, Any]="[UNK]"			,							UpperCamelCase__:				Any="[SEP]"			,							UpperCamelCase__:				str="[PAD]"			,							UpperCamelCase__:				Optional[int]="[CLS]"			,							UpperCamelCase__:				str="[MASK]"			,							UpperCamelCase__:				Tuple=True			,							UpperCamelCase__:				List[str]=None			,							**UpperCamelCase__:				List[str]			,							):
														super().__init__(
														    UpperCamelCase__			,							tokenizer_file=UpperCamelCase__			,							do_lower_case=UpperCamelCase__			,							unk_token=UpperCamelCase__			,							sep_token=UpperCamelCase__			,							pad_token=UpperCamelCase__			,							cls_token=UpperCamelCase__			,							mask_token=UpperCamelCase__			,							tokenize_chinese_chars=UpperCamelCase__			,							strip_accents=UpperCamelCase__			,							**UpperCamelCase__			,							)

														lowerCamelCase__					:	str         =       json.loads(self.backend_tokenizer.normalizer.__getstate__()     )
														if (
														    normalizer_state.get("""lowercase"""			,							UpperCamelCase__     ) != do_lower_case
														    or normalizer_state.get("""strip_accents"""			,							UpperCamelCase__     ) != strip_accents
														    or normalizer_state.get("""handle_chinese_chars"""			,							UpperCamelCase__     ) != tokenize_chinese_chars
														):
																					lowerCamelCase__					:	str         =       getattr(UpperCamelCase__			,							normalizer_state.pop("""type"""     )     )
																					lowerCamelCase__					:	Dict         =       do_lower_case
																					lowerCamelCase__					:	List[Any]         =       strip_accents
																					lowerCamelCase__					:	int         =       tokenize_chinese_chars
																					lowerCamelCase__					:	Optional[int]         =       normalizer_class(**UpperCamelCase__     )

														lowerCamelCase__					:	Dict         =       do_lower_case




							def 		lowerCamelCase_				(							self:				str			,							UpperCamelCase__:				Tuple			,							UpperCamelCase__:				Any=None     ):
														lowerCamelCase__					:	Optional[Any]         =       [self.cls_token_id] + token_ids_a + [self.sep_token_id]

														if token_ids_a:
																					output += token_ids_a + [self.sep_token_id]

														return output




							def 		lowerCamelCase_				(							self:				Any			,							UpperCamelCase__:				List[int]			,							UpperCamelCase__:				Optional[List[int]] = None     ):
														lowerCamelCase__					:	str         =       [self.sep_token_id]
														lowerCamelCase__					:	Union[str, Any]         =       [self.cls_token_id]
														if token_ids_a is None:
																					return len(cls + token_ids_a + sep     ) * [0]
														return len(cls + token_ids_a + sep     ) * [0] + len(token_ids_a + sep     ) * [1]




							def 		lowerCamelCase_				(							self:				int			,							UpperCamelCase__:				str			,							UpperCamelCase__:				Optional[str] = None     ):
														lowerCamelCase__					:	Dict         =       self._tokenizer.model.save(UpperCamelCase__			,							name=UpperCamelCase__     )
														return tuple(UpperCamelCase__     )





'''simple docstring'''

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


lowerCamelCase							:   Tuple  						=	logging.get_logger(__name__)

lowerCamelCase							:   Dict  						=	{
    '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   __lowerCAmelCase						(lowercase_     ):





      '''simple docstring'''






      lowerCAmelCase__					:     Tuple  					=							"""cvt"""



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

             '''simple docstring'''







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




