
     `iiv                     F	   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@          ZQg dkZRdS )lzAuto Model class.    N)OrderedDict   )logging   )_BaseAutoModelClass_LazyAutoMappingauto_class_update)CONFIG_MAPPING_NAMES)E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)sam_vision_modelTFSamVisionModel)	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   TFLayoutLMForQuestionAnsweringrB  )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dS )TFAutoModelForMaskGenerationN)__name__
__module____qualname__$TF_MODEL_FOR_MASK_GENERATION_MAPPING_model_mapping     }/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/transformers/models/auto/modeling_tf_auto.pyr  r            9NNNr  r  c                       e Zd ZeZdS )TFAutoModelForTextEncodingN)r  r  r  "TF_MODEL_FOR_TEXT_ENCODING_MAPPINGr  r  r  r  r  r    s        7NNNr  r  c                       e Zd ZeZdS )TFAutoModelN)r  r  r  TF_MODEL_MAPPINGr  r  r  r  r  r    s        %NNNr  r  c                       e Zd ZeZdS )!TFAutoModelForAudioClassificationN)r  r  r  )TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPINGr  r  r  r  r  r  !          >NNNr  r  zaudio classification)head_docc                       e Zd ZeZdS )TFAutoModelForPreTrainingN)r  r  r   TF_MODEL_FOR_PRETRAINING_MAPPINGr  r  r  r  r  r  *  s        5NNNr  r  pretrainingc                       e Zd ZeZdS )_TFAutoModelWithLMHeadN)r  r  r  TF_MODEL_WITH_LM_HEAD_MAPPINGr  r  r  r  r  r  2  s        2NNNr  r  zlanguage modelingc                       e Zd ZeZdS )TFAutoModelForCausalLMN)r  r  r  TF_MODEL_FOR_CAUSAL_LM_MAPPINGr  r  r  r  r  r  9          3NNNr  r  zcausal language modelingc                       e Zd ZeZdS )!TFAutoModelForMaskedImageModelingN)r  r  r  *TF_MODEL_FOR_MASKED_IMAGE_MODELING_MAPPINGr  r  r  r  r  r  @          ?NNNr  r  zmasked image modelingc                       e Zd ZeZdS )!TFAutoModelForImageClassificationN)r  r  r  )TF_MODEL_FOR_IMAGE_CLASSIFICATION_MAPPINGr  r  r  r  r  r  I  r  r  r  zimage classificationc                       e Zd ZeZdS ))TFAutoModelForZeroShotImageClassificationN)r  r  r  3TF_MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPINGr  r  r  r  r  r  R  s        HNNNr  r  zzero-shot image classificationc                       e Zd ZeZdS )"TFAutoModelForSemanticSegmentationN)r  r  r  *TF_MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPINGr  r  r  r  r  r  [  r  r  r  zsemantic segmentationc                       e Zd ZeZdS )TFAutoModelForVision2SeqN)r  r  r  !TF_MODEL_FOR_VISION_2_SEQ_MAPPINGr  r  r  r  r  r  d  s        6NNNr  r  zvision-to-text modelingc                       e Zd ZeZdS )TFAutoModelForMaskedLMN)r  r  r  TF_MODEL_FOR_MASKED_LM_MAPPINGr  r  r  r  r  r  k  r  r  r  zmasked language modelingc                       e Zd ZeZdS )TFAutoModelForSeq2SeqLMN)r  r  r  )TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPINGr  r  r  r  r  r  r  r  r  r  z&sequence-to-sequence language modelingzgoogle-t5/t5-base)r  checkpoint_for_examplec                       e Zd ZeZdS )$TFAutoModelForSequenceClassificationN)r  r  r  ,TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPINGr  r  r  r  r  r  }  s        ANNNr  r  zsequence classificationc                       e Zd ZeZdS )TFAutoModelForQuestionAnsweringN)r  r  r  'TF_MODEL_FOR_QUESTION_ANSWERING_MAPPINGr  r  r  r  r  r    s        <NNNr  r  zquestion answeringc                       e Zd ZeZdS )'TFAutoModelForDocumentQuestionAnsweringN)r  r  r  0TF_MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPINGr  r  r  r  r  r    s        ENNNr  r  zdocument question answeringz/impira/layoutlm-document-qa", revision="52e01b3c                       e Zd ZeZdS )$TFAutoModelForTableQuestionAnsweringN)r  r  r  -TF_MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPINGr  r  r  r  r  r            BNNNr  r  ztable question answeringzgoogle/tapas-base-finetuned-wtqc                       e Zd ZeZdS )!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dS )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dS )$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dS )TFAutoModelForSpeechSeq2SeqN)r  r  r  %TF_MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPINGr  r  r  r  r  r    s        :NNNr  r  z,sequence-to-sequence speech-to-text modelingc                   H     e Zd Ze fd            Ze fd            Z xZS )TFAutoModelWithLMHeadc                 z    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 		
 	
 	
 ww""6***r  c                 r    t          j        dt                      t                      j        |g|R 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  sM    I 		
 	
 	
 'uww&'D\z\\\U[\\\r  )r  r  r  classmethodr  r  __classcell__)r  s   @r  r  r    sp        + + + + [+ ] ] ] ] [] ] ] ] ]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  )S__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  __all__r  r  r  <module>r     s      # # # # # #       R R R R R R R R R R 4 4 4 4 4 4 
	H	%	% %G G GI I V *5  * * &@ '2k# # #%' %' #N (3{  ( ( $0 4?;004 4 0 3>+  3 3 /. =HK 	 = = 9 4?;  4 4 0 +6+2A+ + ' (3{  ( ( $8 3>+  3 3 /  /:kC8/ / + 6A[" " "$6 $6 2L 1<  1 1 -6 3>+?r>s2t2t /9D6:: : 6 7Bk 	17 7 3 3>+  3 3 /: .9[  . . *2 7Bk3?7 7 3 .9[. . *
 ,7;  , , (. $#$8:PQQ #3#34HJp#q#q   0 01EGj k k !1!12FHl!m!m -=-=J. . * -=,<I- - ) 7G6FS7 7 3 .>-=J. . * %5$45IKr$s$s !!1!12FHl!m!m ,<,<I- - ) 0@/?L0 0 , )9(8E) ) % +;*:G+ + ' 4D3CP4 4 0 1A0@M1 1 - -=,<I- - ) (8'7D( ( $ 1A0@M1 1 - -=,<I- - ) (8'7D( ( $ &6%56JLt%u%u ": : : : :#6 : : :8 8 8 8 8!4 8 8 8& & & & &% & & &  ,,? ? ? ? ?(; ? ? ? %6$5%0F% % % !
6 6 6 6 6 3 6 6 6 .-.GR_``` 3 3 3 3 30 3 3 3 +*+AL_``` 4 4 4 4 40 4 4 4 +*+ALfggg @ @ @ @ @(; @ @ @ %6$5%0G% % % !
? ? ? ? ?(; ? ? ? %6$5%0F% % % !
I I I I I0C I I I ->,=-8X- - - )
@ @ @ @ @)< @ @ @ &7%6&1H& & & "
7 7 7 7 72 7 7 7 -,-EPijjj 4 4 4 4 40 4 4 4 +*+ALfggg ? ? ? ? ?1 ? ? ? ,+5.   B B B B B+> B B B (9'8(3L( ( ( $
= = = = =&9 = = = #4"34S^r"s"s"s F F F F F.A F F F +<*;+*L+ + + 'C C C C C+> C C C (9'8('<( ( ( $? ? ? ? ?(; ? ? ? %6$5%0F% % % !
: : : : :#6 : : :  101MXijjj C C C C C+> C C C (9'8(3M( ( ( $
; ; ; ; ;"5 ; ; ; 0/*X   
] ] ] ] ]2 ] ] ],- - -r  