a
    d(                     @   s  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	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dgZeg dZedgZeg dZeddgZeg dZeg dZeg dZedgZeddgZ eg dZ!eg dZ"eg dZ#eg dZ$ed g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g d'Z,eg d(Z-eg d)Z.eg d*Z/eg d+Z0ed,gZ1e	eeZ2e	eeZ3e	eeZ4e	eeZ5e	eeZ6e	eeZ7e	ee/Z8e	eeZ9e	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ZAe	eeZBe	eeZCe	eeZDe	ee ZEe	ee!ZFe	ee#ZGe	ee$ZHe	ee%ZIe	ee(ZJe	ee)ZKe	ee*ZLe	ee+ZMe	ee,ZNe	ee"ZOe	ee-ZPe	ee.ZQe	ee0ZRe	ee1ZSG d-d. d.eZTG d/d0 d0eZUe
eUZUG d1d2 d2eZVe
eVd3d4ZVG d5d6 d6eZWe
eWd7d4ZWG d8d9 d9eZXe
eXd:d4ZXG d;d< d<eZYe
eYd=d4ZYG d>d? d?eZZe
eZd@dAdBZZG dCdD dDeZ[e
e[dEd4Z[G dFdG dGeZ\e
e\dHd4Z\G dIdJ dJeZ]e
e]dKdLdBZ]G dMdN dNeZ^e
e^dOdPdBZ^G dQdR dReZ_e
e_dSdTdBZ_G dUdV dVeZ`e
e`dWd4Z`G dXdY dYeZae
eadZd4ZaG d[d\ d\eZbe
ebd]d4ZbG d^d_ d_eZce
ecd`d4ZcG dadb dbeZde
eddcd4ZdG ddde deeZee
eedfd4ZeG dgdh dheZfe
efdid4ZfG djdk dkeZge
egdld4ZgG dmdn dneZhe
ehdod4ZhG dpdq dqeZie
eidrd4ZiG dsdt dteZje
ejdud4ZjG dvdw dweZke
ekdxd4ZkG dydz dzeZle
eld{d4ZlG d|d} d}eZme
emd~d4ZmG dd deZne
endd4ZnG dd deZoe
eodd4ZoG dd deZpe
epdd4ZpG dd deZqe
eqdd4ZqG dd deZrG dd deZse
erdd4ZrG dd deZte
etdd4ZtG dd deWZudS )z Auto Model class.    N)OrderedDict   )logging   )_BaseAutoBackboneClass_BaseAutoModelClass_LazyAutoMappingauto_class_update)CONFIG_MAPPING_NAMES))albertZAlbertModelZalignZ
AlignModelZaltclipZAltCLIPModel)audio-spectrogram-transformerZASTModel)Z
autoformerZAutoformerModel)bartZ	BartModel)beitZ	BeitModel)bertZ	BertModel)bert-generationZBertGenerationEncoder)big_birdZBigBirdModel)bigbird_pegasusZBigBirdPegasusModel)biogptZBioGptModel)bitZBitModel)
blenderbotZBlenderbotModel)blenderbot-smallZBlenderbotSmallModelblipZ	BlipModel)blip-2Z
Blip2Model)bloomZ
BloomModel)ZbridgetowerZBridgeTowerModel)	camembertZCamembertModel)canineZCanineModelZchinese_clipZChineseCLIPModel)ZclapZ	ClapModelZclipZ	CLIPModelZclipsegZCLIPSegModel)codegenZCodeGenModel)conditional_detrZConditionalDetrModel)convbertZConvBertModel)convnextZConvNextModel)
convnextv2ZConvNextV2Model)cpmantZCpmAntModel)ctrlZ	CTRLModel)cvtZCvtModel)data2vec-audioZData2VecAudioModel)data2vec-textZData2VecTextModel)data2vec-visionZData2VecVisionModel)debertaZDebertaModel)
deberta-v2ZDebertaV2Model)Zdecision_transformerZDecisionTransformerModel)deformable_detrZDeformableDetrModel)deitZ	DeiTModel)detaZ	DetaModel)detrZ	DetrModel)dinatZ
DinatModel)
distilbertZDistilBertModel)z
donut-swinZDonutSwinModel)ZdprZDPRQuestionEncoder)dptZDPTModel)efficientformerZEfficientFormerModel)efficientnetZEfficientNetModel)electraZElectraModel)ernieZ
ErnieModel)ernie_mZErnieMModel)esmZEsmModel)flaubertZFlaubertModel)flavaZ
FlavaModel)fnetZ	FNetModel)focalnetZFocalNetModel)fsmtZ	FSMTModel)funnel)ZFunnelModelZFunnelBaseModel)gitZGitModel)glpnZ	GLPNModel)gpt-sw3	GPT2Model)gpt2rE   )gpt_bigcodeZGPTBigCodeModel)gpt_neoZGPTNeoModel)gpt_neoxZGPTNeoXModel)gpt_neox_japaneseZGPTNeoXJapaneseModel)gptjZ	GPTJModelzgptsan-japaneseZ&GPTSanJapaneseForConditionalGeneration)Z
graphormerZGraphormerModel)ZgroupvitZGroupViTModel)hubertZHubertModel)ibertZ
IBertModel)imagegptZImageGPTModel)ZinformerZInformerModel)ZjukeboxZJukeboxModel)layoutlmZLayoutLMModel)
layoutlmv2ZLayoutLMv2Model)
layoutlmv3ZLayoutLMv3Model)ledZLEDModel)levitZ
LevitModel)liltZ	LiltModel)llamaZ
LlamaModel)
longformerZLongformerModel)longt5ZLongT5Model)lukeZ	LukeModel)lxmertZLxmertModel)m2m_100ZM2M100Model)marianZMarianModel)markuplmZMarkupLMModel)mask2formerZMask2FormerModel)
maskformerZMaskFormerModel)maskformer-swinZMaskFormerSwinModel)mbartZ
MBartModel)mctctZ
MCTCTModel)megaZ	MegaModel)megatron-bertZMegatronBertModel)zmgp-strZMgpstrForSceneTextRecognition)
mobilebertZMobileBertModel)mobilenet_v1ZMobileNetV1Model)mobilenet_v2ZMobileNetV2Model)	mobilevitZMobileViTModel)mobilevitv2ZMobileViTV2Model)mpnetZ
MPNetModel)mt5ZMT5Model)mvpZMvpModel)natZNatModel)nezhaZ
NezhaModel)nllb-moeZNllbMoeModel)nystromformerZNystromformerModel)	oneformerZOneFormerModel)
open-llamaZOpenLlamaModel)
openai-gptZOpenAIGPTModel)optZOPTModel)owlvitZOwlViTModel)pegasusZPegasusModel)	pegasus_xZPegasusXModel)	perceiverZPerceiverModel)plbartZPLBartModel)
poolformerZPoolFormerModel)
prophetnetZProphetNetModel)qdqbertZQDQBertModel)reformerZReformerModel)regnetZRegNetModel)rembertZRemBertModel)resnetZResNetModelZ	retribertZRetriBertModel)robertaZRobertaModel)roberta-prelayernormZRobertaPreLayerNormModel)roc_bertZRoCBertModel)roformerZRoFormerModel)rwkvZ	RwkvModelZsamZSamModel)	segformerZSegformerModel)sewZSEWModel)sew-dZ	SEWDModel)speech_to_textZSpeech2TextModel)speecht5ZSpeechT5Model)splinterZSplinterModel)squeezebertZSqueezeBertModel)swiftformerZSwiftFormerModel)swinZ	SwinModel)Zswin2srZSwin2SRModel)swinv2ZSwinv2Model)switch_transformersZSwitchTransformersModel)t5ZT5Model)table-transformerZTableTransformerModel)tapasZ
TapasModel)Ztime_series_transformerZTimeSeriesTransformerModel)timesformerZTimesformerModelZtimm_backboneZTimmBackbone)Ztrajectory_transformerZTrajectoryTransformerModel)
transfo-xlZTransfoXLModel)tvltZ	TvltModel)	unispeechZUniSpeechModel)unispeech-satZUniSpeechSatModel)vanZVanModel)videomaeZVideoMAEModel)viltZ	ViltModel)zvision-text-dual-encoderZVisionTextDualEncoderModel)visual_bertZVisualBertModel)vitZViTModel)
vit_hybridZViTHybridModel)vit_maeZViTMAEModel)vit_msnZViTMSNModel)wav2vec2ZWav2Vec2Model)wav2vec2-conformerZWav2Vec2ConformerModel)wavlmZ
WavLMModel)whisperZWhisperModel)ZxclipZ
XCLIPModel)xglmZ	XGLMModel)xlmZXLMModel)xlm-prophetnetZXLMProphetNetModel)xlm-robertaZXLMRobertaModel)xlm-roberta-xlZXLMRobertaXLModel)xlnetZ
XLNetModel)xmodZ	XmodModel)yolosZ
YolosModel)yosoZ	YosoModel);)r   ZAlbertForPreTrainingr   ZBartForConditionalGeneration)r   ZBertForPreTraining)r   ZBigBirdForPreTrainingr   ZBloomForCausalLMr   ZCamembertForMaskedLMr(   ZCTRLLMHeadModelr+   ZData2VecTextForMaskedLMr-   ZDebertaForMaskedLMr.   ZDebertaV2ForMaskedLMr4   ZDistilBertForMaskedLM)r8   ZElectraForPreTraining)r9   ZErnieForPreTrainingr<   ZFlaubertWithLMHeadModel)r=   ZFlavaForPreTraining)r>   ZFNetForPreTrainingr@   ZFSMTForConditionalGeneration)rA   ZFunnelForPreTrainingrD   GPT2LMHeadModelrF   r   rG   ZGPTBigCodeForCausalLMrL   rN   ZIBertForMaskedLMrP   ZLayoutLMForMaskedLMrW   ZLongformerForMaskedLMrY   ZLukeForMaskedLM)rZ   ZLxmertForPreTrainingrc   ZMegaForMaskedLM)rd   ZMegatronBertForPreTraining)re   ZMobileBertForPreTrainingrj   ZMPNetForMaskedLMrl   ZMvpForConditionalGeneration)rn   ZNezhaForPreTrainingro   ZNllbMoeForConditionalGenerationrs   ZOpenAIGPTLMHeadModelr   r   ZRobertaForMaskedLMr   ZRobertaPreLayerNormForMaskedLM)r   ZRoCBertForPreTrainingr   ZRwkvForCausalLM)r   ZSplinterForPreTrainingr   ZSqueezeBertForMaskedLMr   Z*SwitchTransformersForConditionalGenerationr   ZT5ForConditionalGenerationr   ZTapasForMaskedLMr   ZTransfoXLLMHeadModel)r   ZTvltForPreTraining)r   ZUniSpeechForPreTraining)r   ZUniSpeechSatForPreTraining)r   ZVideoMAEForPreTraining)r   ZVisualBertForPreTraining)r   ZViTMAEForPreTraining)r   ZWav2Vec2ForPreTraining)r   ZWav2Vec2ConformerForPreTrainingr   ZXLMWithLMHeadModelr   ZXLMRobertaForMaskedLMr   ZXLMRobertaXLForMaskedLMr   ZXLNetLMHeadModelr   ZXmodForMaskedLM)Jr   ZAlbertForMaskedLMr   r   ZBertForMaskedLMr   ZBigBirdForMaskedLMr   Z&BigBirdPegasusForConditionalGenerationr   Z'BlenderbotSmallForConditionalGenerationr   r   r"   ZCodeGenForCausalLMr$   ZConvBertForMaskedLMr'   ZCpmAntForCausalLMr   r   r   r   r   r8   ZElectraForMaskedLMzencoder-decoderZEncoderDecoderModelr9   ZErnieForMaskedLMr;   ZEsmForMaskedLMr   r>   ZFNetForMaskedLMr   rA   ZFunnelForMaskedLMrB   ZGitForCausalLMr   r   r   rH   ZGPTNeoForCausalLMrI   ZGPTNeoXForCausalLMrJ   ZGPTNeoXJapaneseForCausalLMrK   ZGPTJForCausalLMrL   r   r   rS   ZLEDForConditionalGenerationr   rX   ZLongT5ForConditionalGenerationr   r[   ZM2M100ForConditionalGenerationr\   ZMarianMTModelr   rd   ZMegatronBertForCausalLMre   ZMobileBertForMaskedLMr   r   rn   ZNezhaForMaskedLMr   rp   ZNystromformerForMaskedLMr   rw   Z PegasusXForConditionalGenerationry   ZPLBartForConditionalGenerationr|   ZQDQBertForMaskedLMr}   ZReformerModelWithLMHeadr   ZRemBertForMaskedLMr   r   r   ZRoCBertForMaskedLMr   ZRoFormerForMaskedLMr   r   Z#Speech2TextForConditionalGenerationr   r   r   r   r   r   ZWav2Vec2ForMaskedLMr   ZWhisperForConditionalGenerationr   r   r   r   r   r   ZYosoForMaskedLM)6)r   ZBartForCausalLM)r   ZBertLMHeadModel)r   ZBertGenerationDecoder)r   ZBigBirdForCausalLM)r   ZBigBirdPegasusForCausalLM)r   ZBioGptForCausalLM)r   ZBlenderbotForCausalLM)r   ZBlenderbotSmallForCausalLMr   )r   ZCamembertForCausalLMr   r   r   )r+   ZData2VecTextForCausalLM)r8   ZElectraForCausalLM)r9   ZErnieForCausalLMr   r   r   r   r   r   r   r   )rV   ZLlamaForCausalLM)r\   ZMarianForCausalLM)ra   ZMBartForCausalLM)rc   ZMegaForCausalLMr   )rl   ZMvpForCausalLM)rr   ZOpenLlamaForCausalLMr   )rt   ZOPTForCausalLM)rv   ZPegasusForCausalLM)ry   ZPLBartForCausalLM)r{   ZProphetNetForCausalLM)r|   ZQDQBertLMHeadModelr   )r   ZRemBertForCausalLM)r   ZRobertaForCausalLM)r   ZRobertaPreLayerNormForCausalLM)r   ZRoCBertForCausalLM)r   ZRoFormerForCausalLMr   )Zspeech_to_text_2ZSpeech2Text2ForCausalLMr   )ZtrocrZTrOCRForCausalLM)r   ZXGLMForCausalLMr   )r   ZXLMProphetNetForCausalLM)r   ZXLMRobertaForCausalLM)r   ZXLMRobertaXLForCausalLMr   )r   ZXmodForCausalLM))r0   ZDeiTForMaskedImageModeling)r?   ZFocalNetForMaskedImageModeling)r   ZSwinForMaskedImageModeling)r   ZSwinv2ForMaskedImageModeling)r   ZViTForMaskedImageModeling)rO   ZImageGPTForCausalImageModeling))r   ZBeitForImageClassification)r   ZBitForImageClassification)r%   ZConvNextForImageClassification)r&   Z ConvNextV2ForImageClassification)r)   ZCvtForImageClassification)r,   Z$Data2VecVisionForImageClassification)r0   )ZDeiTForImageClassificationZ%DeiTForImageClassificationWithTeacher)r3   ZDinatForImageClassification)r6   )Z%EfficientFormerForImageClassificationZ0EfficientFormerForImageClassificationWithTeacher)r7   Z"EfficientNetForImageClassification)r?   ZFocalNetForImageClassification)rO   ZImageGPTForImageClassification)rT   )ZLevitForImageClassificationZ&LevitForImageClassificationWithTeacher)rf   Z!MobileNetV1ForImageClassification)rg   Z!MobileNetV2ForImageClassification)rh   ZMobileViTForImageClassification)ri   Z!MobileViTV2ForImageClassification)rm   ZNatForImageClassification)rx   )Z&PerceiverForImageClassificationLearnedZ&PerceiverForImageClassificationFourierZ-PerceiverForImageClassificationConvProcessing)rz   Z PoolFormerForImageClassification)r~   ZRegNetForImageClassification)r   ZResNetForImageClassification)r   ZSegformerForImageClassification)r   Z!SwiftFormerForImageClassification)r   ZSwinForImageClassification)r   ZSwinv2ForImageClassification)r   ZVanForImageClassification)r   ZViTForImageClassification)r   ZViTHybridForImageClassification)r   ZViTMSNForImageClassificationr2   ZDetrForSegmentation))r   ZBeitForSemanticSegmentation)r,   Z%Data2VecVisionForSemanticSegmentation)r5   ZDPTForSemanticSegmentation)rg   Z"MobileNetV2ForSemanticSegmentation)rh   Z MobileViTForSemanticSegmentation)ri   Z"MobileViTV2ForSemanticSegmentation)r   Z SegformerForSemanticSegmentation)ZupernetZUperNetForSemanticSegmentationr_   Z!MaskFormerForInstanceSegmentation)r   )r^   Z#Mask2FormerForUniversalSegmentationr   )rq   Z!OneFormerForUniversalSegmentation)r   Z!TimesformerForVideoClassification)r   ZVideoMAEForVideoClassification))r   ZBlipForConditionalGeneration)r   ZBlip2ForConditionalGenerationr   )Z
pix2structZ"Pix2StructForConditionalGeneration)zvision-encoder-decoderZVisionEncoderDecoderModel),r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ra   ZMBartForConditionalGenerationr   )rd   ZMegatronBertForMaskedLMr   r   r   r   r   )rx   ZPerceiverForMaskedLMr   )r}   ZReformerForMaskedLMr   r   r   r   r   r   r   r   r   r   r   r   r   ))r#   Z!ConditionalDetrForObjectDetection)r/   Z DeformableDetrForObjectDetection)r1   ZDetaForObjectDetection)r2   ZDetrForObjectDetection)r   Z"TableTransformerForObjectDetection)r   ZYolosForObjectDetection)ru   ZOwlViTForObjectDetection)r5   ZDPTForDepthEstimation)rC   ZGLPNForDepthEstimation)r   r   )r   Z"BlenderbotForConditionalGenerationr   r   r   rL   r   r   r   r   r   )rk   ZMT5ForConditionalGenerationr   r   )rv   ZPegasusForConditionalGenerationr   r   )r{   Z"ProphetNetForConditionalGenerationr   r   )r   Z%XLMProphetNetForConditionalGeneration))zspeech-encoder-decoderZSpeechEncoderDecoderModelr   )r   ZSpeechT5ForSpeechToTextr   )C)r   ZAlbertForSequenceClassification)r   ZBartForSequenceClassification)r   ZBertForSequenceClassification)r   Z BigBirdForSequenceClassification)r   Z'BigBirdPegasusForSequenceClassification)r   ZBioGptForSequenceClassification)r   ZBloomForSequenceClassification)r   Z"CamembertForSequenceClassification)r   ZCanineForSequenceClassification)r$   Z!ConvBertForSequenceClassification)r(   ZCTRLForSequenceClassification)r+   Z%Data2VecTextForSequenceClassification)r-   Z DebertaForSequenceClassification)r.   Z"DebertaV2ForSequenceClassification)r4   Z#DistilBertForSequenceClassification)r8   Z ElectraForSequenceClassification)r9   ZErnieForSequenceClassification)r:   ZErnieMForSequenceClassification)r;   ZEsmForSequenceClassification)r<   Z!FlaubertForSequenceClassification)r>   ZFNetForSequenceClassification)rA   ZFunnelForSequenceClassification)rD   GPT2ForSequenceClassification)rF   r   )rG   Z#GPTBigCodeForSequenceClassification)rH   ZGPTNeoForSequenceClassification)rI   Z GPTNeoXForSequenceClassification)rK   ZGPTJForSequenceClassification)rN   ZIBertForSequenceClassification)rP   Z!LayoutLMForSequenceClassification)rQ   Z#LayoutLMv2ForSequenceClassification)rR   Z#LayoutLMv3ForSequenceClassification)rS   ZLEDForSequenceClassification)rU   ZLiltForSequenceClassification)rV   ZLlamaForSequenceClassification)rW   Z#LongformerForSequenceClassification)rY   ZLukeForSequenceClassification)r]   Z!MarkupLMForSequenceClassification)ra   ZMBartForSequenceClassification)rc   ZMegaForSequenceClassification)rd   Z%MegatronBertForSequenceClassification)re   Z#MobileBertForSequenceClassification)rj   ZMPNetForSequenceClassification)rl   ZMvpForSequenceClassification)rn   ZNezhaForSequenceClassification)rp   Z&NystromformerForSequenceClassification)rr   Z"OpenLlamaForSequenceClassification)rs   Z"OpenAIGPTForSequenceClassification)rt   ZOPTForSequenceClassification)rx   Z"PerceiverForSequenceClassification)ry   ZPLBartForSequenceClassification)r|   Z QDQBertForSequenceClassification)r}   Z!ReformerForSequenceClassification)r   Z RemBertForSequenceClassification)r   Z RobertaForSequenceClassification)r   Z,RobertaPreLayerNormForSequenceClassification)r   Z RoCBertForSequenceClassification)r   Z!RoFormerForSequenceClassification)r   Z$SqueezeBertForSequenceClassification)r   ZTapasForSequenceClassification)r   Z"TransfoXLForSequenceClassification)r   ZXLMForSequenceClassification)r   Z#XLMRobertaForSequenceClassification)r   Z%XLMRobertaXLForSequenceClassification)r   ZXLNetForSequenceClassification)r   ZXmodForSequenceClassification)r   ZYosoForSequenceClassification)8)r   ZAlbertForQuestionAnswering)r   ZBartForQuestionAnswering)r   ZBertForQuestionAnswering)r   ZBigBirdForQuestionAnswering)r   Z"BigBirdPegasusForQuestionAnswering)r   ZBloomForQuestionAnswering)r   ZCamembertForQuestionAnswering)r   ZCanineForQuestionAnswering)r$   ZConvBertForQuestionAnswering)r+   Z Data2VecTextForQuestionAnswering)r-   ZDebertaForQuestionAnswering)r.   ZDebertaV2ForQuestionAnswering)r4   ZDistilBertForQuestionAnswering)r8   ZElectraForQuestionAnswering)r9   ZErnieForQuestionAnswering)r:   ZErnieMForQuestionAnswering)r<   Z"FlaubertForQuestionAnsweringSimple)r>   ZFNetForQuestionAnswering)rA   ZFunnelForQuestionAnswering)rF   ZGPT2ForQuestionAnswering)rH   ZGPTNeoForQuestionAnswering)rI   ZGPTNeoXForQuestionAnswering)rK   ZGPTJForQuestionAnswering)rN   ZIBertForQuestionAnsweringrQ   ZLayoutLMv2ForQuestionAnsweringrR   ZLayoutLMv3ForQuestionAnswering)rS   ZLEDForQuestionAnswering)rU   ZLiltForQuestionAnswering)rW   ZLongformerForQuestionAnswering)rY   ZLukeForQuestionAnswering)rZ   ZLxmertForQuestionAnswering)r]   ZMarkupLMForQuestionAnswering)ra   ZMBartForQuestionAnswering)rc   ZMegaForQuestionAnswering)rd   Z MegatronBertForQuestionAnswering)re   ZMobileBertForQuestionAnswering)rj   ZMPNetForQuestionAnswering)rl   ZMvpForQuestionAnswering)rn   ZNezhaForQuestionAnswering)rp   Z!NystromformerForQuestionAnswering)rt   ZOPTForQuestionAnswering)r|   ZQDQBertForQuestionAnswering)r}   ZReformerForQuestionAnswering)r   ZRemBertForQuestionAnswering)r   ZRobertaForQuestionAnswering)r   Z'RobertaPreLayerNormForQuestionAnswering)r   ZRoCBertForQuestionAnswering)r   ZRoFormerForQuestionAnswering)r   ZSplinterForQuestionAnswering)r   ZSqueezeBertForQuestionAnswering)r   ZXLMForQuestionAnsweringSimple)r   ZXLMRobertaForQuestionAnswering)r   Z XLMRobertaXLForQuestionAnswering)r   ZXLNetForQuestionAnsweringSimple)r   ZXmodForQuestionAnswering)r   ZYosoForQuestionAnswering)r   ZTapasForQuestionAnswering)r   ZViltForQuestionAnswering))rP   ZLayoutLMForQuestionAnsweringr   r   )3)r   ZAlbertForTokenClassification)r   ZBertForTokenClassification)r   ZBigBirdForTokenClassification)r   ZBioGptForTokenClassification)r   ZBloomForTokenClassification)r   ZCamembertForTokenClassification)r   ZCanineForTokenClassification)r$   ZConvBertForTokenClassification)r+   Z"Data2VecTextForTokenClassification)r-   ZDebertaForTokenClassification)r.   ZDebertaV2ForTokenClassification)r4   Z DistilBertForTokenClassification)r8   ZElectraForTokenClassification)r9   ZErnieForTokenClassification)r:   ZErnieMForTokenClassification)r;   ZEsmForTokenClassification)r<   ZFlaubertForTokenClassification)r>   ZFNetForTokenClassification)rA   ZFunnelForTokenClassification)rD   GPT2ForTokenClassification)rF   r  )rG   Z GPTBigCodeForTokenClassification)rH   ZGPTNeoForTokenClassification)rI   ZGPTNeoXForTokenClassification)rN   ZIBertForTokenClassification)rP   ZLayoutLMForTokenClassification)rQ   Z LayoutLMv2ForTokenClassification)rR   Z LayoutLMv3ForTokenClassification)rU   ZLiltForTokenClassification)rW   Z LongformerForTokenClassification)rY   ZLukeForTokenClassification)r]   ZMarkupLMForTokenClassification)rc   ZMegaForTokenClassification)rd   Z"MegatronBertForTokenClassification)re   Z MobileBertForTokenClassification)rj   ZMPNetForTokenClassification)rn   ZNezhaForTokenClassification)rp   Z#NystromformerForTokenClassification)r|   ZQDQBertForTokenClassification)r   ZRemBertForTokenClassification)r   ZRobertaForTokenClassification)r   Z)RobertaPreLayerNormForTokenClassification)r   ZRoCBertForTokenClassification)r   ZRoFormerForTokenClassification)r   Z!SqueezeBertForTokenClassification)r   ZXLMForTokenClassification)r   Z XLMRobertaForTokenClassification)r   Z"XLMRobertaXLForTokenClassification)r   ZXLNetForTokenClassification)r   ZXmodForTokenClassification)r   ZYosoForTokenClassification)%)r   ZAlbertForMultipleChoice)r   ZBertForMultipleChoice)r   ZBigBirdForMultipleChoice)r   ZCamembertForMultipleChoice)r   ZCanineForMultipleChoice)r$   ZConvBertForMultipleChoice)r+   ZData2VecTextForMultipleChoice)r.   ZDebertaV2ForMultipleChoice)r4   ZDistilBertForMultipleChoice)r8   ZElectraForMultipleChoice)r9   ZErnieForMultipleChoice)r:   ZErnieMForMultipleChoice)r<   ZFlaubertForMultipleChoice)r>   ZFNetForMultipleChoice)rA   ZFunnelForMultipleChoice)rN   ZIBertForMultipleChoice)rW   ZLongformerForMultipleChoice)rY   ZLukeForMultipleChoice)rc   ZMegaForMultipleChoice)rd   ZMegatronBertForMultipleChoice)re   ZMobileBertForMultipleChoice)rj   ZMPNetForMultipleChoice)rn   ZNezhaForMultipleChoice)rp   ZNystromformerForMultipleChoice)r|   ZQDQBertForMultipleChoice)r   ZRemBertForMultipleChoice)r   ZRobertaForMultipleChoice)r   Z$RobertaPreLayerNormForMultipleChoice)r   ZRoCBertForMultipleChoice)r   ZRoFormerForMultipleChoice)r   ZSqueezeBertForMultipleChoice)r   ZXLMForMultipleChoice)r   ZXLMRobertaForMultipleChoice)r   ZXLMRobertaXLForMultipleChoice)r   ZXLNetForMultipleChoice)r   ZXmodForMultipleChoice)r   ZYosoForMultipleChoice))r   ZBertForNextSentencePrediction)r9   ZErnieForNextSentencePrediction)r>   ZFNetForNextSentencePrediction)rd   Z%MegatronBertForNextSentencePrediction)re   Z#MobileBertForNextSentencePrediction)rn   ZNezhaForNextSentencePrediction)r|   Z QDQBertForNextSentencePrediction))r   ZASTForAudioClassification)r*   Z&Data2VecAudioForSequenceClassification)rM   ZHubertForSequenceClassification)r   ZSEWForSequenceClassification)r   ZSEWDForSequenceClassification)r   Z"UniSpeechForSequenceClassification)r   Z%UniSpeechSatForSequenceClassification)r   Z!Wav2Vec2ForSequenceClassification)r   Z*Wav2Vec2ConformerForSequenceClassification)r   ZWavLMForSequenceClassification)r   ZWhisperForAudioClassification)
)r*   ZData2VecAudioForCTC)rM   ZHubertForCTC)rb   ZMCTCTForCTC)r   Z	SEWForCTC)r   Z
SEWDForCTC)r   ZUniSpeechForCTC)r   ZUniSpeechSatForCTC)r   ZWav2Vec2ForCTC)r   ZWav2Vec2ConformerForCTC)r   ZWavLMForCTC))r*   Z(Data2VecAudioForAudioFrameClassification)r   Z'UniSpeechSatForAudioFrameClassification)r   Z#Wav2Vec2ForAudioFrameClassification)r   Z,Wav2Vec2ConformerForAudioFrameClassification)r   Z WavLMForAudioFrameClassification))r*   ZData2VecAudioForXVector)r   ZUniSpeechSatForXVector)r   ZWav2Vec2ForXVector)r   ZWav2Vec2ConformerForXVector)r   ZWavLMForXVector)r   r   r   r   r    r!   )
)r   ZBitBackbone)r%   ZConvNextBackbone)r&   ZConvNextV2Backbone)r3   ZDinatBackbone)r?   ZFocalNetBackbone)r`   ZMaskFormerSwinBackbone)rm   ZNatBackbone)r   ZResNetBackbone)r   ZSwinBackboner   r   c                   @   s   e Zd ZeZdS )AutoModelForMaskGenerationN)__name__
__module____qualname__!MODEL_FOR_MASK_GENERATION_MAPPING_model_mapping r  r  o/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/transformers/models/auto/modeling_auto.pyr  C  s   r  c                   @   s   e Zd ZeZdS )	AutoModelN)r  r  r  MODEL_MAPPINGr  r  r  r  r	  r
  G  s   r
  c                   @   s   e Zd ZeZdS )AutoModelForPreTrainingN)r  r  r  MODEL_FOR_PRETRAINING_MAPPINGr  r  r  r  r	  r  N  s   r  Zpretraining)head_docc                   @   s   e Zd ZeZdS )_AutoModelWithLMHeadN)r  r  r  MODEL_WITH_LM_HEAD_MAPPINGr  r  r  r  r	  r  V  s   r  zlanguage modelingc                   @   s   e Zd ZeZdS )AutoModelForCausalLMN)r  r  r  MODEL_FOR_CAUSAL_LM_MAPPINGr  r  r  r  r	  r  ]  s   r  zcausal language modelingc                   @   s   e Zd ZeZdS )AutoModelForMaskedLMN)r  r  r  MODEL_FOR_MASKED_LM_MAPPINGr  r  r  r  r	  r  d  s   r  zmasked language modelingc                   @   s   e Zd ZeZdS )AutoModelForSeq2SeqLMN)r  r  r  &MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPINGr  r  r  r  r	  r  k  s   r  z&sequence-to-sequence language modelingzt5-base)r  Zcheckpoint_for_examplec                   @   s   e Zd ZeZdS )"AutoModelForSequenceClassificationN)r  r  r  )MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPINGr  r  r  r  r	  r  t  s   r  zsequence classificationc                   @   s   e Zd ZeZdS )AutoModelForQuestionAnsweringN)r  r  r  $MODEL_FOR_QUESTION_ANSWERING_MAPPINGr  r  r  r  r	  r  }  s   r  zquestion answeringc                   @   s   e Zd ZeZdS )"AutoModelForTableQuestionAnsweringN)r  r  r  *MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPINGr  r  r  r  r	  r    s   r  ztable question answeringzgoogle/tapas-base-finetuned-wtqc                   @   s   e Zd ZeZdS )#AutoModelForVisualQuestionAnsweringN)r  r  r  +MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPINGr  r  r  r  r	  r    s   r  zvisual question answeringzdandelin/vilt-b32-finetuned-vqac                   @   s   e Zd ZeZdS )%AutoModelForDocumentQuestionAnsweringN)r  r  r  -MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPINGr  r  r  r  r	  r    s   r  zdocument question answeringz/impira/layoutlm-document-qa", revision="52e01b3c                   @   s   e Zd ZeZdS )AutoModelForTokenClassificationN)r  r  r  &MODEL_FOR_TOKEN_CLASSIFICATION_MAPPINGr  r  r  r  r	  r!    s   r!  ztoken classificationc                   @   s   e Zd ZeZdS )AutoModelForMultipleChoiceN)r  r  r  !MODEL_FOR_MULTIPLE_CHOICE_MAPPINGr  r  r  r  r	  r#    s   r#  zmultiple choicec                   @   s   e Zd ZeZdS )"AutoModelForNextSentencePredictionN)r  r  r  *MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPINGr  r  r  r  r	  r%    s   r%  znext sentence predictionc                   @   s   e Zd ZeZdS )AutoModelForImageClassificationN)r  r  r  &MODEL_FOR_IMAGE_CLASSIFICATION_MAPPINGr  r  r  r  r	  r'    s   r'  zimage classificationc                   @   s   e Zd ZeZdS )'AutoModelForZeroShotImageClassificationN)r  r  r  0MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPINGr  r  r  r  r	  r)    s   r)  zzero-shot image classificationc                   @   s   e Zd ZeZdS )AutoModelForImageSegmentationN)r  r  r  $MODEL_FOR_IMAGE_SEGMENTATION_MAPPINGr  r  r  r  r	  r+    s   r+  zimage segmentationc                   @   s   e Zd ZeZdS ) AutoModelForSemanticSegmentationN)r  r  r  'MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPINGr  r  r  r  r	  r-    s   r-  zsemantic segmentationc                   @   s   e Zd ZeZdS )!AutoModelForUniversalSegmentationN)r  r  r  (MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPINGr  r  r  r  r	  r/    s   r/  zuniversal image segmentationc                   @   s   e Zd ZeZdS ) AutoModelForInstanceSegmentationN)r  r  r  'MODEL_FOR_INSTANCE_SEGMENTATION_MAPPINGr  r  r  r  r	  r1    s   r1  zinstance segmentationc                   @   s   e Zd ZeZdS )AutoModelForObjectDetectionN)r  r  r  "MODEL_FOR_OBJECT_DETECTION_MAPPINGr  r  r  r  r	  r3    s   r3  zobject detectionc                   @   s   e Zd ZeZdS )#AutoModelForZeroShotObjectDetectionN)r  r  r  ,MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPINGr  r  r  r  r	  r5    s   r5  zzero-shot object detectionc                   @   s   e Zd ZeZdS )AutoModelForDepthEstimationN)r  r  r  "MODEL_FOR_DEPTH_ESTIMATION_MAPPINGr  r  r  r  r	  r7    s   r7  zdepth estimationc                   @   s   e Zd ZeZdS )AutoModelForVideoClassificationN)r  r  r  &MODEL_FOR_VIDEO_CLASSIFICATION_MAPPINGr  r  r  r  r	  r9    s   r9  zvideo classificationc                   @   s   e Zd ZeZdS )AutoModelForVision2SeqN)r  r  r  MODEL_FOR_VISION_2_SEQ_MAPPINGr  r  r  r  r	  r;    s   r;  zvision-to-text modelingc                   @   s   e Zd ZeZdS )AutoModelForAudioClassificationN)r  r  r  &MODEL_FOR_AUDIO_CLASSIFICATION_MAPPINGr  r  r  r  r	  r=    s   r=  zaudio classificationc                   @   s   e Zd ZeZdS )AutoModelForCTCN)r  r  r  MODEL_FOR_CTC_MAPPINGr  r  r  r  r	  r?    s   r?  z%connectionist temporal classificationc                   @   s   e Zd ZeZdS )AutoModelForSpeechSeq2SeqN)r  r  r  "MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPINGr  r  r  r  r	  rA  !  s   rA  z,sequence-to-sequence speech-to-text modelingc                   @   s   e Zd ZeZdS )$AutoModelForAudioFrameClassificationN)r  r  r  ,MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPINGr  r  r  r  r	  rC  *  s   rC  z"audio frame (token) classificationc                   @   s   e Zd ZeZdS )AutoModelForAudioXVectorN)r  r  r  MODEL_FOR_AUDIO_XVECTOR_MAPPINGr  r  r  r  r	  rE  3  s   rE  c                   @   s   e Zd ZeZdS )AutoBackboneN)r  r  r  MODEL_FOR_BACKBONE_MAPPINGr  r  r  r  r	  rG  7  s   rG  zaudio retrieval via x-vectorc                   @   s   e Zd ZeZdS )AutoModelForMaskedImageModelingN)r  r  r  'MODEL_FOR_MASKED_IMAGE_MODELING_MAPPINGr  r  r  r  r	  rI  >  s   rI  zmasked image modelingc                       s0   e Zd Ze fddZe fddZ  ZS )AutoModelWithLMHeadc                    s   t dt t |S NzThe class `AutoModelWithLMHead` is deprecated and will be removed in a future version. Please use `AutoModelForCausalLM` for causal language models, `AutoModelForMaskedLM` for masked language models and `AutoModelForSeq2SeqLM` for encoder-decoder models.)warningswarnFutureWarningsuperfrom_config)clsconfig	__class__r  r	  rQ  F  s
    zAutoModelWithLMHead.from_configc                    s&   t dt t j|g|R i |S rL  )rM  rN  rO  rP  from_pretrained)rR  Zpretrained_model_name_or_pathZ
model_argskwargsrT  r  r	  rV  P  s
    z#AutoModelWithLMHead.from_pretrained)r  r  r  classmethodrQ  rV  __classcell__r  r  rT  r	  rK  E  s   	rK  )v__doc__rM  collectionsr   utilsr   Zauto_factoryr   r   r   r	   Zconfiguration_autor
   Z
get_loggerr  loggerZMODEL_MAPPING_NAMESZ#MODEL_FOR_PRETRAINING_MAPPING_NAMESZ MODEL_WITH_LM_HEAD_MAPPING_NAMESZ!MODEL_FOR_CAUSAL_LM_MAPPING_NAMESZ-MODEL_FOR_MASKED_IMAGE_MODELING_MAPPING_NAMESZ-MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPING_NAMESZ,MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMESZ*MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMESZ-MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMESZ-MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING_NAMESZ.MODEL_FOR_UNIVERSAL_SEGMENTATION_MAPPING_NAMESZ,MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING_NAMESZ$MODEL_FOR_VISION_2_SEQ_MAPPING_NAMESZ!MODEL_FOR_MASKED_LM_MAPPING_NAMESZ(MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMESZ2MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMESZ(MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMESZ,MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMESZ(MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMESZ/MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMESZ*MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMESZ0MODEL_FOR_TABLE_QUESTION_ANSWERING_MAPPING_NAMESZ1MODEL_FOR_VISUAL_QUESTION_ANSWERING_MAPPING_NAMESZ3MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMESZ,MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMESZ'MODEL_FOR_MULTIPLE_CHOICE_MAPPING_NAMESZ0MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING_NAMESZ,MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMESZMODEL_FOR_CTC_MAPPING_NAMESZ2MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMESZ%MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMESZ6MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMESZ MODEL_FOR_BACKBONE_MAPPING_NAMESZ'MODEL_FOR_MASK_GENERATION_MAPPING_NAMESr  r  r  r  Z'MODEL_FOR_CAUSAL_IMAGE_MODELING_MAPPINGr(  r*  r,  r.  r2  r0  r:  r<  r  r   r  rJ  r4  r6  r8  r  r  r  r  r"  r$  r&  r>  r@  rB  rD  rF  rH  r  r  r
  r  r  r  r  r  r  r  r  r  r  r!  r#  r%  r'  r)  r+  r-  r/  r1  r3  r5  r7  r9  r;  r=  r?  rA  rC  rE  rG  rI  rK  r  r  r  r	  <module>   sF  
 ;AP<1

2	I>9+













