




"""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_convbert import ConvBertTokenizer


a_        =       logging.get_logger(__name__)

a_        =       {'vocab_file': 'vocab.txt'}

a_        =       {
    'vocab_file': {
        'YituTech/conv-bert-base': 'https://huggingface.co/YituTech/conv-bert-base/resolve/main/vocab.txt',
        'YituTech/conv-bert-medium-small': (
            'https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/vocab.txt'
        ),
        'YituTech/conv-bert-small': 'https://huggingface.co/YituTech/conv-bert-small/resolve/main/vocab.txt',
    }
}

a_        =       {
    'YituTech/conv-bert-base': 5_1_2,
    'YituTech/conv-bert-medium-small': 5_1_2,
    'YituTech/conv-bert-small': 5_1_2,
}


a_        =       {
    'YituTech/conv-bert-base': {'do_lower_case': True},
    'YituTech/conv-bert-medium-small': {'do_lower_case': True},
    'YituTech/conv-bert-small': {'do_lower_case': True},
}

class   UpperCAmelCase_    (			snake_case		):
		UpperCamelCase							=VOCAB_FILES_NAMES
		UpperCamelCase							=PRETRAINED_VOCAB_FILES_MAP
		UpperCamelCase							=PRETRAINED_INIT_CONFIGURATION
		UpperCamelCase							=PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
		UpperCamelCase							=ConvBertTokenizer
		def __init__(						self				,						UpperCamelCase_=None				,						UpperCamelCase_=None				,						UpperCamelCase_=True				,						UpperCamelCase_="[UNK]"				,						UpperCamelCase_="[SEP]"				,						UpperCamelCase_="[PAD]"				,						UpperCamelCase_="[CLS]"				,						UpperCamelCase_="[MASK]"				,						UpperCamelCase_=True				,						UpperCamelCase_=None				,						**UpperCamelCase_				,						)						->       List[Any]:
					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_				,						)

					__lowercase			:  Dict								=       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
					):
								__lowercase			:  Dict								=       getattr(UpperCamelCase_				,						normalizer_state.pop('''type'''       )       )
								__lowercase			:  List[str]								=       do_lower_case
								__lowercase			:  List[str]								=       strip_accents
								__lowercase			:  Tuple								=       tokenize_chinese_chars
								__lowercase			:  Optional[int]								=       normalizer_class(**UpperCamelCase_       )

					__lowercase			:  Union[str, Any]								=       do_lower_case
		def 	_lowerCamelCase							(						self				,						UpperCamelCase_				,						UpperCamelCase_=None       )						->       List[str]:
					__lowercase			:  Union[str, 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				,						UpperCamelCase_				,						UpperCamelCase_ = None       )						->       List[int]:
					__lowercase			:  List[Any]								=       [self.sep_token_id]
					__lowercase			:  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				,						UpperCamelCase_				,						UpperCamelCase_ = None       )						->       Tuple[str]:
					__lowercase			:  str								=       self._tokenizer.model.save(UpperCamelCase_				,						name=UpperCamelCase_       )
					return tuple(UpperCamelCase_       )











"""simple docstring"""





from collections import OrderedDict
from typing import List, Mapping

from packaging import version

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


__lowerCamelCase							=  logging.get_logger(__name__)

__lowerCamelCase							=  {
    'google/efficientnet-b7': 'https://huggingface.co/google/efficientnet-b7/resolve/main/config.json',
}



class       __A		(   SCREAMING_SNAKE_CASE_			):
					UpperCAmelCase__								=				"efficientnet"

					def __init__(			self  :      Optional[Any]     ,		__snake_case  :      int = 3     ,		__snake_case  :      int = 6_0_0     ,		__snake_case  :      float = 2.0     ,		__snake_case  :      float = 3.1     ,		__snake_case  :      int = 8     ,		__snake_case  :      List[int] = [3, 3, 5, 3, 5, 5, 3]     ,		__snake_case  :      List[int] = [3_2, 1_6, 2_4, 4_0, 8_0, 1_1_2, 1_9_2]     ,		__snake_case  :      List[int] = [1_6, 2_4, 4_0, 8_0, 1_1_2, 1_9_2, 3_2_0]     ,		__snake_case  :      List[int] = []     ,		__snake_case  :      List[int] = [1, 2, 2, 2, 1, 2, 1]     ,		__snake_case  :      List[int] = [1, 2, 2, 3, 3, 4, 1]     ,		__snake_case  :      List[int] = [1, 6, 6, 6, 6, 6, 6]     ,		__snake_case  :      float = 0.25     ,		__snake_case  :      str = "swish"     ,		__snake_case  :      int = 2_5_6_0     ,		__snake_case  :      str = "mean"     ,		__snake_case  :      float = 0.02     ,		__snake_case  :      float = 0.001     ,		__snake_case  :      float = 0.99     ,		__snake_case  :      float = 0.5     ,		__snake_case  :      float = 0.2     ,		**__snake_case  :      List[Any]     ,		)			->							List[Any]:
											super().__init__(**__snake_case					)

											__magic_name__:	str							=       num_channels
											__magic_name__:	List[str]							=       image_size
											__magic_name__:	List[str]							=       width_coefficient
											__magic_name__:	Optional[Any]							=       depth_coefficient
											__magic_name__:	Tuple							=       depth_divisor
											__magic_name__:	Dict							=       kernel_sizes
											__magic_name__:	int							=       in_channels
											__magic_name__:	str							=       out_channels
											__magic_name__:	Dict							=       depthwise_padding
											__magic_name__:	Union[str, Any]							=       strides
											__magic_name__:	Dict							=       num_block_repeats
											__magic_name__:	Tuple							=       expand_ratios
											__magic_name__:	List[str]							=       squeeze_expansion_ratio
											__magic_name__:	Any							=       hidden_act
											__magic_name__:	Tuple							=       hidden_dim
											__magic_name__:	int							=       pooling_type
											__magic_name__:	int							=       initializer_range
											__magic_name__:	List[str]							=       batch_norm_eps
											__magic_name__:	str							=       batch_norm_momentum
											__magic_name__:	List[str]							=       dropout_rate
											__magic_name__:	Dict							=       drop_connect_rate
											__magic_name__:	Optional[Any]							=       sum(__snake_case					) * 4



class       __A		(   SCREAMING_SNAKE_CASE_			):
					UpperCAmelCase__								=				version.parse("1.11"			)

					@property
					def   lowerCamelCase__   (			self  :      List[str]					)			->							Mapping[str, Mapping[int, str]]:
											return OrderedDict(
											    [
											        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
											    ]					)






					@property
					def   lowerCamelCase__   (			self  :      List[Any]					)			->							float:
											return 1E-5



