




'''simple docstring'''
import os
import re
import unicodedata
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import AddedToken, PreTrainedTokenizer
from ...utils import logging


A							:				str			     =	logging.get_logger(__name__)
A							:				List[Any]			     =	{"""vocab_file""": """spiece.model"""}

A							:				List[str]			     =	{
    """vocab_file""": {
        """google/fnet-base""": """https://huggingface.co/google/fnet-base/resolve/main/spiece.model""",
        """google/fnet-large""": """https://huggingface.co/google/fnet-large/resolve/main/spiece.model""",
    },
}

A							:				List[str]			     =	{
    """google/fnet-base""": 512,
    """google/fnet-large""": 512,
}

A							:				List[str]			     =	"""▁"""






class 	SCREAMING_SNAKE_CASE(    lowercase__					):
       snake_case_			:					Union[str, Any]   = VOCAB_FILES_NAMES
       snake_case_			:					Union[str, Any]   = PRETRAINED_VOCAB_FILES_MAP
       snake_case_			:					Optional[Any]   = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
       snake_case_			:					str   = ['''input_ids''', '''token_type_ids''']

       def __init__(   self ,		lowerCamelCase__ ,		lowerCamelCase__=False ,		lowerCamelCase__=True ,		lowerCamelCase__=True ,		lowerCamelCase__="<unk>" ,		lowerCamelCase__="[SEP]" ,		lowerCamelCase__="<pad>" ,		lowerCamelCase__="[CLS]" ,		lowerCamelCase__="[MASK]" ,		lowerCamelCase__ = None ,		**lowerCamelCase__ ,		)   -> None:

           """simple docstring"""



           __lowercase          =						(
               AddedToken(lowerCAmelCase__ ,		lstrip=lowerCAmelCase__ ,		rstrip=lowerCAmelCase__ ,		normalized=lowerCAmelCase__					)
               if isinstance(lowerCAmelCase__ ,		lowerCAmelCase__					)
               else mask_token
           )

           __lowercase          =						{} if sp_model_kwargs is None else sp_model_kwargs

           super().__init__(
               do_lower_case=lowerCAmelCase__ ,		remove_space=lowerCAmelCase__ ,		keep_accents=lowerCAmelCase__ ,		unk_token=lowerCAmelCase__ ,		sep_token=lowerCAmelCase__ ,		pad_token=lowerCAmelCase__ ,		cls_token=lowerCAmelCase__ ,		mask_token=lowerCAmelCase__ ,		sp_model_kwargs=self.sp_model_kwargs ,		**lowerCAmelCase__ ,		)

           __lowercase          =						do_lower_case
           __lowercase          =						remove_space
           __lowercase          =						keep_accents
           __lowercase          =						vocab_file

           __lowercase          =						spm.SentencePieceProcessor(**self.sp_model_kwargs					)
           self.sp_model.Load(lowerCAmelCase__					)

       @property
       def    snake_case__      (   self					)   -> Any:

           """simple docstring"""



           return len(self.sp_model					)

       def    snake_case__      (   self					)   -> List[str]:

           """simple docstring"""



           __lowercase          =						{self.convert_ids_to_tokens(lowerCAmelCase__					): i for i in range(self.vocab_size					)}
           vocab.update(self.added_tokens_encoder					)
           return vocab

       def __getstate__(   self					)   -> int:

           """simple docstring"""



           __lowercase          =						self.__dict__.copy()
           __lowercase          =						None
           return state

       def __setstate__(   self ,		lowerCamelCase__					)   -> Optional[Any]:

           """simple docstring"""



           __lowercase          =						d

           # for backward compatibility
           if not hasattr(self ,		"""sp_model_kwargs"""					):
               __lowercase          =						{}

           __lowercase          =						spm.SentencePieceProcessor(**self.sp_model_kwargs					)
           self.sp_model.Load(self.vocab_file					)

       def    snake_case__      (   self ,		lowerCamelCase__					)   -> Optional[Any]:

           """simple docstring"""



           if self.remove_space:
               __lowercase          =						""" """.join(inputs.strip().split()					)
           else:
               __lowercase          =						inputs
           __lowercase          =						outputs.replace("""``""" ,		"""\""""					).replace("""\'\'""" ,		"""\""""					)

           if not self.keep_accents:
               __lowercase          =						unicodedata.normalize("""NFKD""" ,		lowerCAmelCase__					)
               __lowercase          =						"""""".join([c for c in outputs if not unicodedata.combining(lowerCAmelCase__					)]					)
           if self.do_lower_case:
               __lowercase          =						outputs.lower()

           return outputs

       def    snake_case__      (   self ,		lowerCamelCase__					)   -> List[str]:

           """simple docstring"""



           __lowercase          =						self.preprocess_text(lowerCAmelCase__					)
           __lowercase          =						self.sp_model.encode(lowerCAmelCase__ ,		out_type=lowerCAmelCase__					)
           __lowercase          =						[]
           for piece in pieces:
               if len(lowerCAmelCase__					) > 1 and piece[-1] == str(""","""					) and piece[-2].isdigit():
                   __lowercase          =						self.sp_model.EncodeAsPieces(piece[:-1].replace(lowerCAmelCase__ ,		""""""					)					)
                   if piece[0] != SPIECE_UNDERLINE and cur_pieces[0][0] == SPIECE_UNDERLINE:
                       if len(cur_pieces[0]					) == 1:
                           __lowercase          =						cur_pieces[1:]
                       else:
                           __lowercase          =						cur_pieces[0][1:]
                   cur_pieces.append(piece[-1]					)
                   new_pieces.extend(lowerCAmelCase__					)
               else:
                   new_pieces.append(lowerCAmelCase__					)

           return new_pieces

       def    snake_case__      (   self ,		lowerCamelCase__					)   -> Tuple:

           """simple docstring"""



           return self.sp_model.PieceToId(lowerCAmelCase__					)

       def    snake_case__      (   self ,		lowerCamelCase__					)   -> Any:

           """simple docstring"""



           return self.sp_model.IdToPiece(lowerCAmelCase__					)

       def    snake_case__      (   self ,		lowerCamelCase__					)   -> str:

           """simple docstring"""



           __lowercase          =						[]
           __lowercase          =						""""""
           __lowercase          =						False
           for token in tokens:
               # make sure that special tokens are not decoded using sentencepiece model
               if token in self.all_special_tokens:
                   if not prev_is_special:
                       out_string += " "
                   out_string += self.sp_model.decode(lowerCAmelCase__					) + token
                   __lowercase          =						True
                   __lowercase          =						[]
               else:
                   current_sub_tokens.append(lowerCAmelCase__					)
                   __lowercase          =						False
           out_string += self.sp_model.decode(lowerCAmelCase__					)
           return out_string.strip()

       def    snake_case__      (   self ,		lowerCamelCase__ ,		lowerCamelCase__ = False ,		lowerCamelCase__ = None ,		lowerCamelCase__ = True ,		**lowerCamelCase__ ,		)   -> str:

           """simple docstring"""



           __lowercase          =						kwargs.pop("""use_source_tokenizer""" ,		lowerCAmelCase__					)

           __lowercase          =						self.convert_ids_to_tokens(lowerCAmelCase__ ,		skip_special_tokens=lowerCAmelCase__					)

           # To avoid mixing byte-level and unicode for byte-level BPT
           # we need to build string separately for added tokens and byte-level tokens
           # cf. https://github.com/huggingface/transformers/issues/1133
           __lowercase          =						[]
           __lowercase          =						[]
           for token in filtered_tokens:
               if skip_special_tokens and token in self.all_special_ids:
                   continue
               if token in self.added_tokens_encoder:
                   if current_sub_text:
                       sub_texts.append(self.convert_tokens_to_string(lowerCAmelCase__					)					)
                       __lowercase          =						[]
                   sub_texts.append(lowerCAmelCase__					)
               else:
                   current_sub_text.append(lowerCAmelCase__					)
           if current_sub_text:
               sub_texts.append(self.convert_tokens_to_string(lowerCAmelCase__					)					)

           # Mimic the behavior of the Rust tokenizer:
           # No space after <unk>
           if spaces_between_special_tokens:
               __lowercase          =						re.sub(R"""(<unk>) """ ,		R"""\1""" ,		""" """.join(lowerCAmelCase__					)					)
           else:
               __lowercase          =						"""""".join(lowerCAmelCase__					)

           __lowercase          =						(
               clean_up_tokenization_spaces
               if clean_up_tokenization_spaces is not None
               else self.clean_up_tokenization_spaces
           )
           if clean_up_tokenization_spaces:
               __lowercase          =						self.clean_up_tokenization(lowerCAmelCase__					)
               return clean_text
           else:
               return text

       def    snake_case__      (   self ,		lowerCamelCase__ ,		lowerCamelCase__ = None					)   -> List[int]:

           """simple docstring"""



           __lowercase          =						[self.sep_token_id]
           __lowercase          =						[self.cls_token_id]
           if token_ids_a is None:
               return cls + token_ids_a + sep
           return cls + token_ids_a + sep + token_ids_a + sep

       def    snake_case__      (   self ,		lowerCamelCase__ ,		lowerCamelCase__ = None ,		lowerCamelCase__ = False					)   -> List[int]:

           """simple docstring"""



           if already_has_special_tokens:
               return super().get_special_tokens_mask(
                   token_ids_a=lowerCAmelCase__ ,		token_ids_a=lowerCAmelCase__ ,		already_has_special_tokens=lowerCAmelCase__					)

           if token_ids_a is not None:
               return [1] + ([0] * len(lowerCAmelCase__					)) + [1] + ([0] * len(lowerCAmelCase__					)) + [1]
           return [1] + ([0] * len(lowerCAmelCase__					)) + [1]

       def    snake_case__      (   self ,		lowerCamelCase__ ,		lowerCamelCase__ = None					)   -> List[int]:

           """simple docstring"""



           __lowercase          =						[self.sep_token_id]
           __lowercase          =						[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 ,		lowerCamelCase__ ,		lowerCamelCase__ = None					)   -> Tuple[str]:

           """simple docstring"""



           if not os.path.isdir(lowerCAmelCase__					):
               logger.error(F'Vocabulary path ({save_directory}) should be a directory'					)
               return
           __lowercase          =						os.path.join(
               lowerCAmelCase__ ,		(filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]					)

           if os.path.abspath(self.vocab_file					) != os.path.abspath(lowerCAmelCase__					) and os.path.isfile(self.vocab_file					):
               copyfile(self.vocab_file ,		lowerCAmelCase__					)
           elif not os.path.isfile(self.vocab_file					):
               with open(lowerCAmelCase__ ,		"""wb"""					) as fi:
                   __lowercase          =						self.sp_model.serialized_model_proto()
                   fi.write(lowerCAmelCase__					)

           return (out_vocab_file,)










'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


A							:				List[str]			     =	{
    """auto_factory""": ["""get_values"""],
    """configuration_auto""": ["""ALL_PRETRAINED_CONFIG_ARCHIVE_MAP""", """CONFIG_MAPPING""", """MODEL_NAMES_MAPPING""", """AutoConfig"""],
    """feature_extraction_auto""": ["""FEATURE_EXTRACTOR_MAPPING""", """AutoFeatureExtractor"""],
    """image_processing_auto""": ["""IMAGE_PROCESSOR_MAPPING""", """AutoImageProcessor"""],
    """processing_auto""": ["""PROCESSOR_MAPPING""", """AutoProcessor"""],
    """tokenization_auto""": ["""TOKENIZER_MAPPING""", """AutoTokenizer"""],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  A							:				Optional[Any]			     =	[
      """MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_AUDIO_XVECTOR_MAPPING""",
      """MODEL_FOR_BACKBONE_MAPPING""",
      """MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING""",
      """MODEL_FOR_CAUSAL_LM_MAPPING""",
      """MODEL_FOR_CTC_MAPPING""",
      """MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING""",
      """MODEL_FOR_DEPTH_ESTIMATION_MAPPING""",
      """MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_IMAGE_SEGMENTATION_MAPPING""",
      """MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING""",
      """MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING""",
      """MODEL_FOR_MASKED_LM_MAPPING""",
      """MODEL_FOR_MASK_GENERATION_MAPPING""",
      """MODEL_FOR_MULTIPLE_CHOICE_MAPPING""",
      """MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING""",
      """MODEL_FOR_OBJECT_DETECTION_MAPPING""",
      """MODEL_FOR_PRETRAINING_MAPPING""",
      """MODEL_FOR_QUESTION_ANSWERING_MAPPING""",
      """MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING""",
      """MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING""",
      """MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING""",
      """MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING""",
      """MODEL_FOR_TEXT_ENCODING_MAPPING""",
      """MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING""",
      """MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_VISION_2_SEQ_MAPPING""",
      """MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING""",
      """MODEL_MAPPING""",
      """MODEL_WITH_LM_HEAD_MAPPING""",
      """MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING""",
      """MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING""",
      """AutoModel""",
      """AutoBackbone""",
      """AutoModelForAudioClassification""",
      """AutoModelForAudioFrameClassification""",
      """AutoModelForAudioXVector""",
      """AutoModelForCausalLM""",
      """AutoModelForCTC""",
      """AutoModelForDepthEstimation""",
      """AutoModelForImageClassification""",
      """AutoModelForImageSegmentation""",
      """AutoModelForInstanceSegmentation""",
      """AutoModelForMaskGeneration""",
      """AutoModelForTextEncoding""",
      """AutoModelForMaskedImageModeling""",
      """AutoModelForMaskedLM""",
      """AutoModelForMultipleChoice""",
      """AutoModelForNextSentencePrediction""",
      """AutoModelForObjectDetection""",
      """AutoModelForPreTraining""",
      """AutoModelForQuestionAnswering""",
      """AutoModelForSemanticSegmentation""",
      """AutoModelForSeq2SeqLM""",
      """AutoModelForSequenceClassification""",
      """AutoModelForSpeechSeq2Seq""",
      """AutoModelForTableQuestionAnswering""",
      """AutoModelForTokenClassification""",
      """AutoModelForUniversalSegmentation""",
      """AutoModelForVideoClassification""",
      """AutoModelForVision2Seq""",
      """AutoModelForVisualQuestionAnswering""",
      """AutoModelForDocumentQuestionAnswering""",
      """AutoModelWithLMHead""",
      """AutoModelForZeroShotImageClassification""",
      """AutoModelForZeroShotObjectDetection""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  A							:				Dict			     =	[
      """TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING""",
      """TF_MODEL_FOR_CAUSAL_LM_MAPPING""",
      """TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING""",
      """TF_MODEL_FOR_MASK_GENERATION_MAPPING""",
      """TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING""",
      """TF_MODEL_FOR_MASKED_LM_MAPPING""",
      """TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING""",
      """TF_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING""",
      """TF_MODEL_FOR_PRETRAINING_MAPPING""",
      """TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING""",
      """TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING""",
      """TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING""",
      """TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING""",
      """TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING""",
      """TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING""",
      """TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING""",
      """TF_MODEL_FOR_TEXT_ENCODING_MAPPING""",
      """TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING""",
      """TF_MODEL_FOR_VISION_2_SEQ_MAPPING""",
      """TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING""",
      """TF_MODEL_MAPPING""",
      """TF_MODEL_WITH_LM_HEAD_MAPPING""",
      """TFAutoModel""",
      """TFAutoModelForAudioClassification""",
      """TFAutoModelForCausalLM""",
      """TFAutoModelForImageClassification""",
      """TFAutoModelForMaskedImageModeling""",
      """TFAutoModelForMaskedLM""",
      """TFAutoModelForMaskGeneration""",
      """TFAutoModelForMultipleChoice""",
      """TFAutoModelForNextSentencePrediction""",
      """TFAutoModelForPreTraining""",
      """TFAutoModelForDocumentQuestionAnswering""",
      """TFAutoModelForQuestionAnswering""",
      """TFAutoModelForSemanticSegmentation""",
      """TFAutoModelForSeq2SeqLM""",
      """TFAutoModelForSequenceClassification""",
      """TFAutoModelForSpeechSeq2Seq""",
      """TFAutoModelForTableQuestionAnswering""",
      """TFAutoModelForTextEncoding""",
      """TFAutoModelForTokenClassification""",
      """TFAutoModelForVision2Seq""",
      """TFAutoModelForZeroShotImageClassification""",
      """TFAutoModelWithLMHead""",
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  A							:				Tuple			     =	[
      """FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING""",
      """FLAX_MODEL_FOR_CAUSAL_LM_MAPPING""",
      """FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING""",
      """FLAX_MODEL_FOR_MASKED_LM_MAPPING""",
      """FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING""",
      """FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING""",
      """FLAX_MODEL_FOR_PRETRAINING_MAPPING""",
      """FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING""",
      """FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING""",
      """FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING""",
      """FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING""",
      """FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING""",
      """FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING""",
      """FLAX_MODEL_MAPPING""",
      """FlaxAutoModel""",
      """FlaxAutoModelForCausalLM""",
      """FlaxAutoModelForImageClassification""",
      """FlaxAutoModelForMaskedLM""",
      """FlaxAutoModelForMultipleChoice""",
      """FlaxAutoModelForNextSentencePrediction""",
      """FlaxAutoModelForPreTraining""",
      """FlaxAutoModelForQuestionAnswering""",
      """FlaxAutoModelForSeq2SeqLM""",
      """FlaxAutoModelForSequenceClassification""",
      """FlaxAutoModelForSpeechSeq2Seq""",
      """FlaxAutoModelForTokenClassification""",
      """FlaxAutoModelForVision2Seq""",
  ]


if TYPE_CHECKING:
  from .auto_factory import get_values
  from .configuration_auto import ALL_PRETRAINED_CONFIG_ARCHIVE_MAP, CONFIG_MAPPING, MODEL_NAMES_MAPPING, AutoConfig
  from .feature_extraction_auto import FEATURE_EXTRACTOR_MAPPING, AutoFeatureExtractor
  from .image_processing_auto import IMAGE_PROCESSOR_MAPPING, AutoImageProcessor
  from .processing_auto import PROCESSOR_MAPPING, AutoProcessor
  from .tokenization_auto import TOKENIZER_MAPPING, AutoTokenizer

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_auto import (
        MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING,
        MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING,
        MODEL_FOR_AUDIO_XVECTOR_MAPPING,
        MODEL_FOR_BACKBONE_MAPPING,
        MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING,
        MODEL_FOR_CAUSAL_LM_MAPPING,
        MODEL_FOR_CTC_MAPPING,
        MODEL_FOR_DEPTH_ESTIMATION_MAPPING,
        MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING,
        MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
        MODEL_FOR_IMAGE_SEGMENTATION_MAPPING,
        MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING,
        MODEL_FOR_MASK_GENERATION_MAPPING,
        MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING,
        MODEL_FOR_MASKED_LM_MAPPING,
        MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
        MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING,
        MODEL_FOR_OBJECT_DETECTION_MAPPING,
        MODEL_FOR_PRETRAINING_MAPPING,
        MODEL_FOR_QUESTION_ANSWERING_MAPPING,
        MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING,
        MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
        MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
        MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING,
        MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING,
        MODEL_FOR_TEXT_ENCODING_MAPPING,
        MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
        MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING,
        MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING,
        MODEL_FOR_VISION_2_SEQ_MAPPING,
        MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING,
        MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING,
        MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING,
        MODEL_MAPPING,
        MODEL_WITH_LM_HEAD_MAPPING,
        AutoBackbone,
        AutoModel,
        AutoModelForAudioClassification,
        AutoModelForAudioFrameClassification,
        AutoModelForAudioXVector,
        AutoModelForCausalLM,
        AutoModelForCTC,
        AutoModelForDepthEstimation,
        AutoModelForDocumentQuestionAnswering,
        AutoModelForImageClassification,
        AutoModelForImageSegmentation,
        AutoModelForInstanceSegmentation,
        AutoModelForMaskedImageModeling,
        AutoModelForMaskedLM,
        AutoModelForMaskGeneration,
        AutoModelForMultipleChoice,
        AutoModelForNextSentencePrediction,
        AutoModelForObjectDetection,
        AutoModelForPreTraining,
        AutoModelForQuestionAnswering,
        AutoModelForSemanticSegmentation,
        AutoModelForSeqaSeqLM,
        AutoModelForSequenceClassification,
        AutoModelForSpeechSeqaSeq,
        AutoModelForTableQuestionAnswering,
        AutoModelForTextEncoding,
        AutoModelForTokenClassification,
        AutoModelForUniversalSegmentation,
        AutoModelForVideoClassification,
        AutoModelForVisionaSeq,
        AutoModelForVisualQuestionAnswering,
        AutoModelForZeroShotImageClassification,
        AutoModelForZeroShotObjectDetection,
        AutoModelWithLMHead,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_auto import (
        TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING,
        TF_MODEL_FOR_CAUSAL_LM_MAPPING,
        TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING,
        TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
        TF_MODEL_FOR_MASK_GENERATION_MAPPING,
        TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING,
        TF_MODEL_FOR_MASKED_LM_MAPPING,
        TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
        TF_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING,
        TF_MODEL_FOR_PRETRAINING_MAPPING,
        TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING,
        TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING,
        TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
        TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
        TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING,
        TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING,
        TF_MODEL_FOR_TEXT_ENCODING_MAPPING,
        TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
        TF_MODEL_FOR_VISION_2_SEQ_MAPPING,
        TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING,
        TF_MODEL_MAPPING,
        TF_MODEL_WITH_LM_HEAD_MAPPING,
        TFAutoModel,
        TFAutoModelForAudioClassification,
        TFAutoModelForCausalLM,
        TFAutoModelForDocumentQuestionAnswering,
        TFAutoModelForImageClassification,
        TFAutoModelForMaskedImageModeling,
        TFAutoModelForMaskedLM,
        TFAutoModelForMaskGeneration,
        TFAutoModelForMultipleChoice,
        TFAutoModelForNextSentencePrediction,
        TFAutoModelForPreTraining,
        TFAutoModelForQuestionAnswering,
        TFAutoModelForSemanticSegmentation,
        TFAutoModelForSeqaSeqLM,
        TFAutoModelForSequenceClassification,
        TFAutoModelForSpeechSeqaSeq,
        TFAutoModelForTableQuestionAnswering,
        TFAutoModelForTextEncoding,
        TFAutoModelForTokenClassification,
        TFAutoModelForVisionaSeq,
        TFAutoModelForZeroShotImageClassification,
        TFAutoModelWithLMHead,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_auto import (
        FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING,
        FLAX_MODEL_FOR_CAUSAL_LM_MAPPING,
        FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
        FLAX_MODEL_FOR_MASKED_LM_MAPPING,
        FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
        FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING,
        FLAX_MODEL_FOR_PRETRAINING_MAPPING,
        FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING,
        FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING,
        FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
        FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING,
        FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
        FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING,
        FLAX_MODEL_MAPPING,
        FlaxAutoModel,
        FlaxAutoModelForCausalLM,
        FlaxAutoModelForImageClassification,
        FlaxAutoModelForMaskedLM,
        FlaxAutoModelForMultipleChoice,
        FlaxAutoModelForNextSentencePrediction,
        FlaxAutoModelForPreTraining,
        FlaxAutoModelForQuestionAnswering,
        FlaxAutoModelForSeqaSeqLM,
        FlaxAutoModelForSequenceClassification,
        FlaxAutoModelForSpeechSeqaSeq,
        FlaxAutoModelForTokenClassification,
        FlaxAutoModelForVisionaSeq,
    )

else:
  import sys

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




