U
    ,-e                     @   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d	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddgăZeddddddddddddddddddddddTdddddddddddddddddddddddddddddddd ddddddddg>Zed	dΐd
dddddҐddddddddאdddddڐddݐddddddddddTdddddddddd d!ddddd"dd#dd$d%d&d'd(d)ddd*d+dd,dddddd-d.dddddd/gMZed0d1d2d3d4d5d6d7dѐd8d9dddӐd:d;d<d=ddddddddd>d?d@dAd dBddCdDdEddFdGdHdIdJdKd(dLdMdNdOdPddQddRdSddTdUdVddWg<ZedXdYdZd[d\gZed]gZed^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}g Zed~gZeddddddddgZedgZed~dddgZedddgZeddddddgZed	dΐd
ddҐdddddאddddڐdddddddddd!dddd"d#dd'dd)ddd*d+ddd-ddddd/g-ZeddddddgZedgZeddgZ edΐddddddTdddddddddd$d%dddddgZ!ed&dd,dd.gZ"edddddddddddddddddddddddddddddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdېdܐdݐdސdߐdddddddddddddddddddgLZ#edddddddddddddd ddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g>Z$ed1gZ%edd2gZ&ed3ddgZ'ed4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjg7Z(edkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddg&Z)edddddddgZ*edddddddddddgZ+eddddddddddg
Z,edddddgZ-edddddgZ.edgZ/edddgZ0ed
ddd d"d#gZ1eddddddddddddgZ2edgZ3ed	ddd.d0d1d9d?dEdXdddtddddddddddŐddddgZ4edgZ5e	eeZ6e	eeZ7e	eeZ8e	eeZ9e	eeZ:e	eeZ;e	ee1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e,ZRe	ee"ZSe	ee-ZTe	ee.ZUe	ee/ZVe	ee0ZWe	ee2ZXe	ee3ZYe	ee4ZZe	ee5Z[G dȐdɄ deZ\G dʐd˄ deZ]G d̐d̈́ deZ^G dΐdτ deZ_e
e_Z_G dАdф deZ`e
e`dҐdӍZ`G dԐdՄ deZae
ead֐dӍZaG dאd؄ deZbe
ebdِdӍZbG dڐdۄ deZce
ecdܐdӍZcG dݐdބ deZde
eddߐddZdG dd deZee
eeddӍZeG dd deZfe
efddӍZfG dd deZge
egdddZgG dd deZhe
ehdddZhG dd deZie
eidddZiG dd deZje
ejddӍZjG dd deZke
ekddӍZkG dd deZle
elddӍZlG dd deZme
emddӍZmG d d deZne
enddӍZnG dd deZoe
eoddӍZoG dd deZpe
epddӍZpG d	d
 d
eZqe
eqddӍZqG dd deZre
erddӍZrG dd deZse
esddӍZsG dd deZte
etddӍZtG dd deZue
euddӍZuG dd deZve
evddӍZvG dd deZwe
ewddӍZwG dd deZxe
exd dӍZxG d!d" d"eZye
eyd#dӍZyG d$d% d%eZze
ezd&dӍZzG d'd( d(eZ{e
e{d)dӍZ{G d*d+ d+eZ|G d,d- d-eZ}G d.d/ d/eZ~G d0d1 d1eZe
e|d2dӍZ|G d3d4 d4eZe
ed5dӍZG d6d7 d7eaZdS (8  z Auto Model class.    N)OrderedDict   )logging   )_BaseAutoBackboneClass_BaseAutoModelClass_LazyAutoMappingauto_class_update)CONFIG_MAPPING_NAMES)albertZAlbertModel)alignZ
AlignModel)ZaltclipZAltCLIPModel)audio-spectrogram-transformerZASTModel)Z
autoformerZAutoformerModel)ZbarkZ	BarkModel)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)brosZ	BrosModel)	camembertZCamembertModel)canineZCanineModel)Zchinese_clipZChineseCLIPModel)clapZ	ClapModel)ZclipZ	CLIPModel)ZclipsegZCLIPSegModel)
code_llama
LlamaModel)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)dinov2ZDinov2Model)
distilbertZDistilBertModel)z
donut-swinZDonutSwinModel)ZdprZDPRQuestionEncoder)dptZDPTModel)efficientformerZEfficientFormerModel)efficientnetZEfficientNetModel)electraZElectraModel)ZencodecZEncodecModel)ernieZ
ErnieModel)ernie_mZErnieMModel)esmZEsmModel)falconZFalconModel)flaubertZFlaubertModel)flavaZ
FlavaModel)fnetZ	FNetModel)focalnetZFocalNetModel)fsmtZ	FSMTModel)funnel)ZFunnelModelZFunnelBaseModel)gitZGitModel)glpnZ	GLPNModel)gpt-sw3	GPT2Model)gpt2rF   )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)ideficsZIdeficsModel)imagegptZImageGPTModel)ZinformerZInformerModel)ZjukeboxZJukeboxModel)layoutlmZLayoutLMModel)
layoutlmv2ZLayoutLMv2Model)
layoutlmv3ZLayoutLMv3Model)ledZLEDModel)levitZ
LevitModel)liltZ	LiltModel)llamar    )
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)mistralZMistralModel)
mobilebertZMobileBertModel)mobilenet_v1ZMobileNetV1Model)mobilenet_v2ZMobileNetV2Model)	mobilevitZMobileViTModel)mobilevitv2ZMobileViTV2Model)mpnetZ
MPNetModel)mptZMptModel)mraZMraModel)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)	persimmonZPersimmonModel)plbartZPLBartModel)
poolformerZPoolFormerModel)
prophetnetZProphetNetModel)pvtZPvtModel)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)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)umt5Z	UMT5Model)	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)vitdetZVitDetModel)ZvitsZ	VitsModel)vivitZ
VivitModel)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)rA   ZFSMTForConditionalGeneration)rB   ZFunnelForPreTraining)rE   GPT2LMHeadModel)rG   r   )rH   ZGPTBigCodeForCausalLM)rN   ZIBertForMaskedLM)rO   ZIdeficsForVisionText2Text)rQ   ZLayoutLMForMaskedLM)rX   ZLongformerForMaskedLM)rZ   ZLukeForMaskedLM)r[   ZLxmertForPreTraining)rd   ZMegaForMaskedLM)re   ZMegatronBertForPreTraining)rg   ZMobileBertForPreTraining)rl   ZMPNetForMaskedLM)rm   ZMptForCausalLM)rn   ZMraForMaskedLM)rp   ZMvpForConditionalGeneration)rr   ZNezhaForPreTraining)rs   ZNllbMoeForConditionalGeneration)rw   ZOpenAIGPTLMHeadModel)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)r   ZAlbertForMaskedLM)r   ZBertForMaskedLM)r   ZBigBirdForMaskedLM)r   Z&BigBirdPegasusForConditionalGeneration)r   Z'BlenderbotSmallForConditionalGeneration)r!   ZCodeGenForCausalLM)r#   ZConvBertForMaskedLM)r&   ZCpmAntForCausalLM)r8   ZElectraForMaskedLM)zencoder-decoderZEncoderDecoderModel)r9   ZErnieForMaskedLM)r;   ZEsmForMaskedLM)r?   ZFNetForMaskedLM)rB   ZFunnelForMaskedLM)rC   ZGitForCausalLM)rI   ZGPTNeoForCausalLM)rJ   ZGPTNeoXForCausalLM)rK   ZGPTNeoXJapaneseForCausalLM)rL   ZGPTJForCausalLM)rT   ZLEDForConditionalGeneration)rY   ZLongT5ForConditionalGeneration)r\   ZM2M100ForConditionalGeneration)r]   ZMarianMTModel)re   ZMegatronBertForCausalLM)rg   ZMobileBertForMaskedLM)rr   ZNezhaForMaskedLM)rt   ZNystromformerForMaskedLM)r{   Z PegasusXForConditionalGeneration)r~   ZPLBartForConditionalGeneration)Z	pop2pianoZ!Pop2PianoForConditionalGeneration)r   ZQDQBertForMaskedLM)r   ZReformerModelWithLMHead)r   ZRemBertForMaskedLM)r   ZRoCBertForMaskedLM)r   ZRoFormerForMaskedLM)r   Z#Speech2TextForConditionalGeneration)r   ZWav2Vec2ForMaskedLM)r   ZWhisperForConditionalGeneration)r   ZYosoForMaskedLM)r   ZBartForCausalLM)r   ZBertLMHeadModel)r   ZBertGenerationDecoder)r   ZBigBirdForCausalLM)r   ZBigBirdPegasusForCausalLM)r   ZBioGptForCausalLM)r   ZBlenderbotForCausalLM)r   ZBlenderbotSmallForCausalLM)r   ZCamembertForCausalLM)r   LlamaForCausalLM)r*   ZData2VecTextForCausalLM)r8   ZElectraForCausalLM)r9   ZErnieForCausalLM)r<   ZFalconForCausalLM)rW   r   )r]   ZMarianForCausalLM)rb   ZMBartForCausalLM)rd   ZMegaForCausalLM)rf   ZMistralForCausalLM)musicgenZMusicgenForCausalLM)rp   ZMvpForCausalLM)rv   ZOpenLlamaForCausalLM)rx   ZOPTForCausalLM)rz   ZPegasusForCausalLM)r}   ZPersimmonForCausalLM)r~   ZPLBartForCausalLM)r   ZProphetNetForCausalLM)r   ZQDQBertLMHeadModel)r   ZRemBertForCausalLM)r   ZRobertaForCausalLM)r   ZRobertaPreLayerNormForCausalLM)r   ZRoCBertForCausalLM)r   ZRoFormerForCausalLM)Zspeech_to_text_2ZSpeech2Text2ForCausalLM)ZtrocrZTrOCRForCausalLM)r   ZXGLMForCausalLM)r   ZXLMProphetNetForCausalLM)r   ZXLMRobertaForCausalLM)r   ZXLMRobertaXLForCausalLM)r   ZXmodForCausalLM)r/   ZDeiTForMaskedImageModeling)r@   ZFocalNetForMaskedImageModeling)r   ZSwinForMaskedImageModeling)r   ZSwinv2ForMaskedImageModeling)r   ZViTForMaskedImageModeling)rP   ZImageGPTForCausalImageModeling)r   ZBeitForImageClassification)r   ZBitForImageClassification)r$   ZConvNextForImageClassification)r%   Z ConvNextV2ForImageClassification)r(   ZCvtForImageClassification)r+   Z$Data2VecVisionForImageClassification)r/   )ZDeiTForImageClassificationZ%DeiTForImageClassificationWithTeacher)r2   ZDinatForImageClassification)r3   ZDinov2ForImageClassification)r6   )Z%EfficientFormerForImageClassificationZ0EfficientFormerForImageClassificationWithTeacher)r7   Z"EfficientNetForImageClassification)r@   ZFocalNetForImageClassification)rP   ZImageGPTForImageClassification)rU   )ZLevitForImageClassificationZ&LevitForImageClassificationWithTeacher)rh   Z!MobileNetV1ForImageClassification)ri   Z!MobileNetV2ForImageClassification)rj   ZMobileViTForImageClassification)rk   Z!MobileViTV2ForImageClassification)rq   ZNatForImageClassification)r|   )Z&PerceiverForImageClassificationLearnedZ&PerceiverForImageClassificationFourierZ-PerceiverForImageClassificationConvProcessing)r   Z PoolFormerForImageClassification)r   ZPvtForImageClassification)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)r1   ZDetrForSegmentation)r   ZBeitForSemanticSegmentation)r+   Z%Data2VecVisionForSemanticSegmentation)r5   ZDPTForSemanticSegmentation)ri   Z"MobileNetV2ForSemanticSegmentation)rj   Z MobileViTForSemanticSegmentation)rk   Z"MobileViTV2ForSemanticSegmentation)r   Z SegformerForSemanticSegmentation)ZupernetZUperNetForSemanticSegmentation)r`   Z!MaskFormerForInstanceSegmentation)r_   Z#Mask2FormerForUniversalSegmentation)ru   Z!OneFormerForUniversalSegmentation)r   Z!TimesformerForVideoClassification)r   ZVideoMAEForVideoClassification)r   ZVivitForVideoClassification)r   ZBlipForConditionalGeneration)r   ZBlip2ForConditionalGeneration)ZinstructblipZ$InstructBlipForConditionalGeneration)Z
pix2structZ"Pix2StructForConditionalGeneration)zvision-encoder-decoderZVisionEncoderDecoderModel)rb   ZMBartForConditionalGeneration)re   ZMegatronBertForMaskedLM)r|   ZPerceiverForMaskedLM)r   ZReformerForMaskedLM)r"   Z!ConditionalDetrForObjectDetection)r.   Z DeformableDetrForObjectDetection)r0   ZDetaForObjectDetection)r1   ZDetrForObjectDetection)r   Z"TableTransformerForObjectDetection)r   ZYolosForObjectDetection)ry   ZOwlViTForObjectDetection)r5   ZDPTForDepthEstimation)rD   ZGLPNForDepthEstimation)r   Z"BlenderbotForConditionalGeneration)ro   ZMT5ForConditionalGeneration)rz   ZPegasusForConditionalGeneration)r   Z"ProphetNetForConditionalGeneration)r   ZUMT5ForConditionalGeneration)r   Z%XLMProphetNetForConditionalGeneration)zspeech-encoder-decoderZSpeechEncoderDecoderModel)r   ZSpeechT5ForSpeechToText)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   LlamaForSequenceClassification)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FalconForSequenceClassification)r=   Z!FlaubertForSequenceClassification)r?   ZFNetForSequenceClassification)rB   ZFunnelForSequenceClassification)rE   GPT2ForSequenceClassification)rG   r   )rH   Z#GPTBigCodeForSequenceClassification)rI   ZGPTNeoForSequenceClassification)rJ   Z GPTNeoXForSequenceClassification)rL   ZGPTJForSequenceClassification)rN   ZIBertForSequenceClassification)rQ   Z!LayoutLMForSequenceClassification)rR   Z#LayoutLMv2ForSequenceClassification)rS   Z#LayoutLMv3ForSequenceClassification)rT   ZLEDForSequenceClassification)rV   ZLiltForSequenceClassification)rW   r   )rX   Z#LongformerForSequenceClassification)rZ   ZLukeForSequenceClassification)r^   Z!MarkupLMForSequenceClassification)rb   ZMBartForSequenceClassification)rd   ZMegaForSequenceClassification)re   Z%MegatronBertForSequenceClassification)rf   Z MistralForSequenceClassification)rg   Z#MobileBertForSequenceClassification)rl   ZMPNetForSequenceClassification)rm   ZMptForSequenceClassification)rn   ZMraForSequenceClassification)ro   ZMT5ForSequenceClassification)rp   ZMvpForSequenceClassification)rr   ZNezhaForSequenceClassification)rt   Z&NystromformerForSequenceClassification)rv   Z"OpenLlamaForSequenceClassification)rw   Z"OpenAIGPTForSequenceClassification)rx   ZOPTForSequenceClassification)r|   Z"PerceiverForSequenceClassification)r}   Z"PersimmonForSequenceClassification)r~   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T5ForSequenceClassification)r   ZTapasForSequenceClassification)r   Z"TransfoXLForSequenceClassification)r   ZUMT5ForSequenceClassification)r   ZXLMForSequenceClassification)r   Z#XLMRobertaForSequenceClassification)r   Z%XLMRobertaXLForSequenceClassification)r   ZXLNetForSequenceClassification)r   ZXmodForSequenceClassification)r   ZYosoForSequenceClassification)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FalconForQuestionAnswering)r=   Z"FlaubertForQuestionAnsweringSimple)r?   ZFNetForQuestionAnswering)rB   ZFunnelForQuestionAnswering)rG   ZGPT2ForQuestionAnswering)rI   ZGPTNeoForQuestionAnswering)rJ   ZGPTNeoXForQuestionAnswering)rL   ZGPTJForQuestionAnswering)rN   ZIBertForQuestionAnswering)rR   ZLayoutLMv2ForQuestionAnswering)rS   ZLayoutLMv3ForQuestionAnswering)rT   ZLEDForQuestionAnswering)rV   ZLiltForQuestionAnswering)rX   ZLongformerForQuestionAnswering)rZ   ZLukeForQuestionAnswering)r[   ZLxmertForQuestionAnswering)r^   ZMarkupLMForQuestionAnswering)rb   ZMBartForQuestionAnswering)rd   ZMegaForQuestionAnswering)re   Z MegatronBertForQuestionAnswering)rg   ZMobileBertForQuestionAnswering)rl   ZMPNetForQuestionAnswering)rm   ZMptForQuestionAnswering)rn   ZMraForQuestionAnswering)ro   ZMT5ForQuestionAnswering)rp   ZMvpForQuestionAnswering)rr   ZNezhaForQuestionAnswering)rt   Z!NystromformerForQuestionAnswering)rx   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T5ForQuestionAnswering)r   ZUMT5ForQuestionAnswering)r   ZXLMForQuestionAnsweringSimple)r   ZXLMRobertaForQuestionAnswering)r   Z XLMRobertaXLForQuestionAnswering)r   ZXLNetForQuestionAnsweringSimple)r   ZXmodForQuestionAnswering)r   ZYosoForQuestionAnswering)r   ZTapasForQuestionAnswering)r   ZViltForQuestionAnswering)rQ   ZLayoutLMForQuestionAnswering)r   ZAlbertForTokenClassification)r   ZBertForTokenClassification)r   ZBigBirdForTokenClassification)r   ZBioGptForTokenClassification)r   ZBloomForTokenClassification)r   ZBrosForTokenClassification)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FalconForTokenClassification)r=   ZFlaubertForTokenClassification)r?   ZFNetForTokenClassification)rB   ZFunnelForTokenClassification)rE   GPT2ForTokenClassification)rG   r   )rH   Z GPTBigCodeForTokenClassification)rI   ZGPTNeoForTokenClassification)rJ   ZGPTNeoXForTokenClassification)rN   ZIBertForTokenClassification)rQ   ZLayoutLMForTokenClassification)rR   Z LayoutLMv2ForTokenClassification)rS   Z LayoutLMv3ForTokenClassification)rV   ZLiltForTokenClassification)rX   Z LongformerForTokenClassification)rZ   ZLukeForTokenClassification)r^   ZMarkupLMForTokenClassification)rd   ZMegaForTokenClassification)re   Z"MegatronBertForTokenClassification)rg   Z MobileBertForTokenClassification)rl   ZMPNetForTokenClassification)rm   ZMptForTokenClassification)rn   ZMraForTokenClassification)rr   ZNezhaForTokenClassification)rt   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)rB   ZFunnelForMultipleChoice)rN   ZIBertForMultipleChoice)rX   ZLongformerForMultipleChoice)rZ   ZLukeForMultipleChoice)rd   ZMegaForMultipleChoice)re   ZMegatronBertForMultipleChoice)rg   ZMobileBertForMultipleChoice)rl   ZMPNetForMultipleChoice)rn   ZMraForMultipleChoice)rr   ZNezhaForMultipleChoice)rt   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)re   Z%MegatronBertForNextSentencePrediction)rg   Z#MobileBertForNextSentencePrediction)rr   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)rc   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   ZSpeechT5ForTextToSpeech)r   Z MusicgenForConditionalGeneration)r   ZBitBackbone)r$   ZConvNextBackbone)r%   ZConvNextV2Backbone)r2   ZDinatBackbone)r3   ZDinov2Backbone)r@   ZFocalNetBackbone)ra   ZMaskFormerSwinBackbone)rq   ZNatBackbone)r   ZResNetBackbone)r   ZSwinBackbone)r   ZVitDetBackbone)ro   ZMT5EncoderModel)r   ZT5EncoderModel)r   ZUMT5EncoderModel)r   ZSwin2SRForImageSuperResolutionc                   @   s   e Zd ZeZdS )AutoModelForMaskGenerationN)__name__
__module____qualname__!MODEL_FOR_MASK_GENERATION_MAPPING_model_mapping r   r   g/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/transformers/models/auto/modeling_auto.pyr     s   r   c                   @   s   e Zd ZeZdS )AutoModelForTextEncodingN)r   r   r   MODEL_FOR_TEXT_ENCODING_MAPPINGr   r   r   r   r   r     s   r   c                   @   s   e Zd ZeZdS )AutoModelForImageToImageN)r   r   r    MODEL_FOR_IMAGE_TO_IMAGE_MAPPINGr   r   r   r   r   r     s   r   c                   @   s   e Zd ZeZdS )	AutoModelN)r   r   r   MODEL_MAPPINGr   r   r   r   r   r     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     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     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     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     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     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   4  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   D  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   M  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   T  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   r   f  s   r   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   r   o  s   r   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   r   v  s   r   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   r     s   r   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   r     s   r   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   r    s   r  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   r    s   r  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   r    s   r  c                   @   s   e Zd ZeZdS )AutoModelForTextToSpectrogramN)r   r   r   %MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPINGr   r   r   r   r   r    s   r  c                   @   s   e Zd ZeZdS )AutoModelForTextToWaveformN)r   r   r   "MODEL_FOR_TEXT_TO_WAVEFORM_MAPPINGr   r   r   r   r   r	    s   r	  c                   @   s   e Zd ZeZdS )AutoBackboneN)r   r   r   MODEL_FOR_BACKBONE_MAPPINGr   r   r   r   r   r    s   r  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   r    s   r  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   r    s
    zAutoModelWithLMHead.from_configc                    s    t dt t j|f||S r  )r  r  r  r  from_pretrained)r  Zpretrained_model_name_or_pathZ
model_argskwargsr  r   r   r    s
    z#AutoModelWithLMHead.from_pretrained)r   r   r   classmethodr  r  __classcell__r   r   r  r   r    s   	r  )__doc__r  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_NAMESZ+MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMESZ(MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMESZ6MODEL_FOR_ZERO_SHOT_IMAGE_CLASSIFICATION_MAPPING_NAMESZ MODEL_FOR_BACKBONE_MAPPING_NAMESZ'MODEL_FOR_MASK_GENERATION_MAPPING_NAMESZ%MODEL_FOR_TEXT_ENCODING_MAPPING_NAMESZ&MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMESr   r   r   r   Z'MODEL_FOR_CAUSAL_IMAGE_MODELING_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  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   r   r   <module>   s\	  
  KDSB3
3
RD=,	



        
  
 
 
     
  

 
 




           