


"""simple docstring"""

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

import regex as re

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


UpperCAmelCase__  							=logging.get_logger(__name__)


UpperCAmelCase__  							={"vocab_file": "vocab.json", "merges_file": "merges.txt"}

# See all BART models at https://huggingface.co/models?filter=bart
UpperCAmelCase__  							={
    "vocab_file": {
        "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/vocab.json",
        "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/vocab.json",
        "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/vocab.json",
        "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/vocab.json",
        "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/vocab.json",
        "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/vocab.json",
    },
    "merges_file": {
        "facebook/bart-base": "https://huggingface.co/facebook/bart-base/resolve/main/merges.txt",
        "facebook/bart-large": "https://huggingface.co/facebook/bart-large/resolve/main/merges.txt",
        "facebook/bart-large-mnli": "https://huggingface.co/facebook/bart-large-mnli/resolve/main/merges.txt",
        "facebook/bart-large-cnn": "https://huggingface.co/facebook/bart-large-cnn/resolve/main/merges.txt",
        "facebook/bart-large-xsum": "https://huggingface.co/facebook/bart-large-xsum/resolve/main/merges.txt",
        "yjernite/bart_eli5": "https://huggingface.co/yjernite/bart_eli5/resolve/main/merges.txt",
    },
}

UpperCAmelCase__  							={
    "facebook/bart-base": 1024,
    "facebook/bart-large": 1024,
    "facebook/bart-large-mnli": 1024,
    "facebook/bart-large-cnn": 1024,
    "facebook/bart-large-xsum": 1024,
    "yjernite/bart_eli5": 1024,
}


@lru_cache()
def lowerCAmelCase_      (				):






 """simple docstring"""







 __lowercase									=	(
     list(range(ord("""!""" )				,   ord("""~""" ) + 1 ) ) + list(range(ord("""¡""" )				,   ord("""¬""" ) + 1 ) ) + list(range(ord("""®""" )				,   ord("""ÿ""" ) + 1 ) )
 )
 __lowercase									=	bs[:]
 __lowercase									=	0
 for b in range(2**8 ):
  if b not in bs:
   bs.append(UpperCamelCase__ )
   cs.append(2**8 + n )
   n += 1
 __lowercase									=	[chr(UpperCamelCase__ ) for n in cs]
 return dict(zip(UpperCamelCase__				,   UpperCamelCase__ ) )


def lowerCAmelCase_      (				UpperCamelCase__	: Optional[Any] ):






 """simple docstring"""







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





class    lowerCamelCase__						(		_a    ):
      a :     Optional[Any]											=		VOCAB_FILES_NAMES
      a :     Any											=		PRETRAINED_VOCAB_FILES_MAP
      a :     Tuple											=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      a :     str											=		["""input_ids""", """attention_mask"""]
      def __init__(		self	:	List[Any]      ,       A_	:	Optional[Any]      ,       A_	:	Optional[int]      ,       A_	:	List[Any]="replace"      ,       A_	:	Union[str, Any]="<s>"      ,       A_	:	Optional[int]="</s>"      ,       A_	:	Dict="</s>"      ,       A_	:	Optional[Any]="<s>"      ,       A_	:	int="<unk>"      ,       A_	:	str="<pad>"      ,       A_	:	List[str]="<mask>"      ,       A_	:	List[str]=False      ,       **A_	:	Optional[int]      ,       ):






       '''simple docstring'''


       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else bos_token
       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else eos_token
       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else sep_token
       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else cls_token
       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else unk_token
       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else pad_token

       # Mask token behave like a normal word, i.e. include the space before it
       __lowercase									=	AddedToken(A_      ,       lstrip=A_      ,       rstrip=A_							) if isinstance(A_      ,       A_							) else mask_token

       super().__init__(
           errors=A_      ,       bos_token=A_      ,       eos_token=A_      ,       unk_token=A_      ,       sep_token=A_      ,       cls_token=A_      ,       pad_token=A_      ,       mask_token=A_      ,       add_prefix_space=A_      ,       **A_      ,       )

       with open(A_      ,       encoding="""utf-8"""							) as vocab_handle:
        __lowercase									=	json.load(A_							)
       __lowercase									=	{v: k for k, v in self.encoder.items()}
       __lowercase									=	errors  # how to handle errors in decoding
       __lowercase									=	bytes_to_unicode()
       __lowercase									=	{v: k for k, v in self.byte_encoder.items()}
       with open(A_      ,       encoding="""utf-8"""							) as merges_handle:
        __lowercase									=	merges_handle.read().split("""\n"""							)[1:-1]
       __lowercase									=	[tuple(merge.split()							) for merge in bpe_merges]
       __lowercase									=	dict(zip(A_      ,       range(len(A_							)							)							)							)
       __lowercase									=	{}
       __lowercase									=	add_prefix_space

       # Should have added re.IGNORECASE so BPE merges can happen for capitalized versions of contractions
       __lowercase									=	re.compile(r"""'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+"""							)
      @property
      def SCREAMING_SNAKE_CASE_	(		self	:	Any							):






       '''simple docstring'''


       return len(self.encoder							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Tuple							):






       '''simple docstring'''


       return dict(self.encoder      ,       **self.added_tokens_encoder							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Union[str, Any]      ,       A_	:	str							):






       '''simple docstring'''


       if token in self.cache:
        return self.cache[token]
       __lowercase									=	tuple(A_							)
       __lowercase									=	get_pairs(A_							)

       if not pairs:
        return token

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

         if word[i] == first and i < len(A_							) - 1 and word[i + 1] == second:
          new_word.append(first + second							)
          i += 2
         else:
          new_word.append(word[i]							)
          i += 1
        __lowercase									=	tuple(A_							)
        __lowercase									=	new_word
        if len(A_							) == 1:
         break
        else:
         __lowercase									=	get_pairs(A_							)
       __lowercase									=	""" """.join(A_							)
       __lowercase									=	word
       return word
      def SCREAMING_SNAKE_CASE_	(		self	:	List[str]      ,       A_	:	Optional[Any]							):






       '''simple docstring'''


       __lowercase									=	[]
       for token in re.findall(self.pat      ,       A_							):
        __lowercase									=	"""""".join(
            self.byte_encoder[b] for b in token.encode("""utf-8"""							)							)  # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
        bpe_tokens.extend(bpe_token for bpe_token in self.bpe(A_							).split(""" """							)							)
       return bpe_tokens
      def SCREAMING_SNAKE_CASE_	(		self	:	Any      ,       A_	:	str							):






       '''simple docstring'''


       return self.encoder.get(A_      ,       self.encoder.get(self.unk_token							)							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Any      ,       A_	:	Dict							):






       '''simple docstring'''


       return self.decoder.get(A_							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Union[str, Any]      ,       A_	:	Union[str, Any]							):






       '''simple docstring'''


       __lowercase									=	"""""".join(A_							)
       __lowercase									=	bytearray([self.byte_decoder[c] for c in text]							).decode("""utf-8"""      ,       errors=self.errors							)
       return text
      def SCREAMING_SNAKE_CASE_	(		self	:	int      ,       A_	:	str      ,       A_	:	Optional[str] = None							):






       '''simple docstring'''


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

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

       __lowercase									=	0
       with open(A_      ,       """w"""      ,       encoding="""utf-8"""							) as writer:
        writer.write("""#version: 0.2\n"""							)
        for bpe_tokens, token_index in sorted(self.bpe_ranks.items()      ,       key=lambda A_							: 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!"""							)
          __lowercase									=	token_index
         writer.write(""" """.join(A_							) + """\n"""							)
         index += 1

       return vocab_file, merge_file
      def SCREAMING_SNAKE_CASE_	(		self	:	List[Any]      ,       A_	:	List[int]      ,       A_	:	Optional[List[int]] = None							):






       '''simple docstring'''


       if token_ids_a is None:
        return [self.cls_token_id] + token_ids_a + [self.sep_token_id]
       __lowercase									=	[self.cls_token_id]
       __lowercase									=	[self.sep_token_id]
       return cls + token_ids_a + sep + sep + token_ids_a + sep
      def SCREAMING_SNAKE_CASE_	(		self	:	Dict      ,       A_	:	List[int]      ,       A_	:	Optional[List[int]] = None      ,       A_	:	bool = False							):






       '''simple docstring'''


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

       if token_ids_a is None:
        return [1] + ([0] * len(A_							)) + [1]
       return [1] + ([0] * len(A_							)) + [1, 1] + ([0] * len(A_							)) + [1]
      def SCREAMING_SNAKE_CASE_	(		self	:	str      ,       A_	:	List[int]      ,       A_	:	Optional[List[int]] = None							):






       '''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 + sep + token_ids_a + sep							) * [0]







      def SCREAMING_SNAKE_CASE_	(		self	:	str      ,       A_	:	Dict      ,       A_	:	Tuple=False      ,       **A_	:	Optional[int]							):






       '''simple docstring'''


       __lowercase									=	kwargs.pop("""add_prefix_space"""      ,       self.add_prefix_space							)
       if (is_split_into_words or add_prefix_space) and (len(A_							) > 0 and not text[0].isspace()):
        __lowercase									=	""" """ + text
       return (text, kwargs)




"""simple docstring"""

from collections import OrderedDict

from ...utils import logging
from .auto_factory import _BaseAutoModelClass, _LazyAutoMapping, auto_class_update
from .configuration_auto import CONFIG_MAPPING_NAMES


UpperCAmelCase__  							=logging.get_logger(__name__)


UpperCAmelCase__  							=OrderedDict(
    [
        # Base model mapping
        ("albert", "FlaxAlbertModel"),
        ("bart", "FlaxBartModel"),
        ("beit", "FlaxBeitModel"),
        ("bert", "FlaxBertModel"),
        ("big_bird", "FlaxBigBirdModel"),
        ("blenderbot", "FlaxBlenderbotModel"),
        ("blenderbot-small", "FlaxBlenderbotSmallModel"),
        ("clip", "FlaxCLIPModel"),
        ("distilbert", "FlaxDistilBertModel"),
        ("electra", "FlaxElectraModel"),
        ("gpt-sw3", "FlaxGPT2Model"),
        ("gpt2", "FlaxGPT2Model"),
        ("gpt_neo", "FlaxGPTNeoModel"),
        ("gptj", "FlaxGPTJModel"),
        ("longt5", "FlaxLongT5Model"),
        ("marian", "FlaxMarianModel"),
        ("mbart", "FlaxMBartModel"),
        ("mt5", "FlaxMT5Model"),
        ("opt", "FlaxOPTModel"),
        ("pegasus", "FlaxPegasusModel"),
        ("regnet", "FlaxRegNetModel"),
        ("resnet", "FlaxResNetModel"),
        ("roberta", "FlaxRobertaModel"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormModel"),
        ("roformer", "FlaxRoFormerModel"),
        ("t5", "FlaxT5Model"),
        ("vision-text-dual-encoder", "FlaxVisionTextDualEncoderModel"),
        ("vit", "FlaxViTModel"),
        ("wav2vec2", "FlaxWav2Vec2Model"),
        ("whisper", "FlaxWhisperModel"),
        ("xglm", "FlaxXGLMModel"),
        ("xlm-roberta", "FlaxXLMRobertaModel"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for pre-training mapping
        ("albert", "FlaxAlbertForPreTraining"),
        ("bart", "FlaxBartForConditionalGeneration"),
        ("bert", "FlaxBertForPreTraining"),
        ("big_bird", "FlaxBigBirdForPreTraining"),
        ("electra", "FlaxElectraForPreTraining"),
        ("longt5", "FlaxLongT5ForConditionalGeneration"),
        ("mbart", "FlaxMBartForConditionalGeneration"),
        ("mt5", "FlaxMT5ForConditionalGeneration"),
        ("roberta", "FlaxRobertaForMaskedLM"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForMaskedLM"),
        ("roformer", "FlaxRoFormerForMaskedLM"),
        ("t5", "FlaxT5ForConditionalGeneration"),
        ("wav2vec2", "FlaxWav2Vec2ForPreTraining"),
        ("whisper", "FlaxWhisperForConditionalGeneration"),
        ("xlm-roberta", "FlaxXLMRobertaForMaskedLM"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Masked LM mapping
        ("albert", "FlaxAlbertForMaskedLM"),
        ("bart", "FlaxBartForConditionalGeneration"),
        ("bert", "FlaxBertForMaskedLM"),
        ("big_bird", "FlaxBigBirdForMaskedLM"),
        ("distilbert", "FlaxDistilBertForMaskedLM"),
        ("electra", "FlaxElectraForMaskedLM"),
        ("mbart", "FlaxMBartForConditionalGeneration"),
        ("roberta", "FlaxRobertaForMaskedLM"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForMaskedLM"),
        ("roformer", "FlaxRoFormerForMaskedLM"),
        ("xlm-roberta", "FlaxXLMRobertaForMaskedLM"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Seq2Seq Causal LM mapping
        ("bart", "FlaxBartForConditionalGeneration"),
        ("blenderbot", "FlaxBlenderbotForConditionalGeneration"),
        ("blenderbot-small", "FlaxBlenderbotSmallForConditionalGeneration"),
        ("encoder-decoder", "FlaxEncoderDecoderModel"),
        ("longt5", "FlaxLongT5ForConditionalGeneration"),
        ("marian", "FlaxMarianMTModel"),
        ("mbart", "FlaxMBartForConditionalGeneration"),
        ("mt5", "FlaxMT5ForConditionalGeneration"),
        ("pegasus", "FlaxPegasusForConditionalGeneration"),
        ("t5", "FlaxT5ForConditionalGeneration"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Image-classsification
        ("beit", "FlaxBeitForImageClassification"),
        ("regnet", "FlaxRegNetForImageClassification"),
        ("resnet", "FlaxResNetForImageClassification"),
        ("vit", "FlaxViTForImageClassification"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        ("vision-encoder-decoder", "FlaxVisionEncoderDecoderModel"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Causal LM mapping
        ("bart", "FlaxBartForCausalLM"),
        ("bert", "FlaxBertForCausalLM"),
        ("big_bird", "FlaxBigBirdForCausalLM"),
        ("electra", "FlaxElectraForCausalLM"),
        ("gpt-sw3", "FlaxGPT2LMHeadModel"),
        ("gpt2", "FlaxGPT2LMHeadModel"),
        ("gpt_neo", "FlaxGPTNeoForCausalLM"),
        ("gptj", "FlaxGPTJForCausalLM"),
        ("opt", "FlaxOPTForCausalLM"),
        ("roberta", "FlaxRobertaForCausalLM"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForCausalLM"),
        ("xglm", "FlaxXGLMForCausalLM"),
        ("xlm-roberta", "FlaxXLMRobertaForCausalLM"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Sequence Classification mapping
        ("albert", "FlaxAlbertForSequenceClassification"),
        ("bart", "FlaxBartForSequenceClassification"),
        ("bert", "FlaxBertForSequenceClassification"),
        ("big_bird", "FlaxBigBirdForSequenceClassification"),
        ("distilbert", "FlaxDistilBertForSequenceClassification"),
        ("electra", "FlaxElectraForSequenceClassification"),
        ("mbart", "FlaxMBartForSequenceClassification"),
        ("roberta", "FlaxRobertaForSequenceClassification"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForSequenceClassification"),
        ("roformer", "FlaxRoFormerForSequenceClassification"),
        ("xlm-roberta", "FlaxXLMRobertaForSequenceClassification"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Question Answering mapping
        ("albert", "FlaxAlbertForQuestionAnswering"),
        ("bart", "FlaxBartForQuestionAnswering"),
        ("bert", "FlaxBertForQuestionAnswering"),
        ("big_bird", "FlaxBigBirdForQuestionAnswering"),
        ("distilbert", "FlaxDistilBertForQuestionAnswering"),
        ("electra", "FlaxElectraForQuestionAnswering"),
        ("mbart", "FlaxMBartForQuestionAnswering"),
        ("roberta", "FlaxRobertaForQuestionAnswering"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForQuestionAnswering"),
        ("roformer", "FlaxRoFormerForQuestionAnswering"),
        ("xlm-roberta", "FlaxXLMRobertaForQuestionAnswering"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Token Classification mapping
        ("albert", "FlaxAlbertForTokenClassification"),
        ("bert", "FlaxBertForTokenClassification"),
        ("big_bird", "FlaxBigBirdForTokenClassification"),
        ("distilbert", "FlaxDistilBertForTokenClassification"),
        ("electra", "FlaxElectraForTokenClassification"),
        ("roberta", "FlaxRobertaForTokenClassification"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForTokenClassification"),
        ("roformer", "FlaxRoFormerForTokenClassification"),
        ("xlm-roberta", "FlaxXLMRobertaForTokenClassification"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        # Model for Multiple Choice mapping
        ("albert", "FlaxAlbertForMultipleChoice"),
        ("bert", "FlaxBertForMultipleChoice"),
        ("big_bird", "FlaxBigBirdForMultipleChoice"),
        ("distilbert", "FlaxDistilBertForMultipleChoice"),
        ("electra", "FlaxElectraForMultipleChoice"),
        ("roberta", "FlaxRobertaForMultipleChoice"),
        ("roberta-prelayernorm", "FlaxRobertaPreLayerNormForMultipleChoice"),
        ("roformer", "FlaxRoFormerForMultipleChoice"),
        ("xlm-roberta", "FlaxXLMRobertaForMultipleChoice"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        ("bert", "FlaxBertForNextSentencePrediction"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        ("speech-encoder-decoder", "FlaxSpeechEncoderDecoderModel"),
        ("whisper", "FlaxWhisperForConditionalGeneration"),
    ]
)

UpperCAmelCase__  							=OrderedDict(
    [
        ("whisper", "FlaxWhisperForAudioClassification"),
    ]
)

UpperCAmelCase__  							=_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_MAPPING_NAMES)
UpperCAmelCase__  							=_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_PRETRAINING_MAPPING_NAMES)
UpperCAmelCase__  							=_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_MASKED_LM_MAPPING_NAMES)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES)
UpperCAmelCase__  							=_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_CAUSAL_LM_MAPPING_NAMES)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES
)
UpperCAmelCase__  							=_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES
)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     List[Any]											=		FLAX_MODEL_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModel)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     int											=		FLAX_MODEL_FOR_PRETRAINING_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModelForPreTraining, head_doc="pretraining")





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Tuple											=		FLAX_MODEL_FOR_CAUSAL_LM_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModelForCausalLM, head_doc="causal language modeling")





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     List[str]											=		FLAX_MODEL_FOR_MASKED_LM_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModelForMaskedLM, head_doc="masked language modeling")





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     str											=		FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING






UpperCAmelCase__  							=auto_class_update(
    FlaxAutoModelForSeqaSeqLM, head_doc="sequence-to-sequence language modeling", checkpoint_for_example="t5-base"
)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     str											=		FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING






UpperCAmelCase__  							=auto_class_update(
    FlaxAutoModelForSequenceClassification, head_doc="sequence classification"
)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Tuple											=		FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModelForQuestionAnswering, head_doc="question answering")





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Union[str, Any]											=		FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING






UpperCAmelCase__  							=auto_class_update(
    FlaxAutoModelForTokenClassification, head_doc="token classification"
)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Optional[Any]											=		FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModelForMultipleChoice, head_doc="multiple choice")





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Optional[int]											=		FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING






UpperCAmelCase__  							=auto_class_update(
    FlaxAutoModelForNextSentencePrediction, head_doc="next sentence prediction"
)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Union[str, Any]											=		FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING






UpperCAmelCase__  							=auto_class_update(
    FlaxAutoModelForImageClassification, head_doc="image classification"
)





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     Dict											=		FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING






UpperCAmelCase__  							=auto_class_update(FlaxAutoModelForVisionaSeq, head_doc="vision-to-text modeling")





class    lowerCamelCase__						(		_BaseAutoModelClass    ):
      a :     List[str]											=		FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING






UpperCAmelCase__  							=auto_class_update(
    FlaxAutoModelForSpeechSeqaSeq, head_doc="sequence-to-sequence speech-to-text modeling"
)
