

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


A_       : List[Any]         =			logging.get_logger(__name__)

A_       : List[str]         =			{'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

A_       : Tuple         =			{
    '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'
        ),
    },
}

A_       : Tuple         =			{
    'squeezebert/squeezebert-uncased': 512,
    'squeezebert/squeezebert-mnli': 512,
    'squeezebert/squeezebert-mnli-headless': 512,
}


A_       : Union[str, Any]         =			{
    'squeezebert/squeezebert-uncased': {'do_lower_case': True},
    'squeezebert/squeezebert-mnli': {'do_lower_case': True},
    'squeezebert/squeezebert-mnli-headless': {'do_lower_case': True},
}



class     _a						(__magic_name__				):


					'''simple docstring'''






					UpperCAmelCase__:   List[str]  							=       VOCAB_FILES_NAMES
					UpperCAmelCase__:   int  							=       PRETRAINED_VOCAB_FILES_MAP
					UpperCAmelCase__:   Optional[Any]  							=       PRETRAINED_INIT_CONFIGURATION
					UpperCAmelCase__:   str  							=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
					UpperCAmelCase__:   List[str]  							=       SqueezeBertTokenizer






					def __init__( self    ,       A__=None    ,       A__=None    ,       A__=True    ,       A__="[UNK]"    ,       A__="[SEP]"    ,       A__="[PAD]"    ,       A__="[CLS]"    ,       A__="[MASK]"    ,       A__=True    ,       A__=None    ,       **A__    ,       ):
						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__    ,       )

						A__							:    Optional[int]        =		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
						):
							A__							:    Any        =		getattr(A__    ,       normalizer_state.pop("""type"""			)			)
							A__							:    Optional[Any]        =		do_lower_case
							A__							:    str        =		strip_accents
							A__							:    Dict        =		tokenize_chinese_chars
							A__							:    int        =		normalizer_class(**A__			)

						A__							:    Optional[Any]        =		do_lower_case






					def   __A			( self    ,       A__    ,       A__=None			):
						A__							:    List[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   __A			( self    ,       A__    ,       A__ = None			):
						A__							:    Tuple        =		[self.sep_token_id]
						A__							:    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   __A			( self    ,       A__    ,       A__ = None			):
						A__							:    List[str]        =		self._tokenizer.model.save(A__    ,       name=A__			)
						return tuple(A__			)






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


A_       : int         =			logging.get_logger(__name__)

A_       : Optional[Any]         =			{
    'alibaba-damo/mgp-str-base': 'https://huggingface.co/alibaba-damo/mgp-str-base/resolve/main/config.json',
}



class     _a						(__magic_name__				):


					'''simple docstring'''






					UpperCAmelCase__:   List[Any]  							=       '''mgp-str'''






					def __init__( self    ,       A__=[32, 128]    ,       A__=4    ,       A__=3    ,       A__=27    ,       A__=38    ,       A__=5_0257    ,       A__=3_0522    ,       A__=768    ,       A__=12    ,       A__=12    ,       A__=4.0    ,       A__=True    ,       A__=False    ,       A__=1e-5    ,       A__=0.0    ,       A__=0.0    ,       A__=0.0    ,       A__=False    ,       A__=0.0_2    ,       **A__    ,       ):
						super().__init__(**A__			)

						A__							:    Dict        =		image_size
						A__							:    int        =		patch_size
						A__							:    Dict        =		num_channels
						A__							:    List[Any]        =		max_token_length
						A__							:    str        =		num_character_labels
						A__							:    Tuple        =		num_bpe_labels
						A__							:    Optional[Any]        =		num_wordpiece_labels
						A__							:    Optional[int]        =		hidden_size
						A__							:    Tuple        =		num_hidden_layers
						A__							:    Any        =		num_attention_heads
						A__							:    List[Any]        =		mlp_ratio
						A__							:    Tuple        =		distilled
						A__							:    Union[str, Any]        =		layer_norm_eps
						A__							:    Tuple        =		drop_rate
						A__							:    List[str]        =		qkv_bias
						A__							:    Optional[Any]        =		attn_drop_rate
						A__							:    Union[str, Any]        =		drop_path_rate
						A__							:    Optional[Any]        =		output_aa_attentions
						A__							:    Optional[int]        =		initializer_range



