
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		: List[str]								=     logging.get_logger(__name__)

A		: Union[str, Any]								=     {'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

A		: int								=     {
    '''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		: str								=     {'''mobilebert-uncased''': 512}


A		: Optional[Any]								=     {}



class    a_ (			_a    ):
			a	:			Tuple					   =							VOCAB_FILES_NAMES
			a	:			List[Any]					   =							PRETRAINED_VOCAB_FILES_MAP
			a	:			int					   =							PRETRAINED_INIT_CONFIGURATION
			a	:			int					   =							PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			a	:			Dict					   =							MobileBertTokenizer






			def __init__(      self				,			__UpperCamelCase=None				,			__UpperCamelCase=None				,			__UpperCamelCase=True				,			__UpperCamelCase="[UNK]"				,			__UpperCamelCase="[SEP]"				,			__UpperCamelCase="[PAD]"				,			__UpperCamelCase="[CLS]"				,			__UpperCamelCase="[MASK]"				,			__UpperCamelCase=True				,			__UpperCamelCase=None				,			**__UpperCamelCase				,			):
									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					       =					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					       =					getattr(__UpperCamelCase				,			normalizer_state.pop("""type"""  )  )
															_lowercase					       =					do_lower_case
															_lowercase					       =					strip_accents
															_lowercase					       =					tokenize_chinese_chars
															_lowercase					       =					normalizer_class(**__UpperCamelCase  )

									_lowercase					       =					do_lower_case






			def    UpperCamelCase_				(      self				,			__UpperCamelCase				,			__UpperCamelCase=None  ):
									_lowercase					       =					[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    UpperCamelCase_				(      self				,			__UpperCamelCase				,			__UpperCamelCase = None  ):
									_lowercase					       =					[self.sep_token_id]
									_lowercase					       =					[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    UpperCamelCase_				(      self				,			__UpperCamelCase				,			__UpperCamelCase = None  ):
									_lowercase					       =					self._tokenizer.model.save(__UpperCamelCase				,			name=__UpperCamelCase  )
									return tuple(__UpperCamelCase  )

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A		: Dict								=     {
    '''configuration_x_clip''': [
        '''XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''XCLIPConfig''',
        '''XCLIPTextConfig''',
        '''XCLIPVisionConfig''',
    ],
    '''processing_x_clip''': ['''XCLIPProcessor'''],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A		: Optional[Any]								=     [
		    '''XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''XCLIPModel''',
		    '''XCLIPPreTrainedModel''',
		    '''XCLIPTextModel''',
		    '''XCLIPVisionModel''',
		]

if TYPE_CHECKING:
		from .configuration_x_clip import (
		    XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    XCLIPConfig,
		    XCLIPTextConfig,
		    XCLIPVisionConfig,
		)
		from .processing_x_clip import XCLIPProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_x_clip import (
				    XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
				    XCLIPModel,
				    XCLIPPreTrainedModel,
				    XCLIPTextModel,
				    XCLIPVisionModel,
				)

else:
		import sys

		A		: List[str]								=     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)