


import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ....tokenization_utils_fast import PreTrainedTokenizerFast
from ....utils import logging
from .tokenization_retribert import RetriBertTokenizer


__snake_case   							=						logging.get_logger(__name__)

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

__snake_case   							=						{
    '''vocab_file''': {
        '''yjernite/retribert-base-uncased''': (
            '''https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/vocab.txt'''
        ),
    },
    '''tokenizer_file''': {
        '''yjernite/retribert-base-uncased''': (
            '''https://huggingface.co/yjernite/retribert-base-uncased/resolve/main/tokenizer.json'''
        ),
    },
}

__snake_case   							=						{
    '''yjernite/retribert-base-uncased''': 5_1_2,
}


__snake_case   							=						{
    '''yjernite/retribert-base-uncased''': {'''do_lower_case''': True},
}



class 	__lowerCamelCase			(_a						):
       _lowercase											=     VOCAB_FILES_NAMES
       _lowercase											=     PRETRAINED_VOCAB_FILES_MAP
       _lowercase											=     PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       _lowercase											=     PRETRAINED_INIT_CONFIGURATION
       _lowercase											=     RetriBertTokenizer
       _lowercase											=     ["""input_ids""", """attention_mask"""]







       def __init__(			self: Optional[int],A_: int=None,A_: Optional[Any]=None,A_: List[Any]=True,A_: Any="[UNK]",A_: List[Any]="[SEP]",A_: Optional[Any]="[PAD]",A_: Dict="[CLS]",A_: Union[str, Any]="[MASK]",A_: Optional[Any]=True,A_: Dict=None,**A_: Dict,):






            '''simple docstring'''




            super().__init__(
                A_,tokenizer_file=A_,do_lower_case=A_,unk_token=A_,sep_token=A_,pad_token=A_,cls_token=A_,mask_token=A_,tokenize_chinese_chars=A_,strip_accents=A_,**A_,)

            __UpperCamelCase =			json.loads(self.backend_tokenizer.normalizer.__getstate__()					)
            if (
                normalizer_state.get('lowercase',A_					) != do_lower_case
                or normalizer_state.get('strip_accents',A_					) != strip_accents
                or normalizer_state.get('handle_chinese_chars',A_					) != tokenize_chinese_chars
            ):
                 __UpperCamelCase =			getattr(A_,normalizer_state.pop('type'					)					)
                 __UpperCamelCase =			do_lower_case
                 __UpperCamelCase =			strip_accents
                 __UpperCamelCase =			tokenize_chinese_chars
                 __UpperCamelCase =			normalizer_class(**A_					)

            __UpperCamelCase =			do_lower_case







       def 		snake_case_	(			self: List[str],A_: Tuple,A_: List[Any]=None					):






            '''simple docstring'''




            __UpperCamelCase =			[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 		snake_case_	(			self: Optional[int],A_: List[int],A_: Optional[List[int]] = None					):






            '''simple docstring'''




            __UpperCamelCase =			[self.sep_token_id]
            __UpperCamelCase =			[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 		snake_case_	(			self: str,A_: str,A_: Optional[str] = None					):






            '''simple docstring'''




            __UpperCamelCase =			self._tokenizer.model.save(A_,name=A_					)
            return tuple(A_					)





from collections import OrderedDict
from typing import Mapping

from packaging import version

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


a__												=						logging.get_logger(__name__)

a__												=						{
    '''google/mobilenet_v1_1.0_224''': '''https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json''',
    '''google/mobilenet_v1_0.75_192''': '''https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json''',
    # See all MobileNetV1 models at https://huggingface.co/models?filter=mobilenet_v1
}

class 							UpperCAmelCase_						(     __lowercase  ):
							"""simple docstring"""







							UpperCAmelCase__			:		int             =       "mobilenet_v1"


							def __init__(     self			,				_a=3			,				_a=2_2_4			,				_a=1.0			,				_a=8			,				_a="relu6"			,				_a=True			,				_a=0.999			,				_a=0.02			,				_a=0.001			,				**_a			,				)       ->       List[Any]:
												super().__init__(**_a			)

												if depth_multiplier <= 0:
																	raise ValueError('''depth_multiplier must be greater than zero.'''			)

												_a      :       Tuple   =						num_channels
												_a      :       str   =						image_size
												_a      :       Tuple   =						depth_multiplier
												_a      :       Any   =						min_depth
												_a      :       int   =						hidden_act
												_a      :       Optional[Any]   =						tf_padding
												_a      :       str   =						classifier_dropout_prob
												_a      :       Optional[int]   =						initializer_range
												_a      :       Any   =						layer_norm_eps



class 							UpperCAmelCase_						(     __lowercase  ):
							"""simple docstring"""







							UpperCAmelCase__			:		str             =       version.parse("1.11"  )


							@property
							def 							__lowercase							(     self			)       ->       Mapping[str, Mapping[int, str]]:
												return OrderedDict([('''pixel_values''', {0: '''batch'''})]			)


							@property
							def 							__lowercase							(     self			)       ->       Mapping[str, Mapping[int, str]]:
												if self.task == "image-classification":
																	return OrderedDict([('''logits''', {0: '''batch'''})]			)
												else:
																	return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]			)




							@property
							def 							__lowercase							(     self			)       ->       float:
												return 1e-4



