





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_squeezebert import SqueezeBertTokenizer


UpperCAmelCase__						:			Dict									=logging.get_logger(__name__)

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

UpperCAmelCase__						:			Optional[Any]									={
    '''vocab_file''': {
        '''squeezebert/squeezebert-uncased''': (
            '''https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/vocab.txt'''
        ),
        '''squeezebert/squeezebert-mnli''': '''https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/vocab.txt''',
        '''squeezebert/squeezebert-mnli-headless''': (
            '''https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/vocab.txt'''
        ),
    },
    '''tokenizer_file''': {
        '''squeezebert/squeezebert-uncased''': (
            '''https://huggingface.co/squeezebert/squeezebert-uncased/resolve/main/tokenizer.json'''
        ),
        '''squeezebert/squeezebert-mnli''': (
            '''https://huggingface.co/squeezebert/squeezebert-mnli/resolve/main/tokenizer.json'''
        ),
        '''squeezebert/squeezebert-mnli-headless''': (
            '''https://huggingface.co/squeezebert/squeezebert-mnli-headless/resolve/main/tokenizer.json'''
        ),
    },
}

UpperCAmelCase__						:			List[str]									={
    '''squeezebert/squeezebert-uncased''': 5_12,
    '''squeezebert/squeezebert-mnli''': 5_12,
    '''squeezebert/squeezebert-mnli-headless''': 5_12,
}


UpperCAmelCase__						:			List[str]									={
    '''squeezebert/squeezebert-uncased''': {'''do_lower_case''': True},
    '''squeezebert/squeezebert-mnli''': {'''do_lower_case''': True},
    '''squeezebert/squeezebert-mnli-headless''': {'''do_lower_case''': True},
}

class       __A     (						a    ):
				__A      =				VOCAB_FILES_NAMES
				__A      =				PRETRAINED_VOCAB_FILES_MAP
				__A      =				PRETRAINED_INIT_CONFIGURATION
				__A      =				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
				__A      =				SqueezeBertTokenizer


				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_   , )

								lowerCamelCase	 =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	 =getattr(UpperCAmelCase_   , normalizer_state.pop("""type"""							)							)
												lowerCamelCase	 =do_lower_case
												lowerCamelCase	 =strip_accents
												lowerCamelCase	 =tokenize_chinese_chars
												lowerCamelCase	 =normalizer_class(**UpperCAmelCase_							)

								lowerCamelCase	 =do_lower_case


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












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCAmelCase__						:			List[Any]									={'''configuration_yolos''': ['''YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''YolosConfig''', '''YolosOnnxConfig''']}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__						:			Dict									=['''YolosFeatureExtractor''']
							UpperCAmelCase__						:			List[Any]									=['''YolosImageProcessor''']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__						:			Optional[Any]									=[
							    '''YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''YolosForObjectDetection''',
							    '''YolosModel''',
							    '''YolosPreTrainedModel''',
							]


if TYPE_CHECKING:
							from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_yolos import YolosFeatureExtractor
														from .image_processing_yolos import YolosImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_yolos import (
														    YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST,
														    YolosForObjectDetection,
														    YolosModel,
														    YolosPreTrainedModel,
														)


else:
							import sys

							UpperCAmelCase__						:			Optional[Any]									=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





