



'''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


UpperCamelCase__ :			List[str] 						=				logging.get_logger(__name__)

UpperCamelCase__ :			Union[str, Any] 						=				{'vocab_file': 'vocab.txt'}

UpperCamelCase__ :			str 						=				{
    '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',
    }
}

UpperCamelCase__ :			List[str] 						=				{
    'YituTech/conv-bert-base': 5_12,
    'YituTech/conv-bert-medium-small': 5_12,
    'YituTech/conv-bert-small': 5_12,
}


UpperCamelCase__ :			Tuple 						=				{
    '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						(							_A					):


			'''simple docstring'''

			_A   :	str    					=	VOCAB_FILES_NAMES
			_A   :	int    					=	PRETRAINED_VOCAB_FILES_MAP
			_A   :	List[Any]    					=	PRETRAINED_INIT_CONFIGURATION
			_A   :	Optional[int]    					=	PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			_A   :	Optional[int]    					=	ConvBertTokenizer

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





					"""simple docstring"""






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

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

					__SCREAMING_SNAKE_CASE :	Optional[int]					 =	do_lower_case

			def UpperCamelCase__      (							self  :				int							,  lowerCAmelCase__  :				int							,  lowerCAmelCase__  :				str=None		):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE :	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 UpperCamelCase__      (							self  :				List[Any]							,  lowerCAmelCase__  :				List[int]							,  lowerCAmelCase__  :				Optional[List[int]] = None		):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE :	List[Any]					 =	[self.sep_token_id]
					__SCREAMING_SNAKE_CASE :	List[str]					 =	[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  :				Tuple							,  lowerCAmelCase__  :				str							,  lowerCAmelCase__  :				Optional[str] = None		):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE :	Tuple					 =	self._tokenizer.model.save(UpperCamelCase__							,  name=UpperCamelCase__		)
					return tuple(UpperCamelCase__		)




'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase__ :			List[Any]												=				{
    '''configuration_time_series_transformer''': [
        '''TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''TimeSeriesTransformerConfig''',
    ],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCamelCase__ :			List[Any]												=				[
						    '''TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''TimeSeriesTransformerForPrediction''',
						    '''TimeSeriesTransformerModel''',
						    '''TimeSeriesTransformerPreTrainedModel''',
						]


if TYPE_CHECKING:
						from .configuration_time_series_transformer import (
						    TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    TimeSeriesTransformerConfig,
						)

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_time_series_transformer import (
												    TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TimeSeriesTransformerForPrediction,
												    TimeSeriesTransformerModel,
												    TimeSeriesTransformerPreTrainedModel,
												)

else:
						import sys

						UpperCamelCase__ :			Dict												=				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)