
    sgo                     6   d Z ddl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j                  e      Z eg d	      Z eg d
      Z eg d      Z eg d      Z eddg      Z eg d      Z eddg      Z eg d      Z eddg      Z eg d      Z eg d      Z eddg      Z eg d      Z eg d      Z edg      Z eddg      Z edg      Z eg d      Z  eg d       Z! ed!d"g      Z" ed#g      Z# eg d$      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      Z0 eee      Z1 eee      Z2 eee      Z3 eee      Z4 eee       Z5 eee!      Z6 eee"      Z7 eee      Z8 eee#      Z9 eee$      Z: G d% d&e      Z; G d' d(e      Z< G d) d*e      Z= e	e=      Z= G d+ d,e      Z> e	e>d-.      Z> G d/ d0e      Z? e	e?d1.      Z? G d2 d3e      Z@ e	e@d4.      Z@ G d5 d6e      ZA e	eAd7.      ZA G d8 d9e      ZB e	eBd:.      ZB G d; d<e      ZC e	eCd=.      ZC G d> d?e      ZD e	eDd@.      ZD G dA dBe      ZE e	eEdC.      ZE G dD dEe      ZF e	eFdF.      ZF G dG dHe      ZG e	eGdI.      ZG G dJ dKe      ZH e	eHdLdMN      ZH G dO dPe      ZI e	eIdQ.      ZI G dR dSe      ZJ e	eJdT.      ZJ G dU dVe      ZK e	eKdWdXN      ZK G dY dZe      ZL e	eLd[d\N      ZL G d] d^e      ZM e	eMd_.      ZM G d` dae      ZN e	eNdb.      ZN G dc dde      ZO e	eOde.      ZO G df dge      ZP e	ePdh.      ZP G di dje@      ZQy)kzAuto Model class.    N)OrderedDict   )logging   )_BaseAutoModelClass_LazyAutoMappingauto_class_update)CONFIG_MAPPING_NAMES)DalbertTFAlbertModel)bartTFBartModelbertTFBertModel)
blenderbotTFBlenderbotModel)blenderbot-smallTFBlenderbotSmallModelblipTFBlipModel)	camembertTFCamembertModelclipTFCLIPModelconvbertTFConvBertModel)convnextTFConvNextModel)
convnextv2TFConvNextV2Model)ctrlTFCTRLModel)cvt
TFCvtModel)data2vec-visionTFData2VecVisionModeldebertaTFDebertaModel
deberta-v2TFDebertaV2Model)deitTFDeiTModel
distilbertTFDistilBertModel)dprTFDPRQuestionEncoder)efficientformerTFEfficientFormerModelelectraTFElectraModel)esm
TFEsmModelflaubertTFFlaubertModel)funnel)TFFunnelModelTFFunnelBaseModel)gpt-sw3TFGPT2Model)gpt2rG   )gptjTFGPTJModel)groupvitTFGroupViTModel)hubertTFHubertModel)ideficsTFIdeficsModel)layoutlmTFLayoutLMModel)
layoutlmv3TFLayoutLMv3Model)led
TFLEDModel
longformerTFLongformerModel)lxmertTFLxmertModel)marianTFMarianModel)mbartTFMBartModel)mistralTFMistralModel
mobilebertTFMobileBertModel)	mobilevitTFMobileViTModel)mpnetTFMPNetModel)mt5
TFMT5Model)
openai-gptTFOpenAIGPTModel)opt
TFOPTModel)pegasusTFPegasusModel)regnetTFRegNetModelrembertTFRemBertModel)resnetTFResNetModelrobertaTFRobertaModelroberta-prelayernormTFRobertaPreLayerNormModelroformerTFRoFormerModelsam
TFSamModel)	segformerTFSegformerModel)speech_to_textTFSpeech2TextModel)swiftformerTFSwiftFormerModel)swinTFSwinModel)t5	TFT5Model)tapasTFTapasModel)
transfo-xlTFTransfoXLModel)zvision-text-dual-encoderTFVisionTextDualEncoderModel)vit
TFViTModel)vit_maeTFViTMAEModel)wav2vec2TFWav2Vec2Model)whisperTFWhisperModel)xglmTFXGLMModelxlm
TFXLMModelxlm-robertaTFXLMRobertaModel)xlnetTFXLNetModel))r   TFAlbertForPreTrainingr   TFBartForConditionalGeneration)r   TFBertForPreTrainingr   TFCamembertForMaskedLMr&   TFCTRLLMHeadModelr5   TFDistilBertForMaskedLM)r<   TFElectraForPreTrainingrA   TFFlaubertWithLMHeadModel)rC   TFFunnelForPreTrainingrF   TFGPT2LMHeadModelrH   r   )rO   TFIdeficsForVisionText2TextrQ   TFLayoutLMForMaskedLM)rZ   TFLxmertForPreTraining)rc   TFMobileBertForPreTrainingrg   TFMPNetForMaskedLMrk   TFOpenAIGPTLMHeadModelry   TFRobertaForMaskedLMr|    TFRobertaPreLayerNormForMaskedLMr   TFT5ForConditionalGenerationr   TFTapasForMaskedLMr   TFTransfoXLLMHeadModel)r   TFViTMAEForPreTrainingr   TFXLMWithLMHeadModelr   TFXLMRobertaForMaskedLMr   TFXLNetLMHeadModel)!r   TFAlbertForMaskedLMr   r   TFBertForMaskedLMr   r    TFConvBertForMaskedLMr   r   r<   TFElectraForMaskedLMr>   TFEsmForMaskedLMr   rC   TFFunnelForMaskedLMr   r   rI   TFGPTJForCausalLMr   rU   TFLEDForConditionalGenerationrX   TFLongformerForMaskedLMr\   TFMarianMTModelrc   TFMobileBertForMaskedLMr   r   rt   TFRemBertForMaskedLMr   r   r   TFRoFormerForMaskedLMr   %TFSpeech2TextForConditionalGenerationr   r   r   r   !TFWhisperForConditionalGenerationr   r   r   ))r   TFBertLMHeadModel)r   TFCamembertForCausalLMr   r   r   r   )r`   TFMistralForCausalLMr   )rm   TFOPTForCausalLM)rt   TFRemBertForCausalLM)ry   TFRobertaForCausalLM)r|    TFRobertaPreLayerNormForCausalLM)r   TFRoFormerForCausalLMr   )r   TFXGLMForCausalLMr   )r   TFXLMRobertaForCausalLMr   )r2   TFDeiTForMaskedImageModeling)r   TFSwinForMaskedImageModeling))r"    TFConvNextForImageClassification)r$   "TFConvNextV2ForImageClassification)r(   TFCvtForImageClassification)r*   &TFData2VecVisionForImageClassification)r2   )TFDeiTForImageClassification'TFDeiTForImageClassificationWithTeacher)r9   )'TFEfficientFormerForImageClassification2TFEfficientFormerForImageClassificationWithTeacher)re   !TFMobileViTForImageClassification)rq   TFRegNetForImageClassification)rv   TFResNetForImageClassification)r   !TFSegformerForImageClassification)r   #TFSwiftFormerForImageClassification)r   TFSwinForImageClassification)r   TFViTForImageClassificationr   r   ))r*   'TFData2VecVisionForSemanticSegmentation)re   "TFMobileViTForSemanticSegmentation)r   "TFSegformerForSemanticSegmentation)r   TFBlipForConditionalGeneration)zvision-encoder-decoderTFVisionEncoderDecoderModel)r   r   r   r   )r-   TFDebertaForMaskedLM)r0   TFDebertaV2ForMaskedLMr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )
r   )r   $TFBlenderbotForConditionalGeneration)r   )TFBlenderbotSmallForConditionalGeneration)zencoder-decoderTFEncoderDecoderModelr   r   )r^   TFMBartForConditionalGeneration)ri   TFMT5ForConditionalGeneration)ro   !TFPegasusForConditionalGenerationr   r   r   ) )r   !TFAlbertForSequenceClassification)r   TFBartForSequenceClassification)r   TFBertForSequenceClassification)r   $TFCamembertForSequenceClassification)r    #TFConvBertForSequenceClassification)r&   TFCTRLForSequenceClassification)r-   "TFDebertaForSequenceClassification)r0   $TFDebertaV2ForSequenceClassification)r5   %TFDistilBertForSequenceClassification)r<   "TFElectraForSequenceClassification)r>   TFEsmForSequenceClassification)rA   #TFFlaubertForSequenceClassification)rC   !TFFunnelForSequenceClassification)rF   TFGPT2ForSequenceClassification)rH   r#  )rI   TFGPTJForSequenceClassification)rQ   #TFLayoutLMForSequenceClassification)rS   %TFLayoutLMv3ForSequenceClassification)rX   %TFLongformerForSequenceClassification)r`   "TFMistralForSequenceClassification)rc   %TFMobileBertForSequenceClassification)rg    TFMPNetForSequenceClassification)rk   $TFOpenAIGPTForSequenceClassification)rt   "TFRemBertForSequenceClassification)ry   "TFRobertaForSequenceClassification)r|   .TFRobertaPreLayerNormForSequenceClassification)r   #TFRoFormerForSequenceClassification)r    TFTapasForSequenceClassification)r   $TFTransfoXLForSequenceClassification)r   TFXLMForSequenceClassification)r   %TFXLMRobertaForSequenceClassification)r    TFXLNetForSequenceClassification))r   TFAlbertForQuestionAnswering)r   TFBertForQuestionAnswering)r   TFCamembertForQuestionAnswering)r    TFConvBertForQuestionAnswering)r-   TFDebertaForQuestionAnswering)r0   TFDebertaV2ForQuestionAnswering)r5    TFDistilBertForQuestionAnswering)r<   TFElectraForQuestionAnswering)rA   $TFFlaubertForQuestionAnsweringSimple)rC   TFFunnelForQuestionAnswering)rI   TFGPTJForQuestionAnsweringrS    TFLayoutLMv3ForQuestionAnswering)rX    TFLongformerForQuestionAnswering)rc    TFMobileBertForQuestionAnswering)rg   TFMPNetForQuestionAnswering)rt   TFRemBertForQuestionAnswering)ry   TFRobertaForQuestionAnswering)r|   )TFRobertaPreLayerNormForQuestionAnswering)r   TFRoFormerForQuestionAnswering)r   TFXLMForQuestionAnsweringSimple)r    TFXLMRobertaForQuestionAnswering)r   !TFXLNetForQuestionAnsweringSimple)r   #TFWav2Vec2ForSequenceClassification)rQ   TFLayoutLMForQuestionAnsweringr@  )r   TFTapasForQuestionAnswering))r   TFAlbertForTokenClassification)r   TFBertForTokenClassification)r   !TFCamembertForTokenClassification)r     TFConvBertForTokenClassification)r-   TFDebertaForTokenClassification)r0   !TFDebertaV2ForTokenClassification)r5   "TFDistilBertForTokenClassification)r<   TFElectraForTokenClassification)r>   TFEsmForTokenClassification)rA    TFFlaubertForTokenClassification)rC   TFFunnelForTokenClassification)rQ    TFLayoutLMForTokenClassification)rS   "TFLayoutLMv3ForTokenClassification)rX   "TFLongformerForTokenClassification)rc   "TFMobileBertForTokenClassification)rg   TFMPNetForTokenClassification)rt   TFRemBertForTokenClassification)ry   TFRobertaForTokenClassification)r|   +TFRobertaPreLayerNormForTokenClassification)r    TFRoFormerForTokenClassification)r   TFXLMForTokenClassification)r   "TFXLMRobertaForTokenClassification)r   TFXLNetForTokenClassification))r   TFAlbertForMultipleChoice)r   TFBertForMultipleChoice)r   TFCamembertForMultipleChoice)r    TFConvBertForMultipleChoice)r0   TFDebertaV2ForMultipleChoice)r5   TFDistilBertForMultipleChoice)r<   TFElectraForMultipleChoice)rA   TFFlaubertForMultipleChoice)rC   TFFunnelForMultipleChoice)rX   TFLongformerForMultipleChoice)rc   TFMobileBertForMultipleChoice)rg   TFMPNetForMultipleChoice)rt   TFRemBertForMultipleChoice)ry   TFRobertaForMultipleChoice)r|   &TFRobertaPreLayerNormForMultipleChoice)r   TFRoFormerForMultipleChoice)r   TFXLMForMultipleChoice)r   TFXLMRobertaForMultipleChoice)r   TFXLNetForMultipleChoice)r   TFBertForNextSentencePrediction)rc   %TFMobileBertForNextSentencePredictionr   )r   r   r   r,   r/   r4   r;   r@   rW   rb   )ri   TFMT5EncoderModelrs   rx   r{   r~   )r   TFT5EncoderModelr   r   c                       e Zd ZeZy)TFAutoModelForMaskGenerationN)__name__
__module____qualname__$TF_MODEL_FOR_MASK_GENERATION_MAPPING_model_mapping     \/var/www/html/venv/lib/python3.12/site-packages/transformers/models/auto/modeling_tf_auto.pyr~  r~        9Nr  r~  c                       e Zd ZeZy)TFAutoModelForTextEncodingN)r  r  r  "TF_MODEL_FOR_TEXT_ENCODING_MAPPINGr  r  r  r  r  r    s    7Nr  r  c                       e Zd ZeZy)TFAutoModelN)r  r  r  TF_MODEL_MAPPINGr  r  r  r  r  r    s    %Nr  r  c                       e Zd ZeZy)!TFAutoModelForAudioClassificationN)r  r  r  )TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPINGr  r  r  r  r  r         >Nr  r  zaudio classification)head_docc                       e Zd ZeZy)TFAutoModelForPreTrainingN)r  r  r   TF_MODEL_FOR_PRETRAINING_MAPPINGr  r  r  r  r  r  )  s    5Nr  r  pretrainingc                       e Zd ZeZy)_TFAutoModelWithLMHeadN)r  r  r  TF_MODEL_WITH_LM_HEAD_MAPPINGr  r  r  r  r  r  1  s    2Nr  r  zlanguage modelingc                       e Zd ZeZy)TFAutoModelForCausalLMN)r  r  r  TF_MODEL_FOR_CAUSAL_LM_MAPPINGr  r  r  r  r  r  8      3Nr  r  zcausal language modelingc                       e Zd ZeZy)!TFAutoModelForMaskedImageModelingN)r  r  r  *TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPINGr  r  r  r  r  r  ?      ?Nr  r  zmasked image modelingc                       e Zd ZeZy)!TFAutoModelForImageClassificationN)r  r  r  )TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPINGr  r  r  r  r  r  H  r  r  r  zimage classificationc                       e Zd ZeZy))TFAutoModelForZeroShotImageClassificationN)r  r  r  3TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPINGr  r  r  r  r  r  Q  s    HNr  r  zzero-shot image classificationc                       e Zd ZeZy)"TFAutoModelForSemanticSegmentationN)r  r  r  *TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPINGr  r  r  r  r  r  Z  r  r  r  zsemantic segmentationc                       e Zd ZeZy)TFAutoModelForVision2SeqN)r  r  r  !TF_MODEL_FOR_VISION_2_SEQ_MAPPINGr  r  r  r  r  r  c  s    6Nr  r  zvision-to-text modelingc                       e Zd ZeZy)TFAutoModelForMaskedLMN)r  r  r  TF_MODEL_FOR_MASKED_LM_MAPPINGr  r  r  r  r  r  j  r  r  r  zmasked language modelingc                       e Zd ZeZy)TFAutoModelForSeq2SeqLMN)r  r  r  )TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPINGr  r  r  r  r  r  q  r  r  r  z&sequence-to-sequence language modelingzgoogle-t5/t5-base)r  checkpoint_for_examplec                       e Zd ZeZy)$TFAutoModelForSequenceClassificationN)r  r  r  ,TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPINGr  r  r  r  r  r  |  s    ANr  r  zsequence classificationc                       e Zd ZeZy)TFAutoModelForQuestionAnsweringN)r  r  r  'TF_MODEL_FOR_QUESTION_ANSWERING_MAPPINGr  r  r  r  r  r    s    <Nr  r  zquestion answeringc                       e Zd ZeZy)'TFAutoModelForDocumentQuestionAnsweringN)r  r  r  0TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPINGr  r  r  r  r  r    s    ENr  r  zdocument question answeringz/impira/layoutlm-document-qa", revision="52e01b3c                       e Zd ZeZy)$TFAutoModelForTableQuestionAnsweringN)r  r  r  -TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPINGr  r  r  r  r  r        BNr  r  ztable question answeringzgoogle/tapas-base-finetuned-wtqc                       e Zd ZeZy)!TFAutoModelForTokenClassificationN)r  r  r  )TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPINGr  r  r  r  r  r    r  r  r  ztoken classificationc                       e Zd ZeZy)TFAutoModelForMultipleChoiceN)r  r  r  $TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPINGr  r  r  r  r  r    r  r  r  zmultiple choicec                       e Zd ZeZy)$TFAutoModelForNextSentencePredictionN)r  r  r  -TF_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPINGr  r  r  r  r  r    r  r  r  znext sentence predictionc                       e Zd ZeZy)TFAutoModelForSpeechSeq2SeqN)r  r  r  %TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPINGr  r  r  r  r  r    s    :Nr  r  z,sequence-to-sequence speech-to-text modelingc                   <     e Zd Ze fd       Ze fd       Z xZS )TFAutoModelWithLMHeadc                 V    t        j                  dt               t        |   |      S Na  The class `TFAutoModelWithLMHead` is deprecated and will be removed in a future version. Please use `TFAutoModelForCausalLM` for causal language models, `TFAutoModelForMaskedLM` for masked language models and `TFAutoModelForSeq2SeqLM` for encoder-decoder models.)warningswarnFutureWarningsuperfrom_config)clsconfig	__class__s     r  r  z!TFAutoModelWithLMHead.from_config  s,    I 		
 w"6**r  c                 ^    t        j                  dt               t        |   |g|i |S r  )r  r  r  r  from_pretrained)r  pretrained_model_name_or_path
model_argskwargsr  s       r  r  z%TFAutoModelWithLMHead.from_pretrained  s8    I 		
 w&'D\z\U[\\r  )r  r  r  classmethodr  r  __classcell__)r  s   @r  r  r    s+    + + ] ]r  r  )R__doc__r  collectionsr   utilsr   auto_factoryr   r   r	   configuration_autor
   
get_loggerr  loggerTF_MODEL_MAPPING_NAMES&TF_MODEL_FOR_PRETRAINING_MAPPING_NAMES#TF_MODEL_WITH_LM_HEAD_MAPPING_NAMES$TF_MODEL_FOR_CAUSAL_LM_MAPPING_NAMES0TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING_NAMES/TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES9TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMES0TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES'TF_MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES$TF_MODEL_FOR_MASKED_LM_MAPPING_NAMES/TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES+TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES2TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES-TF_MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES/TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES6TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES3TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMES/TF_MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES*TF_MODEL_FOR_MULTIPLE_CHOICE_MAPPING_NAMES3TF_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING_NAMES*TF_MODEL_FOR_MASK_GENERATION_MAPPING_NAMES(TF_MODEL_FOR_TEXT_ENCODING_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  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  <module>r     s)     #  R R 4 
		H	% %FH T *5* &@ '2#%' #N (3( $0 4?004 0 3>3 /. =H 	 = 9 4?4 0 +62A+ ' (3( $8 3>3 /  /:C8/ + 6A"$6 2L 1<1 -6 3>?r>s2t /9D6:: 6 7B 	17 3 3>3 /: .9. *2 7B3?7 3 .9. *
 ,7, (. $$8:PQ #34HJp#q   01EGj k !12FHl!m -=J. * -=I- ) 7GS7 3 .>J. * %55IKr$s !!12FHl!m ,<I- ) 0@L0 , )9E) % +;G+ ' 4DP4 0 1AM1 - -=I- ) (8D( $ 1AM1 - -=I- ) (8D( $ &66JLt%u ":#6 :8!4 8&% &  ,?(; ? %6%0F% !
6 3 6 ..GR_` 30 3 ++AL_` 40 4 ++ALfg @(; @ %6%0G% !
?(; ? %6%0F% !
I0C I ->-8X- )
@)< @ &7&1H& "
72 7 --EPij 40 4 ++ALfg ?1 ? ,5. B+> B (9(3L( $
=&9 = #44S^r"s F.A F +<+*L+ 'C+> C (9('<( $?(; ? %6%0F% !
:#6 :  11MXij C+> C (9(3M( $
;"5 ; 0*X 
]2 ]r  