


import unittest

from transformers import (
    MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
    TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
    TextClassificationPipeline,
    pipeline,
)
from transformers.testing_utils import is_pipeline_test, nested_simplify, require_tf, require_torch, slow

from .test_pipelines_common import ANY


# These 2 model types require different inputs than those of the usual text models.
lowerCamelCase						=		{'LayoutLMv2Config', 'LayoutLMv3Config'}





@is_pipeline_test
class  _a							(    unittest.TestCase):
	_a  :  List[str]				   =							MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
	_a  :  List[Any]				   =							TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING

	if model_mapping is not None:
		_a  :  Optional[Any]				   =							{config: model for config, model in model_mapping.items() if config.__name__ not in _TO_SKIP}
	if tf_model_mapping is not None:
		_a  :  List[Any]				   =							{
		    config: model for config, model in tf_model_mapping.items() if config.__name__ not in _TO_SKIP
		}




	@require_torch
	def 							UpperCAmelCase__( self						:		str		)->	int:
			lowerCAmelCase__       :      Union[str, Any]   					= pipeline(
			    task='''text-classification'''		, model='''hf-internal-testing/tiny-random-distilbert'''		, framework='''pt'''		)

			lowerCAmelCase__       :      Optional[int]   					= text_classifier('''This is great !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''LABEL_0''', '''score''': 0.504}]		)

			lowerCAmelCase__       :      Optional[Any]   					= text_classifier('''This is great !'''		, top_k=2		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''LABEL_0''', '''score''': 0.504}, {'''label''': '''LABEL_1''', '''score''': 0.496}]		)

			lowerCAmelCase__       :      List[Any]   					= text_classifier(['''This is great !''', '''This is bad''']		, top_k=2		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [
			        [{'''label''': '''LABEL_0''', '''score''': 0.504}, {'''label''': '''LABEL_1''', '''score''': 0.496}],
			        [{'''label''': '''LABEL_0''', '''score''': 0.504}, {'''label''': '''LABEL_1''', '''score''': 0.496}],
			    ]		, )

			lowerCAmelCase__       :      Any   					= text_classifier('''This is great !'''		, top_k=1		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''LABEL_0''', '''score''': 0.504}]		)

			# Legacy behavior
			lowerCAmelCase__       :      Any   					= text_classifier('''This is great !'''		, return_all_scores=_SCREAMING_SNAKE_CASE		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''LABEL_0''', '''score''': 0.504}]		)

			lowerCAmelCase__       :      List[str]   					= text_classifier('''This is great !'''		, return_all_scores=_SCREAMING_SNAKE_CASE		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [[{'''label''': '''LABEL_0''', '''score''': 0.504}, {'''label''': '''LABEL_1''', '''score''': 0.496}]]		)

			lowerCAmelCase__       :      List[str]   					= text_classifier(['''This is great !''', '''Something else''']		, return_all_scores=_SCREAMING_SNAKE_CASE		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [
			        [{'''label''': '''LABEL_0''', '''score''': 0.504}, {'''label''': '''LABEL_1''', '''score''': 0.496}],
			        [{'''label''': '''LABEL_0''', '''score''': 0.504}, {'''label''': '''LABEL_1''', '''score''': 0.496}],
			    ]		, )

			lowerCAmelCase__       :      int   					= text_classifier(['''This is great !''', '''Something else''']		, return_all_scores=_SCREAMING_SNAKE_CASE		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [
			        {'''label''': '''LABEL_0''', '''score''': 0.504},
			        {'''label''': '''LABEL_0''', '''score''': 0.504},
			    ]		, )




	@require_torch
	def 							UpperCAmelCase__( self						:		Optional[Any]		)->	Optional[int]:
			import torch

			lowerCAmelCase__       :      Union[str, Any]   					= pipeline(
			    task='''text-classification'''		, model='''hf-internal-testing/tiny-random-distilbert'''		, framework='''pt'''		, device=torch.device('''cpu'''		)		, )

			lowerCAmelCase__       :      Union[str, Any]   					= text_classifier('''This is great !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''LABEL_0''', '''score''': 0.504}]		)




	@require_tf
	def 							UpperCAmelCase__( self						:		Any		)->	List[Any]:
			lowerCAmelCase__       :      Tuple   					= pipeline(
			    task='''text-classification'''		, model='''hf-internal-testing/tiny-random-distilbert'''		, framework='''tf'''		)

			lowerCAmelCase__       :      List[str]   					= text_classifier('''This is great !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''LABEL_0''', '''score''': 0.504}]		)




	@slow
	@require_torch
	def 							UpperCAmelCase__( self						:		Union[str, Any]		)->	Dict:
			lowerCAmelCase__       :      List[Any]   					= pipeline('''text-classification'''		)

			lowerCAmelCase__       :      List[str]   					= text_classifier('''This is great !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''POSITIVE''', '''score''': 1.0}]		)
			lowerCAmelCase__       :      str   					= text_classifier('''This is bad !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''NEGATIVE''', '''score''': 1.0}]		)
			lowerCAmelCase__       :      Optional[int]   					= text_classifier('''Birds are a type of animal'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''POSITIVE''', '''score''': 0.988}]		)




	@slow
	@require_tf
	def 							UpperCAmelCase__( self						:		int		)->	List[str]:
			lowerCAmelCase__       :      Tuple   					= pipeline('''text-classification'''		, framework='''tf'''		)

			lowerCAmelCase__       :      str   					= text_classifier('''This is great !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''POSITIVE''', '''score''': 1.0}]		)
			lowerCAmelCase__       :      Dict   					= text_classifier('''This is bad !'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''NEGATIVE''', '''score''': 1.0}]		)
			lowerCAmelCase__       :      str   					= text_classifier('''Birds are a type of animal'''		)
			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': '''POSITIVE''', '''score''': 0.988}]		)




	def 							UpperCAmelCase__( self						:		str		, _SCREAMING_SNAKE_CASE						:		int		, _SCREAMING_SNAKE_CASE						:		Optional[Any]		, _SCREAMING_SNAKE_CASE						:		Any		)->	Union[str, Any]:
			lowerCAmelCase__       :      Union[str, Any]   					= TextClassificationPipeline(model=_SCREAMING_SNAKE_CASE		, tokenizer=_SCREAMING_SNAKE_CASE		)
			return text_classifier, ["HuggingFace is in", "This is another test"]




	def 							UpperCAmelCase__( self						:		Optional[Any]		, _SCREAMING_SNAKE_CASE						:		str		, _SCREAMING_SNAKE_CASE						:		Any		)->	List[Any]:
			lowerCAmelCase__       :      List[Any]   					= text_classifier.model
			# Small inputs because BartTokenizer tiny has maximum position embeddings = 22
			lowerCAmelCase__       :      Union[str, Any]   					= "HuggingFace is in"
			lowerCAmelCase__       :      Optional[int]   					= text_classifier(_SCREAMING_SNAKE_CASE		)

			self.assertEqual(nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}]		)
			self.assertTrue(outputs[0]['''label'''] in model.config.idalabel.values()		)

			lowerCAmelCase__       :      Tuple   					= ["HuggingFace is in ", "Paris is in France"]
			lowerCAmelCase__       :      Optional[Any]   					= text_classifier(_SCREAMING_SNAKE_CASE		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}, {'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}]		, )
			self.assertTrue(outputs[0]['''label'''] in model.config.idalabel.values()		)
			self.assertTrue(outputs[1]['''label'''] in model.config.idalabel.values()		)

			# Forcing to get all results with `top_k=None`
			# This is NOT the legacy format
			lowerCAmelCase__       :      int   					= text_classifier(_SCREAMING_SNAKE_CASE		, top_k=_SCREAMING_SNAKE_CASE		)
			lowerCAmelCase__       :      Union[str, Any]   					= len(model.config.idalabel.values()		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [[{'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}] * N, [{'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}] * N]		, )

			lowerCAmelCase__       :      Optional[int]   					= {"text": "HuggingFace is in ", "text_pair": "Paris is in France"}
			lowerCAmelCase__       :      str   					= text_classifier(_SCREAMING_SNAKE_CASE		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, {'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}		, )
			self.assertTrue(outputs['''label'''] in model.config.idalabel.values()		)

			# This might be used a text pair, but tokenizer + pipe interaction
			# makes it hard to understand that it's not using the pair properly
			# https://github.com/huggingface/transformers/issues/17305
			# We disabled this usage instead as it was outputting wrong outputs.
			lowerCAmelCase__       :      Optional[int]   					= [["HuggingFace is in ", "Paris is in France"]]
			with self.assertRaises(_SCREAMING_SNAKE_CASE		):
					text_classifier(_SCREAMING_SNAKE_CASE		)

			# This used to be valid for doing text pairs
			# We're keeping it working because of backward compatibility
			lowerCAmelCase__       :      List[Any]   					= text_classifier([[['''HuggingFace is in ''', '''Paris is in France''']]]		)
			self.assertEqual(
			    nested_simplify(_SCREAMING_SNAKE_CASE		)		, [{'''label''': ANY(_SCREAMING_SNAKE_CASE		), '''score''': ANY(_SCREAMING_SNAKE_CASE		)}]		, )
			self.assertTrue(outputs[0]['''label'''] in model.config.idalabel.values()		)








from collections import OrderedDict

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


lowerCamelCase						=		logging.get_logger(__name__)


lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

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

lowerCamelCase						=		OrderedDict(
    [
        ('''vision-encoder-decoder''', '''FlaxVisionEncoderDecoderModel'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		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'''),
    ]
)

lowerCamelCase						=		OrderedDict(
    [
        ('''bert''', '''FlaxBertForNextSentencePrediction'''),
    ]
)

lowerCamelCase						=		OrderedDict(
    [
        ('''speech-encoder-decoder''', '''FlaxSpeechEncoderDecoderModel'''),
        ('''whisper''', '''FlaxWhisperForConditionalGeneration'''),
    ]
)

lowerCamelCase						=		OrderedDict(
    [
        ('''whisper''', '''FlaxWhisperForAudioClassification'''),
    ]
)

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





class  _a							(    _BaseAutoModelClass):
	_a  :  List[str]				   =							FLAX_MODEL_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModel)





class  _a							(    _BaseAutoModelClass):
	_a  :  Union[str, Any]				   =							FLAX_MODEL_FOR_PRETRAINING_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModelForPreTraining, head_doc='''pretraining''')





class  _a							(    _BaseAutoModelClass):
	_a  :  Optional[Any]				   =							FLAX_MODEL_FOR_CAUSAL_LM_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModelForCausalLM, head_doc='''causal language modeling''')





class  _a							(    _BaseAutoModelClass):
	_a  :  Tuple				   =							FLAX_MODEL_FOR_MASKED_LM_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModelForMaskedLM, head_doc='''masked language modeling''')





class  _a							(    _BaseAutoModelClass):
	_a  :  Dict				   =							FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING
lowerCamelCase						=		auto_class_update(
    FlaxAutoModelForSeqaSeqLM, head_doc='''sequence-to-sequence language modeling''', checkpoint_for_example='''t5-base'''
)





class  _a							(    _BaseAutoModelClass):
	_a  :  Union[str, Any]				   =							FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
lowerCamelCase						=		auto_class_update(
    FlaxAutoModelForSequenceClassification, head_doc='''sequence classification'''
)





class  _a							(    _BaseAutoModelClass):
	_a  :  str				   =							FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModelForQuestionAnswering, head_doc='''question answering''')





class  _a							(    _BaseAutoModelClass):
	_a  :  Union[str, Any]				   =							FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING
lowerCamelCase						=		auto_class_update(
    FlaxAutoModelForTokenClassification, head_doc='''token classification'''
)





class  _a							(    _BaseAutoModelClass):
	_a  :  List[Any]				   =							FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModelForMultipleChoice, head_doc='''multiple choice''')





class  _a							(    _BaseAutoModelClass):
	_a  :  Any				   =							FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING
lowerCamelCase						=		auto_class_update(
    FlaxAutoModelForNextSentencePrediction, head_doc='''next sentence prediction'''
)





class  _a							(    _BaseAutoModelClass):
	_a  :  List[Any]				   =							FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
lowerCamelCase						=		auto_class_update(
    FlaxAutoModelForImageClassification, head_doc='''image classification'''
)





class  _a							(    _BaseAutoModelClass):
	_a  :  List[Any]				   =							FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING
lowerCamelCase						=		auto_class_update(FlaxAutoModelForVisionaSeq, head_doc='''vision-to-text modeling''')





class  _a							(    _BaseAutoModelClass):
	_a  :  Optional[Any]				   =							FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING
lowerCamelCase						=		auto_class_update(
    FlaxAutoModelForSpeechSeqaSeq, head_doc='''sequence-to-sequence speech-to-text modeling'''
)




