






'''simple docstring'''



import json
from typing import List, Optional, Tuple

from tokenizers import normalizers
from tokenizers.pre_tokenizers import BertPreTokenizer, PreTokenizer

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_roformer import RoFormerTokenizer
from .tokenization_utils import JiebaPreTokenizer


__UpperCamelCase      :       Dict      			=      logging.get_logger(__name__)

__UpperCamelCase      :       List[Any]      			=      {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

__UpperCamelCase      :       int      			=      {
    """vocab_file""": {
        """junnyu/roformer_chinese_small""": """https://huggingface.co/junnyu/roformer_chinese_small/resolve/main/vocab.txt""",
        """junnyu/roformer_chinese_base""": """https://huggingface.co/junnyu/roformer_chinese_base/resolve/main/vocab.txt""",
        """junnyu/roformer_chinese_char_small""": (
            """https://huggingface.co/junnyu/roformer_chinese_char_small/resolve/main/vocab.txt"""
        ),
        """junnyu/roformer_chinese_char_base""": (
            """https://huggingface.co/junnyu/roformer_chinese_char_base/resolve/main/vocab.txt"""
        ),
        """junnyu/roformer_small_discriminator""": (
            """https://huggingface.co/junnyu/roformer_small_discriminator/resolve/main/vocab.txt"""
        ),
        """junnyu/roformer_small_generator""": (
            """https://huggingface.co/junnyu/roformer_small_generator/resolve/main/vocab.txt"""
        ),
    }
}

__UpperCamelCase      :       List[str]      			=      {
    """junnyu/roformer_chinese_small""": 1536,
    """junnyu/roformer_chinese_base""": 1536,
    """junnyu/roformer_chinese_char_small""": 512,
    """junnyu/roformer_chinese_char_base""": 512,
    """junnyu/roformer_small_discriminator""": 128,
    """junnyu/roformer_small_generator""": 128,
}


__UpperCamelCase      :       List[str]      			=      {
    """junnyu/roformer_chinese_small""": {"""do_lower_case""": True},
    """junnyu/roformer_chinese_base""": {"""do_lower_case""": True},
    """junnyu/roformer_chinese_char_small""": {"""do_lower_case""": True},
    """junnyu/roformer_chinese_char_base""": {"""do_lower_case""": True},
    """junnyu/roformer_small_discriminator""": {"""do_lower_case""": True},
    """junnyu/roformer_small_generator""": {"""do_lower_case""": True},
}
class 							__SCREAMING_SNAKE_CASE       (							_lowerCAmelCase     ):
      __a  					=VOCAB_FILES_NAMES
      __a  					=PRETRAINED_VOCAB_FILES_MAP
      __a  					=PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      __a  					=PRETRAINED_INIT_CONFIGURATION
      __a  					=RoFormerTokenizer




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

         __a				     =    json.loads(self.backend_tokenizer.normalizer.__getstate__()      )
         if (
             pre_tok_state.get('lowercase' ,   __UpperCamelCase      ) != do_lower_case
             or pre_tok_state.get('strip_accents' ,   __UpperCamelCase      ) != strip_accents
         ):
            __a				     =    getattr(__UpperCamelCase ,   pre_tok_state.pop('type'      )      )
            __a				     =    do_lower_case
            __a				     =    strip_accents
            __a				     =    pre_tok_class(**__UpperCamelCase      )

         __a				     =    do_lower_case




      def __getstate__(  self      )							->Tuple:



         '''simple docstring'''
         __a				     =    self.__dict__.copy()
         __a				     =    BertPreTokenizer()
         return state




      def __setstate__(  self ,   lowerCamelCase      )							->List[str]:



         '''simple docstring'''
         __a				     =    d
         __a				     =    self.__dict__['_tokenizer'].get_vocab()
         __a				     =    PreTokenizer.custom(JiebaPreTokenizer(__UpperCamelCase      )      )




      def  __UpperCamelCase							(  self ,   lowerCamelCase ,   lowerCamelCase=None      )							->Optional[Any]:



         '''simple docstring'''
         __a				     =    [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 ,   lowerCamelCase ,   lowerCamelCase = None      )							->Dict:



         '''simple docstring'''
         __a				     =    [self.sep_token_id]
         __a				     =    [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 ,   lowerCamelCase ,   lowerCamelCase = None      )							->Union[str, Any]:



         '''simple docstring'''
         __a				     =    self._tokenizer.model.save(__UpperCamelCase ,   name=__UpperCamelCase      )
         return tuple(__UpperCamelCase      )






      def  __UpperCamelCase							(  self ,   lowerCamelCase ,   lowerCamelCase=None ,   lowerCamelCase=None ,   lowerCamelCase=False ,   **lowerCamelCase ,   )							->Tuple:



         '''simple docstring'''
         __a				     =    BertPreTokenizer()
         return super().save_pretrained(__UpperCamelCase ,   __UpperCamelCase ,   __UpperCamelCase ,   __UpperCamelCase ,   **__UpperCamelCase      )







'''simple docstring'''



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


__UpperCamelCase      :       Dict      			=      logging.get_logger(__name__)

__UpperCamelCase      :       Any      			=      {
    """google/vivit-b-16x2-kinetics400""": (
        """https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json"""
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}
class 							__SCREAMING_SNAKE_CASE       (							_lowerCAmelCase     ):
      __a  					="vivit"




      def __init__(  self ,   lowerCamelCase=224 ,   lowerCamelCase=32 ,   lowerCamelCase=[2, 16, 16] ,   lowerCamelCase=3 ,   lowerCamelCase=768 ,   lowerCamelCase=12 ,   lowerCamelCase=12 ,   lowerCamelCase=3072 ,   lowerCamelCase="gelu_fast" ,   lowerCamelCase=0.0 ,   lowerCamelCase=0.0 ,   lowerCamelCase=0.02 ,   lowerCamelCase=1e-06 ,   lowerCamelCase=True ,   **lowerCamelCase ,   )							->Tuple:



         '''simple docstring'''
         __a				     =    hidden_size
         __a				     =    num_hidden_layers
         __a				     =    num_attention_heads
         __a				     =    intermediate_size
         __a				     =    hidden_act
         __a				     =    hidden_dropout_prob
         __a				     =    attention_probs_dropout_prob
         __a				     =    initializer_range
         __a				     =    layer_norm_eps

         __a				     =    image_size
         __a				     =    num_frames
         __a				     =    tubelet_size
         __a				     =    num_channels
         __a				     =    qkv_bias

         super().__init__(**lowerCamelCase      )