o
    Zh]=                     @   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)%)albertZFlaxAlbertModel)bartZFlaxBartModel)beitZFlaxBeitModel)bertZFlaxBertModel)big_birdZFlaxBigBirdModel)
blenderbotZFlaxBlenderbotModel)blenderbot-smallZFlaxBlenderbotSmallModel)bloomZFlaxBloomModel)ZclipZFlaxCLIPModel)dinov2ZFlaxDinov2Model)
distilbertZFlaxDistilBertModel)electraZFlaxElectraModel)gemmaZFlaxGemmaModel)gpt-sw3FlaxGPT2Model)gpt2r   )gpt_neoZFlaxGPTNeoModel)gptjZFlaxGPTJModel)llamaZFlaxLlamaModel)longt5ZFlaxLongT5Model)marianZFlaxMarianModel)mbartZFlaxMBartModel)mistralZFlaxMistralModel)mt5ZFlaxMT5Model)optZFlaxOPTModel)pegasusZFlaxPegasusModel)regnetZFlaxRegNetModel)resnetZFlaxResNetModel)robertaZFlaxRobertaModel)roberta-prelayernormZFlaxRobertaPreLayerNormModel)roformerZFlaxRoFormerModel)t5ZFlaxT5Model)zvision-text-dual-encoderZFlaxVisionTextDualEncoderModel)vitZFlaxViTModel)wav2vec2ZFlaxWav2Vec2Model)whisperZFlaxWhisperModel)xglmZFlaxXGLMModel)xlm-robertaZFlaxXLMRobertaModel))r
   ZFlaxAlbertForPreTrainingr   Z FlaxBartForConditionalGeneration)r   ZFlaxBertForPreTraining)r   ZFlaxBigBirdForPreTraining)r   ZFlaxElectraForPreTrainingr   Z"FlaxLongT5ForConditionalGenerationr   Z!FlaxMBartForConditionalGenerationr    ZFlaxMT5ForConditionalGenerationr%   ZFlaxRobertaForMaskedLMr&   Z"FlaxRobertaPreLayerNormForMaskedLMr'   ZFlaxRoFormerForMaskedLMr(   ZFlaxT5ForConditionalGeneration)r*   ZFlaxWav2Vec2ForPreTrainingr+   Z#FlaxWhisperForConditionalGenerationr-   ZFlaxXLMRobertaForMaskedLM))r
   ZFlaxAlbertForMaskedLMr.   )r   ZFlaxBertForMaskedLM)r   ZFlaxBigBirdForMaskedLM)r   ZFlaxDistilBertForMaskedLM)r   ZFlaxElectraForMaskedLMr0   r2   r3   r4   r7   )
r.   )r   Z&FlaxBlenderbotForConditionalGeneration)r   Z+FlaxBlenderbotSmallForConditionalGeneration)zencoder-decoderZFlaxEncoderDecoderModelr/   )r   ZFlaxMarianMTModelr0   r1   )r"   Z#FlaxPegasusForConditionalGenerationr5   ))r   ZFlaxBeitForImageClassification)r   Z FlaxDinov2ForImageClassification)r#   Z FlaxRegNetForImageClassification)r$   Z FlaxResNetForImageClassification)r)   ZFlaxViTForImageClassification)zvision-encoder-decoderZFlaxVisionEncoderDecoderModel))r   ZFlaxBartForCausalLM)r   ZFlaxBertForCausalLM)r   ZFlaxBigBirdForCausalLM)r   ZFlaxBloomForCausalLM)r   ZFlaxElectraForCausalLM)r   ZFlaxGemmaForCausalLM)r   FlaxGPT2LMHeadModel)r   r8   )r   ZFlaxGPTNeoForCausalLM)r   ZFlaxGPTJForCausalLM)r   ZFlaxLlamaForCausalLM)r   ZFlaxMistralForCausalLM)r!   ZFlaxOPTForCausalLM)r%   ZFlaxRobertaForCausalLM)r&   Z"FlaxRobertaPreLayerNormForCausalLM)r,   ZFlaxXGLMForCausalLM)r-   ZFlaxXLMRobertaForCausalLM))r
   Z#FlaxAlbertForSequenceClassification)r   Z!FlaxBartForSequenceClassification)r   Z!FlaxBertForSequenceClassification)r   Z$FlaxBigBirdForSequenceClassification)r   Z'FlaxDistilBertForSequenceClassification)r   Z$FlaxElectraForSequenceClassification)r   Z"FlaxMBartForSequenceClassification)r%   Z$FlaxRobertaForSequenceClassification)r&   Z0FlaxRobertaPreLayerNormForSequenceClassification)r'   Z%FlaxRoFormerForSequenceClassification)r-   Z'FlaxXLMRobertaForSequenceClassification))r
   ZFlaxAlbertForQuestionAnswering)r   ZFlaxBartForQuestionAnswering)r   ZFlaxBertForQuestionAnswering)r   ZFlaxBigBirdForQuestionAnswering)r   Z"FlaxDistilBertForQuestionAnswering)r   ZFlaxElectraForQuestionAnswering)r   ZFlaxMBartForQuestionAnswering)r%   ZFlaxRobertaForQuestionAnswering)r&   Z+FlaxRobertaPreLayerNormForQuestionAnswering)r'   Z FlaxRoFormerForQuestionAnswering)r-   Z"FlaxXLMRobertaForQuestionAnswering)	)r
   Z FlaxAlbertForTokenClassification)r   ZFlaxBertForTokenClassification)r   Z!FlaxBigBirdForTokenClassification)r   Z$FlaxDistilBertForTokenClassification)r   Z!FlaxElectraForTokenClassification)r%   Z!FlaxRobertaForTokenClassification)r&   Z-FlaxRobertaPreLayerNormForTokenClassification)r'   Z"FlaxRoFormerForTokenClassification)r-   Z$FlaxXLMRobertaForTokenClassification)	)r
   ZFlaxAlbertForMultipleChoice)r   ZFlaxBertForMultipleChoice)r   ZFlaxBigBirdForMultipleChoice)r   ZFlaxDistilBertForMultipleChoice)r   ZFlaxElectraForMultipleChoice)r%   ZFlaxRobertaForMultipleChoice)r&   Z(FlaxRobertaPreLayerNormForMultipleChoice)r'   ZFlaxRoFormerForMultipleChoice)r-   ZFlaxXLMRobertaForMultipleChoice)r   Z!FlaxBertForNextSentencePrediction)zspeech-encoder-decoderZFlaxSpeechEncoderDecoderModelr6   )r+   Z!FlaxWhisperForAudioClassificationc                   @      e Zd ZeZdS )FlaxAutoModelN)__name__
__module____qualname__FLAX_MODEL_MAPPING_model_mapping r@   r@   Z/var/www/auris/lib/python3.10/site-packages/transformers/models/auto/modeling_flax_auto.pyr:         r:   c                   @   r9   )FlaxAutoModelForPreTrainingN)r;   r<   r=   "FLAX_MODEL_FOR_PRETRAINING_MAPPINGr?   r@   r@   r@   rA   rC      rB   rC   Zpretraining)head_docc                   @   r9   )FlaxAutoModelForCausalLMN)r;   r<   r=    FLAX_MODEL_FOR_CAUSAL_LM_MAPPINGr?   r@   r@   r@   rA   rF   '  rB   rF   zcausal language modelingc                   @   r9   )FlaxAutoModelForMaskedLMN)r;   r<   r=    FLAX_MODEL_FOR_MASKED_LM_MAPPINGr?   r@   r@   r@   rA   rH   .  rB   rH   zmasked language modelingc                   @   r9   )FlaxAutoModelForSeq2SeqLMN)r;   r<   r=   +FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPINGr?   r@   r@   r@   rA   rJ   5  rB   rJ   z&sequence-to-sequence language modelingzgoogle-t5/t5-base)rE   Zcheckpoint_for_examplec                   @   r9   )&FlaxAutoModelForSequenceClassificationN)r;   r<   r=   .FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPINGr?   r@   r@   r@   rA   rL   @  rB   rL   zsequence classificationc                   @   r9   )!FlaxAutoModelForQuestionAnsweringN)r;   r<   r=   )FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPINGr?   r@   r@   r@   rA   rN   I  rB   rN   zquestion answeringc                   @   r9   )#FlaxAutoModelForTokenClassificationN)r;   r<   r=   +FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPINGr?   r@   r@   r@   rA   rP   P  rB   rP   ztoken classificationc                   @   r9   )FlaxAutoModelForMultipleChoiceN)r;   r<   r=   &FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPINGr?   r@   r@   r@   rA   rR   Y  rB   rR   zmultiple choicec                   @   r9   )&FlaxAutoModelForNextSentencePredictionN)r;   r<   r=   /FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPINGr?   r@   r@   r@   rA   rT   `  rB   rT   znext sentence predictionc                   @   r9   )#FlaxAutoModelForImageClassificationN)r;   r<   r=   +FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPINGr?   r@   r@   r@   rA   rV   i  rB   rV   zimage classificationc                   @   r9   )FlaxAutoModelForVision2SeqN)r;   r<   r=   #FLAX_MODEL_FOR_VISION_2_SEQ_MAPPINGr?   r@   r@   r@   rA   rX   r  rB   rX   zvision-to-text modelingc                   @   r9   )FlaxAutoModelForSpeechSeq2SeqN)r;   r<   r=   'FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPINGr?   r@   r@   r@   rA   rZ   y  rB   rZ   z,sequence-to-sequence speech-to-text modeling)+FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPINGrG   rW   rI   rS   rU   rD   rO   rK   rM   r[   rQ   rY   r>   r:   rF   rV   rH   rR   rT   rC   rN   rJ   rL   rZ   rP   rX   N)8__doc__collectionsr   utilsr   Zauto_factoryr   r   r   Zconfiguration_autor	   Z
get_loggerr;   loggerZFLAX_MODEL_MAPPING_NAMESZ(FLAX_MODEL_FOR_PRETRAINING_MAPPING_NAMESZ&FLAX_MODEL_FOR_MASKED_LM_MAPPING_NAMESZ1FLAX_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMESZ1FLAX_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMESZ)FLAX_MODEL_FOR_VISION_2_SEQ_MAPPING_NAMESZ&FLAX_MODEL_FOR_CAUSAL_LM_MAPPING_NAMESZ4FLAX_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMESZ/FLAX_MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMESZ1FLAX_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMESZ,FLAX_MODEL_FOR_MULTIPLE_CHOICE_MAPPING_NAMESZ5FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING_NAMESZ-FLAX_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMESZ1FLAX_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMESr>   rD   rI   rK   rW   rY   rG   rM   rO   rQ   rS   rU   r[   r\   r:   rC   rF   rH   rJ   rL   rN   rP   rR   rT   rV   rX   rZ   __all__r@   r@   r@   rA   <module>   s   
+




