o
    i]=                     @   s  d Z ddlmZ ddlmZ ddlmZmZmZ ddl	m
Z
 eeZeg dZeg d	Zeg d
Zeg dZeg dZedgZeg dZeg dZeg dZeg dZeg dZedgZeddgZedgZee
eZee
eZee
eZee
eZee
eZ ee
eZ!ee
eZ"ee
eZ#ee
eZ$ee
eZ%ee
eZ&ee
eZ'ee
eZ(ee
eZ)G dd deZ*ee*Z*G dd deZ+ee+ddZ+G dd deZ,ee,ddZ,G d d! d!eZ-ee-d"dZ-G d#d$ d$eZ.ee.d%d&d'Z.G d(d) d)eZ/ee/d*dZ/G d+d, d,eZ0ee0d-dZ0G d.d/ d/eZ1ee1d0dZ1G d1d2 d2eZ2ee2d3dZ2G d4d5 d5eZ3ee3d6dZ3G d7d8 d8eZ4ee4d9dZ4G d:d; d;eZ5ee5d<dZ5G d=d> d>eZ6ee6d?dZ6g d@Z7dAS )BzAuto Model class.    )OrderedDict   )logging   )_BaseAutoModelClass_LazyAutoMappingauto_class_update)CONFIG_MAPPING_NAMES)%)albertFlaxAlbertModel)bartFlaxBartModel)beitFlaxBeitModel)bertFlaxBertModel)big_birdFlaxBigBirdModel)
blenderbotFlaxBlenderbotModel)blenderbot-smallFlaxBlenderbotSmallModel)bloomFlaxBloomModel)clipFlaxCLIPModel)dinov2FlaxDinov2Model)
distilbertFlaxDistilBertModel)electraFlaxElectraModel)gemmaFlaxGemmaModel)gpt-sw3FlaxGPT2Model)gpt2r%   )gpt_neoFlaxGPTNeoModel)gptjFlaxGPTJModel)llamaFlaxLlamaModel)longt5FlaxLongT5Model)marianFlaxMarianModel)mbartFlaxMBartModel)mistralFlaxMistralModel)mt5FlaxMT5Model)optFlaxOPTModel)pegasusFlaxPegasusModel)regnetFlaxRegNetModel)resnetFlaxResNetModel)robertaFlaxRobertaModel)roberta-prelayernormFlaxRobertaPreLayerNormModel)roformerFlaxRoFormerModel)t5FlaxT5Model)zvision-text-dual-encoderFlaxVisionTextDualEncoderModel)vitFlaxViTModel)wav2vec2FlaxWav2Vec2Model)whisperFlaxWhisperModel)xglmFlaxXGLMModel)xlm-robertaFlaxXLMRobertaModel))r
   FlaxAlbertForPreTrainingr    FlaxBartForConditionalGeneration)r   FlaxBertForPreTraining)r   FlaxBigBirdForPreTraining)r    FlaxElectraForPreTrainingr-   "FlaxLongT5ForConditionalGenerationr1   !FlaxMBartForConditionalGenerationr5   FlaxMT5ForConditionalGenerationr?   FlaxRobertaForMaskedLMrA   "FlaxRobertaPreLayerNormForMaskedLMrC   FlaxRoFormerForMaskedLMrE   FlaxT5ForConditionalGeneration)rJ   FlaxWav2Vec2ForPreTrainingrL   #FlaxWhisperForConditionalGenerationrP   FlaxXLMRobertaForMaskedLM))r
   FlaxAlbertForMaskedLMrS   )r   FlaxBertForMaskedLM)r   FlaxBigBirdForMaskedLM)r   FlaxDistilBertForMaskedLM)r    FlaxElectraForMaskedLMrZ   r^   r`   rb   ri   )
rS   )r   &FlaxBlenderbotForConditionalGeneration)r   +FlaxBlenderbotSmallForConditionalGeneration)zencoder-decoderFlaxEncoderDecoderModelrX   )r/   FlaxMarianMTModelrZ   r\   )r9   #FlaxPegasusForConditionalGenerationrd   ))r   FlaxBeitForImageClassification)r    FlaxDinov2ForImageClassification)r;    FlaxRegNetForImageClassification)r=    FlaxResNetForImageClassification)rH   FlaxViTForImageClassification)zvision-encoder-decoderFlaxVisionEncoderDecoderModel))r   FlaxBartForCausalLM)r   FlaxBertForCausalLM)r   FlaxBigBirdForCausalLM)r   FlaxBloomForCausalLM)r    FlaxElectraForCausalLM)r"   FlaxGemmaForCausalLM)r$   FlaxGPT2LMHeadModel)r&   r   )r'   FlaxGPTNeoForCausalLM)r)   FlaxGPTJForCausalLM)r+   FlaxLlamaForCausalLM)r3   FlaxMistralForCausalLM)r7   FlaxOPTForCausalLM)r?   FlaxRobertaForCausalLM)rA   "FlaxRobertaPreLayerNormForCausalLM)rN   FlaxXGLMForCausalLM)rP   FlaxXLMRobertaForCausalLM))r
   #FlaxAlbertForSequenceClassification)r   !FlaxBartForSequenceClassification)r   !FlaxBertForSequenceClassification)r   $FlaxBigBirdForSequenceClassification)r   'FlaxDistilBertForSequenceClassification)r    $FlaxElectraForSequenceClassification)r1   "FlaxMBartForSequenceClassification)r?   $FlaxRobertaForSequenceClassification)rA   0FlaxRobertaPreLayerNormForSequenceClassification)rC   %FlaxRoFormerForSequenceClassification)rP   'FlaxXLMRobertaForSequenceClassification))r
   FlaxAlbertForQuestionAnswering)r   FlaxBartForQuestionAnswering)r   FlaxBertForQuestionAnswering)r   FlaxBigBirdForQuestionAnswering)r   "FlaxDistilBertForQuestionAnswering)r    FlaxElectraForQuestionAnswering)r1   FlaxMBartForQuestionAnswering)r?   FlaxRobertaForQuestionAnswering)rA   +FlaxRobertaPreLayerNormForQuestionAnswering)rC    FlaxRoFormerForQuestionAnswering)rP   "FlaxXLMRobertaForQuestionAnswering)	)r
    FlaxAlbertForTokenClassification)r   FlaxBertForTokenClassification)r   !FlaxBigBirdForTokenClassification)r   $FlaxDistilBertForTokenClassification)r    !FlaxElectraForTokenClassification)r?   !FlaxRobertaForTokenClassification)rA   -FlaxRobertaPreLayerNormForTokenClassification)rC   "FlaxRoFormerForTokenClassification)rP   $FlaxXLMRobertaForTokenClassification)	)r
   FlaxAlbertForMultipleChoice)r   FlaxBertForMultipleChoice)r   FlaxBigBirdForMultipleChoice)r   FlaxDistilBertForMultipleChoice)r    FlaxElectraForMultipleChoice)r?   FlaxRobertaForMultipleChoice)rA   (FlaxRobertaPreLayerNormForMultipleChoice)rC   FlaxRoFormerForMultipleChoice)rP   FlaxXLMRobertaForMultipleChoice)r   !FlaxBertForNextSentencePrediction)zspeech-encoder-decoderFlaxSpeechEncoderDecoderModelrg   )rL   !FlaxWhisperForAudioClassificationc                   @      e Zd ZeZdS )FlaxAutoModelN)__name__
__module____qualname__FLAX_MODEL_MAPPING_model_mapping r   r   _/home/ubuntu/.local/lib/python3.10/site-packages/transformers/models/auto/modeling_flax_auto.pyr         r   c                   @   r   )FlaxAutoModelForPreTrainingN)r   r   r   "FLAX_MODEL_FOR_PRETRAINING_MAPPINGr   r   r   r   r   r      r   r   pretraining)head_docc                   @   r   )FlaxAutoModelForCausalLMN)r   r   r    FLAX_MODEL_FOR_CAUSAL_LM_MAPPINGr   r   r   r   r   r   '  r   r   zcausal language modelingc                   @   r   )FlaxAutoModelForMaskedLMN)r   r   r    FLAX_MODEL_FOR_MASKED_LM_MAPPINGr   r   r   r   r   r   .  r   r   zmasked language modelingc                   @   r   )FlaxAutoModelForSeq2SeqLMN)r   r   r   +FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPINGr   r   r   r   r   r   5  r   r   z&sequence-to-sequence language modelingzgoogle-t5/t5-base)r   checkpoint_for_examplec                   @   r   )&FlaxAutoModelForSequenceClassificationN)r   r   r   .FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPINGr   r   r   r   r   r   @  r   r   zsequence classificationc                   @   r   )!FlaxAutoModelForQuestionAnsweringN)r   r   r   )FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPINGr   r   r   r   r   r   I  r   r   zquestion answeringc                   @   r   )#FlaxAutoModelForTokenClassificationN)r   r   r   +FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPINGr   r   r   r   r   r   P  r   r   ztoken classificationc                   @   r   )FlaxAutoModelForMultipleChoiceN)r   r   r   &FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPINGr   r   r   r   r   r   Y  r   r   zmultiple choicec                   @   r   )&FlaxAutoModelForNextSentencePredictionN)r   r   r   /FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPINGr   r   r   r   r   r   `  r   r   znext sentence predictionc                   @   r   )#FlaxAutoModelForImageClassificationN)r   r   r   +FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPINGr   r   r   r   r   r   i  r   r   zimage classificationc                   @   r   )FlaxAutoModelForVision2SeqN)r   r   r   #FLAX_MODEL_FOR_VISION_2_SEQ_MAPPINGr   r   r   r   r   r   r  r   r   zvision-to-text modelingc                   @   r   )FlaxAutoModelForSpeechSeq2SeqN)r   r   r   'FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPINGr   r   r   r   r   r   y  r   r   z,sequence-to-sequence speech-to-text modeling)+FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPINGr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   N)8__doc__collectionsr   utilsr   auto_factoryr   r   r   configuration_autor	   
get_loggerr   loggerFLAX_MODEL_MAPPING_NAMES(FLAX_MODEL_FOR_PRETRAINING_MAPPING_NAMES&FLAX_MODEL_FOR_MASKED_LM_MAPPING_NAMES1FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES1FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES)FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES&FLAX_MODEL_FOR_CAUSAL_LM_MAPPING_NAMES4FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES/FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES1FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES,FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING_NAMES5FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING_NAMES-FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES1FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMESr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __all__r   r   r   r   <module>   s   
+




