




"""simple docstring"""







import inspect
import unittest

from transformers import DecisionTransformerConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
  import torch

  from transformers import DecisionTransformerModel
  from transformers.models.decision_transformer.modeling_decision_transformer import (
      DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
  )

class 				snake_case_			:







   """simple docstring"""




   def __init__(		self       ,					lowerCamelCase_       ,					lowerCamelCase_=1_3       ,					lowerCamelCase_=7       ,					lowerCamelCase_=6       ,					lowerCamelCase_=1_7       ,					lowerCamelCase_=2_3       ,					lowerCamelCase_=1_1       ,					lowerCamelCase_=True       ,					)				->   Dict:
       UpperCamelCase              =	parent
       UpperCamelCase              =	batch_size
       UpperCamelCase              =	seq_length
       UpperCamelCase              =	act_dim
       UpperCamelCase              =	state_dim
       UpperCamelCase              =	hidden_size
       UpperCamelCase              =	max_length
       UpperCamelCase              =	is_training







   def   UpperCAmelCase__			(		self)				->   str:
       UpperCamelCase              =	floats_tensor((self.batch_size, self.seq_length, self.state_dim))
       UpperCamelCase              =	floats_tensor((self.batch_size, self.seq_length, self.act_dim))
       UpperCamelCase              =	floats_tensor((self.batch_size, self.seq_length, 1))
       UpperCamelCase              =	floats_tensor((self.batch_size, self.seq_length, 1))
       UpperCamelCase              =	ids_tensor((self.batch_size, self.seq_length)       ,					vocab_size=1_0_0_0)
       UpperCamelCase              =	random_attention_mask((self.batch_size, self.seq_length))

       UpperCamelCase              =	self.get_config()

       return (
           config,
           states,
           actions,
           rewards,
           returns_to_go,
           timesteps,
           attention_mask,
       )







   def   UpperCAmelCase__			(		self)				->   str:
       return DecisionTransformerConfig(
           batch_size=self.batch_size       ,					seq_length=self.seq_length       ,					act_dim=self.act_dim       ,					state_dim=self.state_dim       ,					hidden_size=self.hidden_size       ,					max_length=self.max_length       ,					)







   def   UpperCAmelCase__			(		self       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					)				->   Tuple:
       UpperCamelCase              =	DecisionTransformerModel(config=lowerCamelCase_)
       model.to(lowerCamelCase_)
       model.eval()
       UpperCamelCase              =	model(lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_       ,					lowerCamelCase_)

       self.parent.assertEqual(result.state_preds.shape       ,					states.shape)
       self.parent.assertEqual(result.action_preds.shape       ,					actions.shape)
       self.parent.assertEqual(result.return_preds.shape       ,					returns_to_go.shape)
       self.parent.assertEqual(
           result.last_hidden_state.shape       ,					(self.batch_size, self.seq_length * 3, self.hidden_size))  # seq length *3 as there are 3 modelities: states, returns and actions







   def   UpperCAmelCase__			(		self)				->   int:
       UpperCamelCase              =	self.prepare_config_and_inputs()
       (
           (
           UpperCamelCase
       )       ,	(
           UpperCamelCase
       )       ,	(
           UpperCamelCase
       )       ,	(
           UpperCamelCase
       )       ,	(
           UpperCamelCase
       )       ,	(
           UpperCamelCase
       )       ,	(
           UpperCamelCase
       )       ,	
       )              =	config_and_inputs
       UpperCamelCase              =	{
           '''states''': states,
           '''actions''': actions,
           '''rewards''': rewards,
           '''returns_to_go''': returns_to_go,
           '''timesteps''': timesteps,
           '''attention_mask''': attention_mask,
       }
       return config, inputs_dict

@require_torch
class 				snake_case_			(					lowerCamelCase_	, lowerCamelCase_	, lowerCamelCase_	, unittest.TestCase			):







   """simple docstring"""




   A_				      =       (DecisionTransformerModel,) if is_torch_available() else ()
   A_				      =       ()
   A_				      =       {'''feature-extraction''': DecisionTransformerModel} if is_torch_available() else {}

   # Ignoring of a failing test from GenerationTesterMixin, as the model does not use inputs_ids
   A_				      =       False

   # Ignoring of a failing tests from ModelTesterMixin, as the model does not implement these features
   A_				      =       False
   A_				      =       False
   A_				      =       False
   A_				      =       False
   A_				      =       False
   A_				      =       False
   A_				      =       False
   A_				      =       False
   A_				      =       False







   def   UpperCAmelCase__			(		self)				->   Any:
       UpperCamelCase              =	DecisionTransformerModelTester(self)
       UpperCamelCase              =	ConfigTester(self       ,					config_class=lowerCamelCase_       ,					hidden_size=3_7)







   def   UpperCAmelCase__			(		self)				->   str:
       self.config_tester.run_common_tests()







   def   UpperCAmelCase__			(		self)				->   Union[str, Any]:
       UpperCamelCase              =	self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_model(*lowerCamelCase_)







   @slow
   def   UpperCAmelCase__			(		self)				->   Optional[int]:
       for model_name in DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           UpperCamelCase              =	DecisionTransformerModel.from_pretrained(lowerCamelCase_)
           self.assertIsNotNone(lowerCamelCase_)







   def   UpperCAmelCase__			(		self)				->   str:
       UpperCamelCase       ,	UpperCamelCase              =	self.model_tester.prepare_config_and_inputs_for_common()

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

           UpperCamelCase              =	[
               '''states''',
               '''actions''',
               '''rewards''',
               '''returns_to_go''',
               '''timesteps''',
               '''attention_mask''',
           ]

           self.assertListEqual(arg_names[: len(lowerCamelCase_)]       ,					lowerCamelCase_)

@require_torch
class 				snake_case_			(					unittest.TestCase			):







   """simple docstring"""




   @slow
   def   UpperCAmelCase__			(		self)				->   int:
       UpperCamelCase              =	2  # number of steps of autoregressive prediction we will perform
       UpperCamelCase              =	1_0  # defined by the RL environment, may be normalized
       UpperCamelCase              =	DecisionTransformerModel.from_pretrained('''edbeeching/decision-transformer-gym-hopper-expert''')
       UpperCamelCase              =	model.to(lowerCamelCase_)
       UpperCamelCase              =	model.config
       torch.manual_seed(0)
       UpperCamelCase              =	torch.randn(1       ,					1       ,					config.state_dim).to(device=lowerCamelCase_       ,					dtype=torch.floataa)  # env.reset()

       UpperCamelCase              =	torch.tensor(
           [[0.24_2793, -0.2869_3074, 0.874_2613], [0.6781_5274, -0.0810_1085, -0.1295_2147]]       ,					device=lowerCamelCase_)

       UpperCamelCase              =	torch.tensor(lowerCamelCase_       ,					device=lowerCamelCase_       ,					dtype=torch.floataa).reshape(1       ,					1       ,					1)
       UpperCamelCase              =	state
       UpperCamelCase              =	torch.zeros(1       ,					0       ,					config.act_dim       ,					device=lowerCamelCase_       ,					dtype=torch.floataa)
       UpperCamelCase              =	torch.zeros(1       ,					0       ,					device=lowerCamelCase_       ,					dtype=torch.floataa)
       UpperCamelCase              =	torch.tensor(0       ,					device=lowerCamelCase_       ,					dtype=torch.long).reshape(1       ,					1)

       for step in range(lowerCamelCase_):
           UpperCamelCase              =	torch.cat([actions, torch.zeros(1       ,					1       ,					config.act_dim       ,					device=lowerCamelCase_)]       ,					dim=1)
           UpperCamelCase              =	torch.cat([rewards, torch.zeros(1       ,					1       ,					device=lowerCamelCase_)]       ,					dim=1)

           UpperCamelCase              =	torch.ones(1       ,					states.shape[1]).to(dtype=torch.long       ,					device=states.device)

           with torch.no_grad():
               UpperCamelCase       ,	UpperCamelCase       ,	UpperCamelCase              =	model(
                   states=lowerCamelCase_       ,					actions=lowerCamelCase_       ,					rewards=lowerCamelCase_       ,					returns_to_go=lowerCamelCase_       ,					timesteps=lowerCamelCase_       ,					attention_mask=lowerCamelCase_       ,					return_dict=lowerCamelCase_       ,					)

           self.assertEqual(action_pred.shape       ,					actions.shape)
           self.assertTrue(torch.allclose(action_pred[0, -1]       ,					expected_outputs[step]       ,					atol=1e-4))
           UpperCamelCase       ,	UpperCamelCase       ,	UpperCamelCase       ,	UpperCamelCase              =	(  # env.step(action)
               torch.randn(1       ,					1       ,					config.state_dim).to(device=lowerCamelCase_       ,					dtype=torch.floataa),
               1.0,
               False,
               {},
           )

           UpperCamelCase              =	action_pred[0, -1]
           UpperCamelCase              =	torch.cat([states, state]       ,					dim=1)
           UpperCamelCase              =	returns_to_go[0, -1] - reward
           UpperCamelCase              =	torch.cat([returns_to_go, pred_return.reshape(1       ,					1       ,					1)]       ,					dim=1)
           UpperCamelCase              =	torch.cat(
               [timesteps, torch.ones((1, 1)       ,					device=lowerCamelCase_       ,					dtype=torch.long) * (step + 1)]       ,					dim=1)


from collections import OrderedDict

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


__A			:					int						=			logging.get_logger(__name__)


__A			:					List[str]						=			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'),
    ]
)

__A			:					Optional[Any]						=			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'),
    ]
)

__A			:					Tuple						=			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'),
    ]
)

__A			:					Dict						=			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'),
    ]
)

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

__A			:					Optional[int]						=			OrderedDict(
    [
        ('vision-encoder-decoder', 'FlaxVisionEncoderDecoderModel'),
    ]
)

__A			:					Union[str, Any]						=			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'),
    ]
)

__A			:					Optional[int]						=			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'),
    ]
)

__A			:					str						=			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'),
    ]
)

__A			:					Dict						=			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'),
    ]
)

__A			:					Dict						=			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'),
    ]
)

__A			:					Any						=			OrderedDict(
    [
        ('bert', 'FlaxBertForNextSentencePrediction'),
    ]
)

__A			:					Optional[int]						=			OrderedDict(
    [
        ('speech-encoder-decoder', 'FlaxSpeechEncoderDecoderModel'),
        ('whisper', 'FlaxWhisperForConditionalGeneration'),
    ]
)

__A			:					List[str]						=			OrderedDict(
    [
        ('whisper', 'FlaxWhisperForAudioClassification'),
    ]
)

__A			:					Optional[int]						=			_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_MAPPING_NAMES)
__A			:					str						=			_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_PRETRAINING_MAPPING_NAMES)
__A			:					List[Any]						=			_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_MASKED_LM_MAPPING_NAMES)
__A			:					Tuple						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES
)
__A			:					Any						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES
)
__A			:					str						=			_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES)
__A			:					Tuple						=			_LazyAutoMapping(CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_CAUSAL_LM_MAPPING_NAMES)
__A			:					Optional[int]						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES
)
__A			:					List[str]						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES
)
__A			:					Union[str, Any]						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES
)
__A			:					List[Any]						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING_NAMES
)
__A			:					Optional[int]						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING_NAMES
)
__A			:					List[Any]						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES
)
__A			:					Tuple						=			_LazyAutoMapping(
    CONFIG_MAPPING_NAMES, FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES
)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_MAPPING




__A			:					Optional[int]						=			auto_class_update(FlaxAutoModel)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_PRETRAINING_MAPPING




__A			:					Optional[Any]						=			auto_class_update(FlaxAutoModelForPreTraining, head_doc='pretraining')





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_CAUSAL_LM_MAPPING




__A			:					Tuple						=			auto_class_update(FlaxAutoModelForCausalLM, head_doc='causal language modeling')





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_MASKED_LM_MAPPING




__A			:					List[Any]						=			auto_class_update(FlaxAutoModelForMaskedLM, head_doc='masked language modeling')





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING




__A			:					int						=			auto_class_update(
    FlaxAutoModelForSeqaSeqLM, head_doc='sequence-to-sequence language modeling', checkpoint_for_example='t5-base'
)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING




__A			:					Optional[int]						=			auto_class_update(
    FlaxAutoModelForSequenceClassification, head_doc='sequence classification'
)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING




__A			:					int						=			auto_class_update(FlaxAutoModelForQuestionAnswering, head_doc='question answering')





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING




__A			:					List[Any]						=			auto_class_update(
    FlaxAutoModelForTokenClassification, head_doc='token classification'
)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING




__A			:					Any						=			auto_class_update(FlaxAutoModelForMultipleChoice, head_doc='multiple choice')





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING




__A			:					Union[str, Any]						=			auto_class_update(
    FlaxAutoModelForNextSentencePrediction, head_doc='next sentence prediction'
)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING




__A			:					Optional[Any]						=			auto_class_update(
    FlaxAutoModelForImageClassification, head_doc='image classification'
)





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING




__A			:					int						=			auto_class_update(FlaxAutoModelForVisionaSeq, head_doc='vision-to-text modeling')





class 			_SCREAMING_SNAKE_CASE (   _BaseAutoModelClass		):







   '''simple docstring'''




   lowerCamelCase__				=      FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING




__A			:					Optional[int]						=			auto_class_update(
    FlaxAutoModelForSpeechSeqaSeq, head_doc='sequence-to-sequence speech-to-text modeling'
)