import json
import os
from typing import List, Optional, Tuple

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


lowerCAmelCase__					=				logging.get_logger(__name__)

lowerCAmelCase__					=				{
    'vocab_file': 'vocab.json',
    'merges_file': 'merges.txt',
}

lowerCAmelCase__					=				{
    'vocab_file': {
        'microsoft/biogpt': 'https://huggingface.co/microsoft/biogpt/resolve/main/vocab.json',
    },
    'merges_file': {'microsoft/biogpt': 'https://huggingface.co/microsoft/biogpt/resolve/main/merges.txt'},
}

lowerCAmelCase__					=				{
    'microsoft/biogpt': 1024,
}






def    __lowerCamelCase	(		lowerCAmelCase__			):
       lowerCAmelCase__  			=      set()
       lowerCAmelCase__  			=      word[0]
       for char in word[1:]:
              pairs.add((prev_char, char)			)
              lowerCAmelCase__  			=      char
       return pairs



class        a_				(		SCREAMING_SNAKE_CASE		):






 '''simple docstring'''






 UpperCAmelCase_							=      VOCAB_FILES_NAMES
 UpperCAmelCase_							=      PRETRAINED_VOCAB_FILES_MAP
 UpperCAmelCase_							=      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 UpperCAmelCase_							=      ['input_ids', 'attention_mask']




 def __init__(    self      :						List[str]    ,					lowercase__      :						Any    ,					lowercase__      :						int    ,					lowercase__      :						Union[str, Any]="<unk>"    ,					lowercase__      :						Optional[Any]="<s>"    ,					lowercase__      :						Dict="</s>"    ,					lowercase__      :						Tuple="</s>"    ,					lowercase__      :						Optional[Any]="<pad>"    ,					**lowercase__      :						Optional[int]    ,					):







        '''simple docstring'''



        super().__init__(
            bos_token=lowercase__    ,					eos_token=lowercase__    ,					sep_token=lowercase__    ,					unk_token=lowercase__    ,					pad_token=lowercase__    ,					**lowercase__    ,					)

        try:
               import sacremoses
        except ImportError:
               raise ImportError(
                   'You need to install sacremoses to use BioGptTokenizer. '
                   'See https://pypi.org/project/sacremoses/ for installation.')

        lowerCAmelCase__  			=      'en'
        lowerCAmelCase__  			=      sacremoses
        # cache of sm.MosesTokenizer instance
        lowerCAmelCase__  			=      {}
        lowerCAmelCase__  			=      {}
        with open(lowercase__    ,					encoding='utf-8') as vocab_handle:
               lowerCAmelCase__  			=      json.load(lowercase__)
        lowerCAmelCase__  			=      {v: k for k, v in self.encoder.items()}
        with open(lowercase__    ,					encoding='utf-8') as merges_handle:
               lowerCAmelCase__  			=      merges_handle.read().split('\n')[:-1]
        lowerCAmelCase__  			=      [tuple(merge.split()[:2]) for merge in merges]
        lowerCAmelCase__  			=      dict(zip(lowercase__    ,					range(len(lowercase__))))
        lowerCAmelCase__  			=      {}




 @property
 def 	__snake_case		(    self      :						Optional[Any]):







        '''simple docstring'''



        return len(self.encoder)




 def 	__snake_case		(    self      :						List[str]):







        '''simple docstring'''



        return dict(self.encoder    ,					**self.added_tokens_encoder)




 def 	__snake_case		(    self      :						Optional[int]    ,					lowercase__      :						List[Any]    ,					lowercase__      :						int):







        '''simple docstring'''



        if lang not in self.cache_moses_tokenizer:
               lowerCAmelCase__  			=      self.sm.MosesTokenizer(lang=lowercase__)
               lowerCAmelCase__  			=      moses_tokenizer
        return self.cache_moses_tokenizer[lang].tokenize(
            lowercase__    ,					aggressive_dash_splits=lowercase__    ,					return_str=lowercase__    ,					escape=lowercase__)




 def 	__snake_case		(    self      :						Optional[int]    ,					lowercase__      :						Tuple    ,					lowercase__      :						Any):







        '''simple docstring'''



        if lang not in self.cache_moses_detokenizer:
               lowerCAmelCase__  			=      self.sm.MosesDetokenizer(lang=lowercase__)
               lowerCAmelCase__  			=      moses_detokenizer
        return self.cache_moses_detokenizer[lang].detokenize(lowercase__)




 def 	__snake_case		(    self      :						Dict    ,					lowercase__      :						Union[str, Any]):







        '''simple docstring'''



        lowerCAmelCase__  			=      tuple(token[:-1]) + (token[-1] + '</w>',)
        if token in self.cache:
               return self.cache[token]
        lowerCAmelCase__  			=      get_pairs(lowercase__)

        if not pairs:
               return token + "</w>"

        while True:
               lowerCAmelCase__  			=      min(lowercase__    ,					key=lambda lowercase__: self.bpe_ranks.get(lowercase__    ,					float('inf')))
               if bigram not in self.bpe_ranks:
                      break
               lowerCAmelCase__			,      lowerCAmelCase__  			=      bigram
               lowerCAmelCase__  			=      []
               lowerCAmelCase__  			=      0
               while i < len(lowercase__):
                      try:
                             lowerCAmelCase__  			=      word.index(lowercase__    ,					lowercase__)
                      except ValueError:
                             new_word.extend(word[i:])
                             break
                      else:
                             new_word.extend(word[i:j])
                             lowerCAmelCase__  			=      j

                      if word[i] == first and i < len(lowercase__) - 1 and word[i + 1] == second:
                             new_word.append(first + second)
                             i += 2
                      else:
                             new_word.append(word[i])
                             i += 1
               lowerCAmelCase__  			=      tuple(lowercase__)
               lowerCAmelCase__  			=      new_word
               if len(lowercase__) == 1:
                      break
               else:
                      lowerCAmelCase__  			=      get_pairs(lowercase__)
        lowerCAmelCase__  			=      ' '.join(lowercase__)
        if word == "\n  </w>":
               lowerCAmelCase__  			=      '\n</w>'
        lowerCAmelCase__  			=      word
        return word




 def 	__snake_case		(    self      :						Optional[Any]    ,					lowercase__      :						Any    ,					lowercase__      :						Dict=False):







        '''simple docstring'''



        if bypass_tokenizer:
               lowerCAmelCase__  			=      text.split()
        else:
               lowerCAmelCase__  			=      self.moses_tokenize(lowercase__    ,					self.lang)

        lowerCAmelCase__  			=      []
        for token in text:
               if token:
                      split_tokens.extend(list(self.bpe(lowercase__).split(' ')))

        return split_tokens




 def 	__snake_case		(    self      :						List[str]    ,					lowercase__      :						List[Any]):







        '''simple docstring'''



        return self.encoder.get(lowercase__    ,					self.encoder.get(self.unk_token))




 def 	__snake_case		(    self      :						Optional[int]    ,					lowercase__      :						Optional[Any]):







        '''simple docstring'''



        return self.decoder.get(lowercase__    ,					self.unk_token)




 def 	__snake_case		(    self      :						Any    ,					lowercase__      :						int):







        '''simple docstring'''



        lowerCAmelCase__  			=      [t.replace(' '    ,					'').replace('</w>'    ,					' ') for t in tokens]
        lowerCAmelCase__  			=      ''.join(lowercase__).split()
        # detokenize
        lowerCAmelCase__  			=      self.moses_detokenize(lowercase__    ,					self.lang)
        return text




 def 	__snake_case		(    self      :						Optional[int]    ,					lowercase__      :						List[int]    ,					lowercase__      :						Optional[List[int]] = None):







        '''simple docstring'''



        if token_ids_a is None:
               return [self.sep_token_id] + token_ids_a
        lowerCAmelCase__  			=      [self.sep_token_id]
        return sep + token_ids_a + sep + token_ids_a




 def 	__snake_case		(    self      :						Union[str, Any]    ,					lowercase__      :						List[int]    ,					lowercase__      :						Optional[List[int]] = None    ,					lowercase__      :						bool = False):







        '''simple docstring'''



        if already_has_special_tokens:
               return super().get_special_tokens_mask(
                   token_ids_a=lowercase__    ,					token_ids_a=lowercase__    ,					already_has_special_tokens=lowercase__)
        # no bos used in fairseq
        if token_ids_a is not None:
               return [1] + ([0] * len(lowercase__)) + [1] + ([0] * len(lowercase__))
        return [1] + ([0] * len(lowercase__))




 def 	__snake_case		(    self      :						Union[str, Any]    ,					lowercase__      :						List[int]    ,					lowercase__      :						Optional[List[int]] = None):







        '''simple docstring'''



        lowerCAmelCase__  			=      [self.sep_token_id]

        # no bos used in fairseq
        if token_ids_a is None:
               return len(token_ids_a + sep) * [0]
        return len(token_ids_a + sep) * [0] + len(token_ids_a + sep) * [1]




 def 	__snake_case		(    self      :						Tuple    ,					lowercase__      :						str    ,					lowercase__      :						Optional[str] = None):







        '''simple docstring'''



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

        with open(lowercase__    ,					'w'    ,					encoding='utf-8') as f:
               f.write(json.dumps(self.encoder    ,					indent=2    ,					sort_keys=lowercase__    ,					ensure_ascii=lowercase__) + '\n')

        lowerCAmelCase__  			=      0
        with open(lowercase__    ,					'w'    ,					encoding='utf-8') as writer:
               for bpe_tokens, token_index in sorted(self.bpe_ranks.items()    ,					key=lambda lowercase__: kv[1]):
                      if index != token_index:
                             logger.warning(
                                 F"""Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."""
                                 ' Please check that the tokenizer is not corrupted!')
                             lowerCAmelCase__  			=      token_index
                      writer.write(' '.join(lowercase__) + '\n')
                      index += 1

        return vocab_file, merge_file




 def __getstate__(    self      :						List[str]):







        '''simple docstring'''



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




 def __setstate__(    self      :						List[str]    ,					lowercase__      :						Optional[Any]):







        '''simple docstring'''



        lowerCAmelCase__  			=      d

        try:
               import sacremoses
        except ImportError:
               raise ImportError(
                   'You need to install sacremoses to use XLMTokenizer. '
                   'See https://pypi.org/project/sacremoses/ for installation.')

        lowerCAmelCase__  			=      sacremoses

from typing import TYPE_CHECKING

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


lowerCAmelCase__					=				{
    '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:
    lowerCAmelCase__					=				[
        '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:
    lowerCAmelCase__					=				[
        '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:
    lowerCAmelCase__					=				[
        '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

    lowerCAmelCase__					=				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
