


"""simple docstring"""

import inspect
import unittest

from transformers import ConvNextConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_backbone_common import BackboneTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
       import torch

       from transformers import ConvNextBackbone, ConvNextForImageClassification, ConvNextModel
       from transformers.models.convnext.modeling_convnext import CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
       from PIL import Image

       from transformers import AutoImageProcessor





class    lowerCamelCase__						:
      def __init__(		self	:	List[Any]      ,       A_	:	Optional[Any]      ,       A_	:	str=1_3      ,       A_	:	Optional[Any]=3_2      ,       A_	:	Tuple=3      ,       A_	:	Optional[int]=4      ,       A_	:	List[Any]=[1_0, 2_0, 3_0, 4_0]      ,       A_	:	List[str]=[2, 2, 3, 2]      ,       A_	:	str=True      ,       A_	:	Optional[Any]=True      ,       A_	:	str=3_7      ,       A_	:	Any="gelu"      ,       A_	:	Tuple=1_0      ,       A_	:	Optional[int]=0.02      ,       A_	:	int=["stage2", "stage3", "stage4"]      ,       A_	:	Optional[Any]=[2, 3, 4]      ,       A_	:	Any=None      ,       ):






       '''simple docstring'''


       __lowercase									=	parent
       __lowercase									=	batch_size
       __lowercase									=	image_size
       __lowercase									=	num_channels
       __lowercase									=	num_stages
       __lowercase									=	hidden_sizes
       __lowercase									=	depths
       __lowercase									=	is_training
       __lowercase									=	use_labels
       __lowercase									=	intermediate_size
       __lowercase									=	hidden_act
       __lowercase									=	num_labels
       __lowercase									=	initializer_range
       __lowercase									=	out_features
       __lowercase									=	out_indices
       __lowercase									=	scope
      def SCREAMING_SNAKE_CASE_	(		self	:	Union[str, Any]							):






       '''simple docstring'''


       __lowercase									=	floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]							)

       __lowercase									=	None
       if self.use_labels:
        __lowercase									=	ids_tensor([self.batch_size]      ,       self.num_labels							)

       __lowercase									=	self.get_config()
       return config, pixel_values, labels
      def SCREAMING_SNAKE_CASE_	(		self	:	Any							):






       '''simple docstring'''


       return ConvNextConfig(
           num_channels=self.num_channels      ,       hidden_sizes=self.hidden_sizes      ,       depths=self.depths      ,       num_stages=self.num_stages      ,       hidden_act=self.hidden_act      ,       is_decoder=A_      ,       initializer_range=self.initializer_range      ,       out_features=self.out_features      ,       out_indices=self.out_indices      ,       num_labels=self.num_labels      ,       )
      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[Any]      ,       A_	:	List[Any]      ,       A_	:	int      ,       A_	:	int							):






       '''simple docstring'''


       __lowercase									=	ConvNextModel(config=A_							)
       model.to(A_							)
       model.eval()
       __lowercase									=	model(A_							)
       # expected last hidden states: B, C, H // 32, W // 32
       self.parent.assertEqual(
           result.last_hidden_state.shape      ,       (self.batch_size, self.hidden_sizes[-1], self.image_size // 3_2, self.image_size // 3_2)      ,       )
      def SCREAMING_SNAKE_CASE_	(		self	:	List[str]      ,       A_	:	List[Any]      ,       A_	:	Tuple      ,       A_	:	List[str]							):






       '''simple docstring'''


       __lowercase									=	ConvNextForImageClassification(A_							)
       model.to(A_							)
       model.eval()
       __lowercase									=	model(A_      ,       labels=A_							)
       self.parent.assertEqual(result.logits.shape      ,       (self.batch_size, self.num_labels)							)
      def SCREAMING_SNAKE_CASE_	(		self	:	List[str]      ,       A_	:	Optional[int]      ,       A_	:	List[str]      ,       A_	:	Union[str, Any]							):






       '''simple docstring'''


       __lowercase									=	ConvNextBackbone(config=A_							)
       model.to(A_							)
       model.eval()
       __lowercase									=	model(A_							)

       # verify hidden states
       self.parent.assertEqual(len(result.feature_maps							)      ,       len(config.out_features							)							)
       self.parent.assertListEqual(list(result.feature_maps[0].shape							)      ,       [self.batch_size, self.hidden_sizes[1], 4, 4]							)

       # verify channels
       self.parent.assertEqual(len(model.channels							)      ,       len(config.out_features							)							)
       self.parent.assertListEqual(model.channels      ,       config.hidden_sizes[1:]							)

       # verify backbone works with out_features=None
       __lowercase									=	None
       __lowercase									=	ConvNextBackbone(config=A_							)
       model.to(A_							)
       model.eval()
       __lowercase									=	model(A_							)

       # verify feature maps
       self.parent.assertEqual(len(result.feature_maps							)      ,       1							)
       self.parent.assertListEqual(list(result.feature_maps[0].shape							)      ,       [self.batch_size, self.hidden_sizes[-1], 1, 1]							)

       # verify channels
       self.parent.assertEqual(len(model.channels							)      ,       1							)
       self.parent.assertListEqual(model.channels      ,       [config.hidden_sizes[-1]]							)







      def SCREAMING_SNAKE_CASE_	(		self	:	List[Any]							):






       '''simple docstring'''


       __lowercase									=	self.prepare_config_and_inputs()
       __lowercase							,		__lowercase							,		__lowercase									=	config_and_inputs
       __lowercase									=	{"""pixel_values""": pixel_values}
       return config, inputs_dict






@require_torch
class    lowerCamelCase__						(		_a			,   _a			,   unittest.TestCase    ):
      a :     Optional[Any]											=		(
          (
              ConvNextModel,
              ConvNextForImageClassification,
              ConvNextBackbone,
          )
          if is_torch_available()
          else ()
      )
      a :     str											=		(
          {"""feature-extraction""": ConvNextModel, """image-classification""": ConvNextForImageClassification}
          if is_torch_available()
          else {}
      )

      a :     str											=		True
      a :     List[str]											=		False
      a :     str											=		False
      a :     Optional[int]											=		False
      a :     str											=		False
      def SCREAMING_SNAKE_CASE_	(		self	:	int							):






       '''simple docstring'''


       __lowercase									=	ConvNextModelTester(self							)
       __lowercase									=	ConfigTester(self      ,       config_class=A_      ,       has_text_modality=A_      ,       hidden_size=3_7							)
      def SCREAMING_SNAKE_CASE_	(		self	:	int							):






       '''simple docstring'''


       self.create_and_test_config_common_properties()
       self.config_tester.create_and_test_config_to_json_string()
       self.config_tester.create_and_test_config_to_json_file()
       self.config_tester.create_and_test_config_from_and_save_pretrained()
       self.config_tester.create_and_test_config_with_num_labels()
       self.config_tester.check_config_can_be_init_without_params()
       self.config_tester.check_config_arguments_init()
      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[int]							):






       '''simple docstring'''


       return
      @unittest.skip(reason="""ConvNext does not use inputs_embeds"""							)
      def SCREAMING_SNAKE_CASE_	(		self	:	List[Any]							):






       '''simple docstring'''


       pass
      @unittest.skip(reason="""ConvNext does not support input and output embeddings"""							)
      def SCREAMING_SNAKE_CASE_	(		self	:	List[str]							):






       '''simple docstring'''


       pass
      @unittest.skip(reason="""ConvNext does not use feedforward chunking"""							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[Any]							):






       '''simple docstring'''


       pass
      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[Any]							):






       '''simple docstring'''


       __lowercase							,		__lowercase									=	self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
        __lowercase									=	model_class(A_							)
        __lowercase									=	inspect.signature(model.forward							)
        # signature.parameters is an OrderedDict => so arg_names order is deterministic
        __lowercase									=	[*signature.parameters.keys()]

        __lowercase									=	["""pixel_values"""]
        self.assertListEqual(arg_names[:1]      ,       A_							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Optional[Any]							):






       '''simple docstring'''


       __lowercase									=	self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_model(*A_							)
      def SCREAMING_SNAKE_CASE_	(		self	:	str							):






       '''simple docstring'''


       __lowercase									=	self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_backbone(*A_							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Dict							):






       '''simple docstring'''


       def check_hidden_states_output(A_	:	Union[str, Any]      ,       A_	:	Optional[int]      ,       A_	:	int							):
        __lowercase									=	model_class(A_							)
        model.to(A_							)
        model.eval()

        with torch.no_grad():
         __lowercase									=	model(**self._prepare_for_class(A_      ,       A_							)							)

        __lowercase									=	outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

        __lowercase									=	self.model_tester.num_stages
        self.assertEqual(len(A_							)      ,       expected_num_stages + 1							)

        # ConvNext's feature maps are of shape (batch_size, num_channels, height, width)
        self.assertListEqual(
            list(hidden_states[0].shape[-2:]							)      ,       [self.model_tester.image_size // 4, self.model_tester.image_size // 4]      ,       )

       __lowercase							,		__lowercase									=	self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
        __lowercase									=	True
        check_hidden_states_output(A_      ,       A_      ,       A_							)

        # check that output_hidden_states also work using config
        del inputs_dict["output_hidden_states"]
        __lowercase									=	True

        check_hidden_states_output(A_      ,       A_      ,       A_							)
      def SCREAMING_SNAKE_CASE_	(		self	:	Union[str, Any]							):






       '''simple docstring'''


       __lowercase									=	self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_for_image_classification(*A_							)







      @slow
      def SCREAMING_SNAKE_CASE_	(		self	:	Union[str, Any]							):






       '''simple docstring'''


       for model_name in CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
        __lowercase									=	ConvNextModel.from_pretrained(A_							)
        self.assertIsNotNone(A_							)






def lowerCAmelCase_      (				):






 """simple docstring"""







 __lowercase									=	Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png""" )
 return image





@require_torch
@require_vision
class    lowerCamelCase__						(		unittest.TestCase    ):
      @cached_property
      def SCREAMING_SNAKE_CASE_	(		self	:	Tuple							):






       '''simple docstring'''


       return AutoImageProcessor.from_pretrained("""facebook/convnext-tiny-224"""							) if is_vision_available() else None







      @slow
      def SCREAMING_SNAKE_CASE_	(		self	:	Dict							):






       '''simple docstring'''


       __lowercase									=	ConvNextForImageClassification.from_pretrained("""facebook/convnext-tiny-224"""							).to(A_							)

       __lowercase									=	self.default_image_processor
       __lowercase									=	prepare_img()
       __lowercase									=	image_processor(images=A_      ,       return_tensors="""pt"""							).to(A_							)

       # forward pass
       with torch.no_grad():
        __lowercase									=	model(**A_							)

       # verify the logits
       __lowercase									=	torch.Size((1, 1_0_0_0)							)
       self.assertEqual(outputs.logits.shape      ,       A_							)

       __lowercase									=	torch.tensor([-0.02_60, -0.47_39, 0.19_11]							).to(A_							)

       self.assertTrue(torch.allclose(outputs.logits[0, :3]      ,       A_      ,       atol=1e-4							)							)






@require_torch
class    lowerCamelCase__						(		unittest.TestCase			,   _a    ):
      a :     List[Any]											=		(ConvNextBackbone,) if is_torch_available() else ()
      a :     Dict											=		ConvNextConfig

      a :     List[str]											=		False
      def SCREAMING_SNAKE_CASE_	(		self	:	List[Any]							):






       '''simple docstring'''


       __lowercase									=	ConvNextModelTester(self							)




"""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"
)
