





"""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_mobilebert import MobileBertTokenizer


__A											=		logging.get_logger(__name__)

__A											=		{"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

__A											=		{
    """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											=		{"""mobilebert-uncased""": 512}


__A											=		{}






class 					_lowerCAmelCase   (     a       ):
       """simple docstring"""




       __magic_name__     :str		  =					VOCAB_FILES_NAMES
       __magic_name__     :str		  =					PRETRAINED_VOCAB_FILES_MAP
       __magic_name__     :List[Any]		  =					PRETRAINED_INIT_CONFIGURATION
       __magic_name__     :Tuple		  =					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       __magic_name__     :List[str]		  =					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    , ):



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

         lowerCAmelCase__			:Optional[int]											=							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__			:List[Any]											=							getattr(__UpperCAmelCase    , normalizer_state.pop('type'      )      )
           lowerCAmelCase__			:Dict											=							do_lower_case
           lowerCAmelCase__			:Dict											=							strip_accents
           lowerCAmelCase__			:Any											=							tokenize_chinese_chars
           lowerCAmelCase__			:int											=							normalizer_class(**__UpperCAmelCase      )

         lowerCAmelCase__			:Tuple											=							do_lower_case






       def      snake_case						(    self    , __UpperCAmelCase    , __UpperCAmelCase=None      ):



         '''simple docstring'''

         lowerCAmelCase__			: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      snake_case						(    self    , __UpperCAmelCase    , __UpperCAmelCase = None      ):



         '''simple docstring'''

         lowerCAmelCase__			:Dict											=							[self.sep_token_id]
         lowerCAmelCase__			: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      snake_case						(    self    , __UpperCAmelCase    , __UpperCAmelCase = None      ):



         '''simple docstring'''

         lowerCAmelCase__			:int											=							self._tokenizer.model.save(__UpperCAmelCase    , name=__UpperCAmelCase      )
         return tuple(__UpperCAmelCase      )







"""simple docstring"""





from typing import TYPE_CHECKING

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


__A											=		{
    """configuration_data2vec_audio""": ["""DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP""", """Data2VecAudioConfig"""],
    """configuration_data2vec_text""": [
        """DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """Data2VecTextConfig""",
        """Data2VecTextOnnxConfig""",
    ],
    """configuration_data2vec_vision""": [
        """DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """Data2VecVisionConfig""",
        """Data2VecVisionOnnxConfig""",
    ],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A											=		[
      """DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """Data2VecAudioForAudioFrameClassification""",
      """Data2VecAudioForCTC""",
      """Data2VecAudioForSequenceClassification""",
      """Data2VecAudioForXVector""",
      """Data2VecAudioModel""",
      """Data2VecAudioPreTrainedModel""",
  ]
  __A											=		[
      """DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """Data2VecTextForCausalLM""",
      """Data2VecTextForMaskedLM""",
      """Data2VecTextForMultipleChoice""",
      """Data2VecTextForQuestionAnswering""",
      """Data2VecTextForSequenceClassification""",
      """Data2VecTextForTokenClassification""",
      """Data2VecTextModel""",
      """Data2VecTextPreTrainedModel""",
  ]
  __A											=		[
      """DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """Data2VecVisionForImageClassification""",
      """Data2VecVisionForMaskedImageModeling""",
      """Data2VecVisionForSemanticSegmentation""",
      """Data2VecVisionModel""",
      """Data2VecVisionPreTrainedModel""",
  ]

if is_tf_available():
  __A											=		[
      """TFData2VecVisionForImageClassification""",
      """TFData2VecVisionForSemanticSegmentation""",
      """TFData2VecVisionModel""",
      """TFData2VecVisionPreTrainedModel""",
  ]

if TYPE_CHECKING:
  from .configuration_dataavec_audio import DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP, DataaVecAudioConfig
  from .configuration_dataavec_text import (
      DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP,
      DataaVecTextConfig,
      DataaVecTextOnnxConfig,
  )
  from .configuration_dataavec_vision import (
      DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP,
      DataaVecVisionConfig,
      DataaVecVisionOnnxConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_dataavec_audio import (
        DATA2VEC_AUDIO_PRETRAINED_MODEL_ARCHIVE_LIST,
        DataaVecAudioForAudioFrameClassification,
        DataaVecAudioForCTC,
        DataaVecAudioForSequenceClassification,
        DataaVecAudioForXVector,
        DataaVecAudioModel,
        DataaVecAudioPreTrainedModel,
    )
    from .modeling_dataavec_text import (
        DATA2VEC_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
        DataaVecTextForCausalLM,
        DataaVecTextForMaskedLM,
        DataaVecTextForMultipleChoice,
        DataaVecTextForQuestionAnswering,
        DataaVecTextForSequenceClassification,
        DataaVecTextForTokenClassification,
        DataaVecTextModel,
        DataaVecTextPreTrainedModel,
    )
    from .modeling_dataavec_vision import (
        DATA2VEC_VISION_PRETRAINED_MODEL_ARCHIVE_LIST,
        DataaVecVisionForImageClassification,
        DataaVecVisionForMaskedImageModeling,
        DataaVecVisionForSemanticSegmentation,
        DataaVecVisionModel,
        DataaVecVisionPreTrainedModel,
    )
  if is_tf_available():
    from .modeling_tf_dataavec_vision import (
        TFDataaVecVisionForImageClassification,
        TFDataaVecVisionForSemanticSegmentation,
        TFDataaVecVisionModel,
        TFDataaVecVisionPreTrainedModel,
    )

else:
  import sys

  __A											=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
