


"""simple docstring"""
import argparse
import os
import re


UpperCAmelCase				=						"""src/transformers"""

# Pattern that looks at the indentation in a line.
UpperCAmelCase				=						re.compile(r"""^(\s*)\S""")
# Pattern that matches `"key":" and puts `key` in group 0.
UpperCAmelCase				=						re.compile(r"""^\s*\"([^\"]+)\":""")
# Pattern that matches `_import_structure["key"]` and puts `key` in group 0.
UpperCAmelCase				=						re.compile(r"""^\s*_import_structure\[\"([^\"]+)\"\]""")
# Pattern that matches `"key",` and puts `key` in group 0.
UpperCAmelCase				=						re.compile(r"""^\s*\"([^\"]+)\",\s*$""")
# Pattern that matches any `[stuff]` and puts `stuff` in group 0.
UpperCAmelCase				=						re.compile(r"""\[([^\]]+)\]""")

def 				_snake_case      (   __snake_case							:      Any   ):




   """simple docstring"""







   _lowerCamelCase	:					Tuple   =		_re_indent.search(__snake_case   )
   return "" if search is None else search.groups()[0]

def 				_snake_case      (   __snake_case							:      List[Any]						, __snake_case							:      Any=""						, __snake_case							:      Tuple=None						, __snake_case							:      List[str]=None   ):




   """simple docstring"""







   _lowerCamelCase	:					List[str]   =		0
   _lowerCamelCase	:					Tuple   =		code.split("""\n"""   )
   if start_prompt is not None:
      while not lines[index].startswith(__snake_case   ):
         index += 1
      _lowerCamelCase	:					Union[str, Any]   =		["""\n""".join(lines[:index]   )]
   else:
      _lowerCamelCase	:					Any   =		[]

   # We split into blocks until we get to the `end_prompt` (or the end of the block).
   _lowerCamelCase	:					Optional[int]   =		[lines[index]]
   index += 1
   while index < len(__snake_case   ) and (end_prompt is None or not lines[index].startswith(__snake_case   )):
      if len(lines[index]   ) > 0 and get_indent(lines[index]   ) == indent_level:
         if len(__snake_case   ) > 0 and get_indent(current_block[-1]   ).startswith(indent_level + """ """   ):
            current_block.append(lines[index]   )
            blocks.append("""\n""".join(__snake_case   )   )
            if index < len(__snake_case   ) - 1:
               _lowerCamelCase	:					Optional[int]   =		[lines[index + 1]]
               index += 1
            else:
               _lowerCamelCase	:					int   =		[]
         else:
            blocks.append("""\n""".join(__snake_case   )   )
            _lowerCamelCase	:					Dict   =		[lines[index]]
      else:
         current_block.append(lines[index]   )
      index += 1

   # Adds current block if it's nonempty.
   if len(__snake_case   ) > 0:
      blocks.append("""\n""".join(__snake_case   )   )

   # Add final block after end_prompt if provided.
   if end_prompt is not None and index < len(__snake_case   ):
      blocks.append("""\n""".join(lines[index:]   )   )

   return blocks

def 				_snake_case      (   __snake_case							:      Tuple   ):




   """simple docstring"""







   def _inner(__snake_case							:      List[str]   ):
      return key(__snake_case   ).lower().replace("""_"""						, """"""   )

   return _inner

def 				_snake_case      (   __snake_case							:      Optional[int]						, __snake_case							:      Optional[int]=None   ):




   """simple docstring"""







   def noop(__snake_case							:      List[str]   ):
      return x

   if key is None:
      _lowerCamelCase	:					Dict   =		noop
   # Constants are all uppercase, they go first.
   _lowerCamelCase	:					List[Any]   =		[obj for obj in objects if key(__snake_case   ).isupper()]
   # Classes are not all uppercase but start with a capital, they go second.
   _lowerCamelCase	:					Any   =		[obj for obj in objects if key(__snake_case   )[0].isupper() and not key(__snake_case   ).isupper()]
   # Functions begin with a lowercase, they go last.
   _lowerCamelCase	:					Union[str, Any]   =		[obj for obj in objects if not key(__snake_case   )[0].isupper()]

   _lowerCamelCase	:					List[Any]   =		ignore_underscore(__snake_case   )
   return sorted(__snake_case						, key=__snake_case   ) + sorted(__snake_case						, key=__snake_case   ) + sorted(__snake_case						, key=__snake_case   )

def 				_snake_case      (   __snake_case							:      Dict   ):




   """simple docstring"""







   def _replace(__snake_case							:      Union[str, Any]   ):
      _lowerCamelCase	:					Any   =		match.groups()[0]
      if "," not in imports:
         return F'[{imports}]'
      _lowerCamelCase	:					Optional[Any]   =		[part.strip().replace("""\""""						, """"""   ) for part in imports.split(""","""   )]
      # We will have a final empty element if the line finished with a comma.
      if len(keys[-1]   ) == 0:
         _lowerCamelCase	:					Dict   =		keys[:-1]
      return "[" + ", ".join([F'"{k}"' for k in sort_objects(__snake_case   )]   ) + "]"

   _lowerCamelCase	:					Tuple   =		import_statement.split("""\n"""   )
   if len(__snake_case   ) > 3:
      # Here we have to sort internal imports that are on several lines (one per name):
      # key: [
      #     "object1",
      #     "object2",
      #     ...
      # ]

      # We may have to ignore one or two lines on each side.
      _lowerCamelCase	:					Union[str, Any]   =		2 if lines[1].strip() == """[""" else 1
      _lowerCamelCase	:					Optional[Any]   =		[(i, _re_strip_line.search(__snake_case   ).groups()[0]) for i, line in enumerate(lines[idx:-idx]   )]
      _lowerCamelCase	:					Optional[Any]   =		sort_objects(__snake_case						, key=lambda __snake_case   : x[1]   )
      _lowerCamelCase	:					str   =		[lines[x[0] + idx] for x in sorted_indices]
      return "\n".join(lines[:idx] + sorted_lines + lines[-idx:]   )
   elif len(__snake_case   ) == 3:
      # Here we have to sort internal imports that are on one separate line:
      # key: [
      #     "object1", "object2", ...
      # ]
      if _re_bracket_content.search(lines[1]   ) is not None:
         _lowerCamelCase	:					str   =		_re_bracket_content.sub(_replace						, lines[1]   )
      else:
         _lowerCamelCase	:					Optional[Any]   =		[part.strip().replace("""\""""						, """"""   ) for part in lines[1].split(""","""   )]
         # We will have a final empty element if the line finished with a comma.
         if len(keys[-1]   ) == 0:
            _lowerCamelCase	:					str   =		keys[:-1]
         _lowerCamelCase	:					Optional[int]   =		get_indent(lines[1]   ) + """, """.join([F'"{k}"' for k in sort_objects(__snake_case   )]   )
      return "\n".join(__snake_case   )
   else:
      # Finally we have to deal with imports fitting on one line
      _lowerCamelCase	:					Optional[Any]   =		_re_bracket_content.sub(_replace						, __snake_case   )
      return import_statement

def 				_snake_case      (   __snake_case							:      List[str]						, __snake_case							:      Dict=True   ):




   """simple docstring"""







   with open(__snake_case						, encoding="""utf-8"""   ) as f:
      _lowerCamelCase	:					Any   =		f.read()

   if "_import_structure" not in code:
      return

   # Blocks of indent level 0
   _lowerCamelCase	:					Optional[int]   =		split_code_in_indented_blocks(
       __snake_case						, start_prompt="""_import_structure = {"""						, end_prompt="""if TYPE_CHECKING:"""   )

   # We ignore block 0 (everything untils start_prompt) and the last block (everything after end_prompt).
   for block_idx in range(1						, len(__snake_case   ) - 1   ):
      # Check if the block contains some `_import_structure`s thingy to sort.
      _lowerCamelCase	:					Union[str, Any]   =		main_blocks[block_idx]
      _lowerCamelCase	:					List[Any]   =		block.split("""\n"""   )

      # Get to the start of the imports.
      _lowerCamelCase	:					List[str]   =		0
      while line_idx < len(__snake_case   ) and "_import_structure" not in block_lines[line_idx]:
         # Skip dummy import blocks
         if "import dummy" in block_lines[line_idx]:
            _lowerCamelCase	:					Tuple   =		len(__snake_case   )
         else:
            line_idx += 1
      if line_idx >= len(__snake_case   ):
         continue

      # Ignore beginning and last line: they don't contain anything.
      _lowerCamelCase	:					List[str]   =		"""\n""".join(block_lines[line_idx:-1]   )
      _lowerCamelCase	:					Union[str, Any]   =		get_indent(block_lines[1]   )
      # Slit the internal block into blocks of indent level 1.
      _lowerCamelCase	:					Optional[int]   =		split_code_in_indented_blocks(__snake_case						, indent_level=__snake_case   )
      # We have two categories of import key: list or _import_structure[key].append/extend
      _lowerCamelCase	:					List[str]   =		_re_direct_key if """_import_structure = {""" in block_lines[0] else _re_indirect_key
      # Grab the keys, but there is a trap: some lines are empty or just comments.
      _lowerCamelCase	:					List[Any]   =		[(pattern.search(__snake_case   ).groups()[0] if pattern.search(__snake_case   ) is not None else None) for b in internal_blocks]
      # We only sort the lines with a key.
      _lowerCamelCase	:					Union[str, Any]   =		[(i, key) for i, key in enumerate(__snake_case   ) if key is not None]
      _lowerCamelCase	:					Optional[Any]   =		[x[0] for x in sorted(__snake_case						, key=lambda __snake_case   : x[1]   )]

      # We reorder the blocks by leaving empty lines/comments as they were and reorder the rest.
      _lowerCamelCase	:					Tuple   =		0
      _lowerCamelCase	:					Dict   =		[]
      for i in range(len(__snake_case   )   ):
         if keys[i] is None:
            reorderded_blocks.append(internal_blocks[i]   )
         else:
            _lowerCamelCase	:					Any   =		sort_objects_in_import(internal_blocks[sorted_indices[count]]   )
            reorderded_blocks.append(__snake_case   )
            count += 1

        # And we put our main block back together with its first and last line.
      _lowerCamelCase	:					Tuple   =		"""\n""".join(block_lines[:line_idx] + reorderded_blocks + [block_lines[-1]]   )

   if code != "\n".join(__snake_case   ):
      if check_only:
         return True
      else:
         print(F'Overwriting {file}.'   )
         with open(__snake_case						, """w"""						, encoding="""utf-8"""   ) as f:
            f.write("""\n""".join(__snake_case   )   )

def 				_snake_case      (   __snake_case							:      int=True   ):




   """simple docstring"""







   _lowerCamelCase	:					Dict   =		[]
   for root, _, files in os.walk(__snake_case   ):
      if "__init__.py" in files:
         _lowerCamelCase	:					int   =		sort_imports(os.path.join(__snake_case						, """__init__.py"""   )						, check_only=__snake_case   )
         if result:
            _lowerCamelCase	:					str   =		[os.path.join(__snake_case						, """__init__.py"""   )]
   if len(__snake_case   ) > 0:
      raise ValueError(F'Would overwrite {len(__snake_case   )} files, run `make style`.'   )


if __name__ == "__main__":
 UpperCAmelCase				=						argparse.ArgumentParser()
 parser.add_argument("""--check_only""", action="""store_true""", help="""Whether to only check or fix style.""")
 UpperCAmelCase				=						parser.parse_args()

 sort_imports_in_all_inits(check_only=args.check_only)





"""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 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_MAPPING







UpperCAmelCase				=						auto_class_update(FlaxAutoModel)




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_PRETRAINING_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_CAUSAL_LM_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_MASKED_LM_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					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 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING







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




class 	lowercase__				(					_BaseAutoModelClass				):
   __UpperCAmelCase							       =					FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING







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

