U
    ,-eo                     @   s	  d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	 ddl
mZ ddlmZmZ ddlmZ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dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddg҃Zeddddddddddddddddddddddddddddddddddddd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/d0d1d2d3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dj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dddddddg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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,d-d.d/d0d1d2d3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dj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dgZddddddddgZedddddddgZdd Zdd ZG dd deZeeZG dd deZeeZe	e ee  f dddZ!dddZ"dddZ#G dd dZ$dS (  z Auto Config class.    N)OrderedDict)ListUnion   )PretrainedConfig)get_class_from_dynamic_moduleresolve_trust_remote_code)CONFIG_NAMElogging)albertZAlbertConfig)alignZAlignConfig)altclipZAltCLIPConfig)audio-spectrogram-transformerZ	ASTConfig)
autoformerZAutoformerConfig)barkZ
BarkConfig)bartZ
BartConfig)beitZ
BeitConfig)bertZ
BertConfig)bert-generationZBertGenerationConfig)big_birdZBigBirdConfig)bigbird_pegasusZBigBirdPegasusConfig)biogptZBioGptConfig)bitZ	BitConfig)
blenderbotZBlenderbotConfig)blenderbot-smallZBlenderbotSmallConfig)blipZ
BlipConfig)blip-2ZBlip2Config)bloomZBloomConfig)bridgetowerZBridgeTowerConfig)brosZ
BrosConfig)	camembertZCamembertConfig)canineZCanineConfig)chinese_clipZChineseCLIPConfig)clapZ
ClapConfig)clipZ
CLIPConfig)clipsegZCLIPSegConfig)
code_llamaLlamaConfig)codegenZCodeGenConfig)conditional_detrZConditionalDetrConfig)convbertZConvBertConfig)convnextZConvNextConfig)
convnextv2ZConvNextV2Config)cpmantZCpmAntConfig)ctrlZ
CTRLConfig)cvtZ	CvtConfig)data2vec-audioZData2VecAudioConfig)data2vec-textZData2VecTextConfig)data2vec-visionZData2VecVisionConfig)debertaZDebertaConfig)
deberta-v2ZDebertaV2Config)decision_transformerZDecisionTransformerConfig)deformable_detrZDeformableDetrConfig)deitZ
DeiTConfig)detaZ
DetaConfig)detrZ
DetrConfig)dinatZDinatConfig)dinov2ZDinov2Config)
distilbertZDistilBertConfig)
donut-swinZDonutSwinConfig)dprZ	DPRConfig)dptZ	DPTConfig)efficientformerZEfficientFormerConfig)efficientnetZEfficientNetConfig)electraZElectraConfig)encodecZEncodecConfig)encoder-decoderZEncoderDecoderConfig)ernieZErnieConfig)ernie_mZErnieMConfig)esmZ	EsmConfig)falconZFalconConfig)flaubertZFlaubertConfig)flavaZFlavaConfig)fnetZ
FNetConfig)focalnetZFocalNetConfig)fsmtZ
FSMTConfig)funnelZFunnelConfig)gitZ	GitConfig)glpnZ
GLPNConfig)gpt-sw3
GPT2Config)gpt2rR   )gpt_bigcodeZGPTBigCodeConfig)gpt_neoZGPTNeoConfig)gpt_neoxZGPTNeoXConfig)gpt_neox_japaneseZGPTNeoXJapaneseConfig)gptjZ
GPTJConfig)gptsan-japaneseZGPTSanJapaneseConfig)
graphormerZGraphormerConfig)groupvitZGroupViTConfig)hubertZHubertConfig)ibertZIBertConfig)ideficsZIdeficsConfig)imagegptZImageGPTConfig)informerZInformerConfig)instructblipZInstructBlipConfig)jukeboxZJukeboxConfig)layoutlmZLayoutLMConfig)
layoutlmv2ZLayoutLMv2Config)
layoutlmv3ZLayoutLMv3Config)ledZ	LEDConfig)levitZLevitConfig)liltZ
LiltConfig)llamar'   )
longformerZLongformerConfig)longt5ZLongT5Config)lukeZ
LukeConfig)lxmertZLxmertConfig)m2m_100ZM2M100Config)marianZMarianConfig)markuplmZMarkupLMConfig)mask2formerZMask2FormerConfig)
maskformerZMaskFormerConfig)maskformer-swinZMaskFormerSwinConfig)mbartZMBartConfig)mctctZMCTCTConfig)megaZ
MegaConfig)megatron-bertZMegatronBertConfig)mgp-strZMgpstrConfig)mistralZMistralConfig)
mobilebertZMobileBertConfig)mobilenet_v1ZMobileNetV1Config)mobilenet_v2ZMobileNetV2Config)	mobilevitZMobileViTConfig)mobilevitv2ZMobileViTV2Config)mpnetZMPNetConfig)mptZ	MptConfig)mraZ	MraConfig)mt5Z	MT5Config)musicgenZMusicgenConfig)mvpZ	MvpConfig)natZ	NatConfig)nezhaZNezhaConfig)nllb-moeZNllbMoeConfig)nougatVisionEncoderDecoderConfig)nystromformerZNystromformerConfig)	oneformerZOneFormerConfig)
open-llamaZOpenLlamaConfig)
openai-gptZOpenAIGPTConfig)optZ	OPTConfig)owlvitZOwlViTConfig)pegasusZPegasusConfig)	pegasus_xZPegasusXConfig)	perceiverZPerceiverConfig)	persimmonZPersimmonConfig)
pix2structZPix2StructConfig)plbartZPLBartConfig)
poolformerZPoolFormerConfig)	pop2pianoZPop2PianoConfig)
prophetnetZProphetNetConfig)pvtZ	PvtConfig)qdqbertZQDQBertConfig)ragZ	RagConfig)realmZRealmConfig)reformerZReformerConfig)regnetZRegNetConfig)rembertZRemBertConfig)resnetZResNetConfig)	retribertZRetriBertConfig)robertaZRobertaConfig)roberta-prelayernormZRobertaPreLayerNormConfig)roc_bertZRoCBertConfig)roformerZRoFormerConfig)rwkvZ
RwkvConfig)samZ	SamConfig)	segformerZSegformerConfig)sewZ	SEWConfig)sew-dZ
SEWDConfig)speech-encoder-decoderZSpeechEncoderDecoderConfig)speech_to_textZSpeech2TextConfig)speech_to_text_2ZSpeech2Text2Config)speecht5ZSpeechT5Config)splinterZSplinterConfig)squeezebertZSqueezeBertConfig)swiftformerZSwiftFormerConfig)swinZ
SwinConfig)swin2srZSwin2SRConfig)swinv2ZSwinv2Config)switch_transformersZSwitchTransformersConfig)t5ZT5Config)table-transformerZTableTransformerConfig)tapasZTapasConfig)time_series_transformerZTimeSeriesTransformerConfig)timesformerZTimesformerConfig)timm_backboneZTimmBackboneConfig)trajectory_transformerZTrajectoryTransformerConfig)
transfo-xlZTransfoXLConfig)trocrZTrOCRConfig)tvltZ
TvltConfig)umt5Z
UMT5Config)	unispeechZUniSpeechConfig)unispeech-satZUniSpeechSatConfig)upernetZUperNetConfig)vanZ	VanConfig)videomaeZVideoMAEConfig)viltZ
ViltConfig)vision-encoder-decoderr   )vision-text-dual-encoderZVisionTextDualEncoderConfig)visual_bertZVisualBertConfig)vitZ	ViTConfig)
vit_hybridZViTHybridConfig)vit_maeZViTMAEConfig)vit_msnZViTMSNConfig)vitdetZVitDetConfig)vitmatteZVitMatteConfig)vitsZ
VitsConfig)vivitZVivitConfig)wav2vec2ZWav2Vec2Config)wav2vec2-conformerZWav2Vec2ConformerConfig)wavlmZWavLMConfig)whisperZWhisperConfig)xclipZXCLIPConfig)xglmZ
XGLMConfig)xlmZ	XLMConfig)xlm-prophetnetZXLMProphetNetConfig)xlm-robertaZXLMRobertaConfig)xlm-roberta-xlZXLMRobertaXLConfig)xlnetZXLNetConfig)xmodZ
XmodConfig)yolosZYolosConfig)yosoZ
YosoConfig)r   Z$ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z;AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"BARK_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"BART_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z-BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!BIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z.BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"BROS_PRETRAINED_CONFIG_ARCHIVE_MAP)r    Z'CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r!   Z$CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP)r"   Z*CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r#   Z"CLAP_PRETRAINED_MODEL_ARCHIVE_LIST)r$   Z"CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r%   Z%CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP)r(   Z%CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP)r)   Z.CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)r*   Z&CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r+   Z&CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)r,   Z(CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r-   Z$CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP)r.   Z"CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP)r/   Z!CVT_PRETRAINED_CONFIG_ARCHIVE_MAP)r0   Z,DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP)r1   Z+DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)r2   Z-DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP)r3   Z%DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)r4   Z(DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)r6   Z-DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)r7   Z"DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r8   Z"DETA_PRETRAINED_CONFIG_ARCHIVE_MAP)r9   Z"DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)r:   Z#DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP)r;   Z$DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r<   Z(DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r=   Z(DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP)r>   Z!DPR_PRETRAINED_CONFIG_ARCHIVE_MAP)r?   Z!DPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r@   Z-EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rA   Z*EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rB   Z%ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP)rC   Z%ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP)rE   Z#ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP)rF   Z%ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP)rG   Z!ESM_PRETRAINED_CONFIG_ARCHIVE_MAP)rH   Z$FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP)rI   Z&FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rJ   Z#FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP)rK   Z"FNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rL   Z&FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rM   Z"FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP)rN   Z$FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP)rO   Z!GIT_PRETRAINED_CONFIG_ARCHIVE_MAP)rP   Z"GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP)rS   Z"GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP)rT   Z)GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP)rU   Z%GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP)rV   Z&GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP)rW   Z/GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP)rX   Z"GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP)rY   Z-GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP)rZ   Z(GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r[   Z&GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r\   Z$HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r]   Z#IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r^   Z%IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP)r_   Z&IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r`   Z&INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)ra   Z*INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)rb   Z%JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP)rc   Z&LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP)rd   Z(LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP)re   Z(LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP)rf   Z!LED_PRETRAINED_CONFIG_ARCHIVE_MAP)rg   Z#LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)rh   Z"LILT_PRETRAINED_CONFIG_ARCHIVE_MAP)ri   Z#LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP)rj   Z(LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rk   Z$LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP)rl   Z"LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP)rm   Z$LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rn   Z%M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP)rp   Z&MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP)rq   Z)MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rr   Z(MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rt   Z#MBART_PRETRAINED_CONFIG_ARCHIVE_MAP)ru   Z#MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP)rv   Z"MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP)rw   Z+MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rx   Z%MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP)ry   Z%MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP)r{   Z*MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP)r|   Z*MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)r}   Z'MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r~   Z)MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!MPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!MRA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!MVP_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!NAT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z+NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!OPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!PVT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#REALM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z2ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!SAM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!SEW_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z,SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z.SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z1SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z T5_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z/TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z5TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z'UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z+UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!VAN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"VILT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!VIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z&VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"VITS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z0WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z%WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z!XLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z,XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z)XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z#YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z"YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP)r   ZALBERT)r   ZALIGN)r   ZAltCLIP)r   zAudio Spectrogram Transformer)r   Z
Autoformer)r   ZBark)r   ZBART)ZbarthezZBARThez)ZbartphoZBARTpho)r   ZBEiT)r   ZBERT)r   zBert Generation)zbert-japaneseZBertJapanese)ZbertweetZBERTweet)r   ZBigBird)r   zBigBird-Pegasus)r   ZBioGpt)r   ZBiT)r   Z
Blenderbot)r   ZBlenderbotSmall)r   ZBLIP)r   zBLIP-2)r   ZBLOOM)bortZBORT)r   ZBridgeTower)r   ZBROS)Zbyt5ZByT5)r    Z	CamemBERT)r!   ZCANINE)r"   zChinese-CLIP)r#   ZCLAP)r$   ZCLIP)r%   ZCLIPSeg)r&   Z	CodeLlama)r(   ZCodeGen)r)   zConditional DETR)r*   ZConvBERT)r+   ZConvNeXT)r,   Z
ConvNeXTV2)ZcpmZCPM)r-   zCPM-Ant)r.   ZCTRL)r/   ZCvT)r0   ZData2VecAudio)r1   ZData2VecText)r2   ZData2VecVision)r3   ZDeBERTa)r4   z
DeBERTa-v2)r5   zDecision Transformer)r6   zDeformable DETR)r7   ZDeiT)ZdeplotZDePlot)r8   ZDETA)r9   ZDETR)ZdialogptZDialoGPT)r:   ZDiNAT)r;   ZDINOv2)r<   Z
DistilBERT)ZditZDiT)r=   Z	DonutSwin)r>   ZDPR)r?   ZDPT)r@   ZEfficientFormer)rA   ZEfficientNet)rB   ZELECTRA)rC   ZEnCodec)rD   zEncoder decoder)rE   ZERNIE)rF   ZErnieM)rG   ZESM)rH   ZFalcon)zflan-t5zFLAN-T5)zflan-ul2zFLAN-UL2)rI   ZFlauBERT)rJ   ZFLAVA)rK   ZFNet)rL   ZFocalNet)rM   zFairSeq Machine-Translation)rN   zFunnel Transformer)rO   ZGIT)rP   ZGLPN)rQ   zGPT-Sw3)rS   zOpenAI GPT-2)rT   Z
GPTBigCode)rU   zGPT Neo)rV   zGPT NeoX)rW   zGPT NeoX Japanese)rX   zGPT-J)rY   zGPTSAN-japanese)rZ   Z
Graphormer)r[   ZGroupViT)ZherbertZHerBERT)r\   ZHubert)r]   zI-BERT)r^   ZIDEFICS)r_   ZImageGPT)r`   ZInformer)ra   ZInstructBLIP)rb   ZJukebox)rc   ZLayoutLM)rd   Z
LayoutLMv2)re   Z
LayoutLMv3)Z	layoutxlmZ	LayoutXLM)rf   ZLED)rg   ZLeViT)rh   ZLiLT)ri   ZLLaMA)Zllama2ZLlama2)rj   Z
Longformer)rk   ZLongT5)rl   ZLUKE)rm   ZLXMERT)rn   ZM2M100)ro   ZMarian)rp   ZMarkupLM)rq   ZMask2Former)rr   Z
MaskFormer)rs   ZMaskFormerSwin)ZmatchaZMatCha)rt   ZmBART)Zmbart50zmBART-50)ru   zM-CTC-T)rv   ZMEGA)rw   zMegatron-BERT)Zmegatron_gpt2zMegatron-GPT2)rx   zMGP-STR)ry   ZMistral)ZmlukeZmLUKE)mmsZMMS)rz   Z
MobileBERT)r{   ZMobileNetV1)r|   ZMobileNetV2)r}   Z	MobileViT)r~   ZMobileViTV2)r   ZMPNet)r   ZMPT)r   ZMRA)r   ZMT5)r   ZMusicGen)r   ZMVP)r   ZNAT)r   ZNezha)ZnllbZNLLB)r   zNLLB-MOE)r   ZNougat)r   u   Nyströmformer)r   Z	OneFormer)r   Z	OpenLlama)r   z
OpenAI GPT)r   OPT)r   zOWL-ViT)r   ZPegasus)r   z	PEGASUS-X)r   Z	Perceiver)r   Z	Persimmon)ZphobertZPhoBERT)r   Z
Pix2Struct)r   ZPLBart)r   Z
PoolFormer)r   Z	Pop2Piano)r   Z
ProphetNet)r   ZPVT)r   ZQDQBert)r   ZRAG)r   ZREALM)r   ZReformer)r   ZRegNet)r   ZRemBERT)r   ZResNet)r   Z	RetriBERT)r   ZRoBERTa)r   zRoBERTa-PreLayerNorm)r   ZRoCBert)r   ZRoFormer)r   ZRWKV)r   ZSAM)r   Z	SegFormer)r   ZSEW)r   zSEW-D)r   zSpeech Encoder decoder)r   ZSpeech2Text)r   ZSpeech2Text2)r   ZSpeechT5)r   ZSplinter)r   ZSqueezeBERT)r   ZSwiftFormer)r   zSwin Transformer)r   ZSwin2SR)r   zSwin Transformer V2)r   ZSwitchTransformers)r   ZT5)zt5v1.1zT5v1.1)r   zTable Transformer)r   ZTAPAS)tapexZTAPEX)r   zTime Series Transformer)r   ZTimeSformer)r   ZTimmBackbone)r   zTrajectory Transformer)r   zTransformer-XL)r   ZTrOCR)r   ZTVLT)Zul2ZUL2)r   ZUMT5)r   Z	UniSpeech)r   ZUniSpeechSat)r   ZUPerNet)r   ZVAN)r   ZVideoMAE)r   ZViLT)r   zVision Encoder decoder)r   ZVisionTextDualEncoder)r   Z
VisualBERT)r   ZViT)r   z
ViT Hybrid)r   ZViTMAE)r   ZViTMSN)r   ZVitDet)r   ZViTMatte)r   ZVITS)r   ZViViT)r   ZWav2Vec2)r   zWav2Vec2-Conformer)Zwav2vec2_phonemeZWav2Vec2Phoneme)r   ZWavLM)r   ZWhisper)r   zX-CLIP)r   ZXGLM)r   ZXLM)r   zXLM-ProphetNet)r   zXLM-RoBERTa)r   zXLM-RoBERTa-XL)zxlm-vzXLM-V)r   ZXLNet)Zxls_rzXLS-R)Zxlsr_wav2vec2zXLSR-Wav2Vec2)r   zX-MOD)r   ZYOLOS)r   ZYOSOr   ru   ZmmbtZ
open_llamar   r   r   r   )r   Zopenai)r0   data2vec)r1   r   )r2   r   )r=   Zdonut)rs   rr   )r   Zx_clipc                 C   s2   | t krt |  S | dd} | tkr.d|  } | S )z2Converts a config key to the corresponding module.-_zdeprecated.)!SPECIAL_MODEL_TYPE_TO_MODULE_NAMEreplaceDEPRECATED_MODELS)key r   l/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.pymodel_type_to_module_name  s    
r   c                 C   sL   t  D ]\}}|| kr|  S qtj D ]\}}|j| kr,|  S q,dS )z<Converts a config class name to the corresponding model typeN)CONFIG_MAPPING_NAMESitemsCONFIG_MAPPING_extra_content__name__)configr   clsr   r   r   config_class_to_model_type  s    


r   c                   @   sR   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dddZdS )_LazyConfigMappingzK
    A dictionary that lazily load its values when they are requested.
    c                 C   s   || _ i | _i | _d S N)_mappingr   _modulesselfmappingr   r   r   __init__  s    z_LazyConfigMapping.__init__c                 C   s   || j kr| j | S || jkr&t|| j| }t|}|| jkrZtd| d| j|< t| j| |rzt| j| |S td}t||S )N.transformers.modelsZtransformers)	r   r   KeyErrorr   r   	importlibimport_modulehasattrgetattr)r   r   valuemodule_nameZtransformers_moduler   r   r   __getitem__  s    





z_LazyConfigMapping.__getitem__c                 C   s   t | j t | j  S r   )listr   keysr   r   r   r   r   r	    s    z_LazyConfigMapping.keysc                    s&    fdd j  D t j  S )Nc                    s   g | ]} | qS r   r   .0kr
  r   r   
<listcomp>  s     z-_LazyConfigMapping.values.<locals>.<listcomp>)r   r	  r  r   valuesr
  r   r
  r   r    s    z_LazyConfigMapping.valuesc                    s&    fdd j  D t j  S )Nc                    s   g | ]}| | fqS r   r   r  r
  r   r   r     s     z,_LazyConfigMapping.items.<locals>.<listcomp>)r   r	  r  r   r   r
  r   r
  r   r     s    z_LazyConfigMapping.itemsc                 C   s    t t| j t| j  S r   )iterr  r   r	  r   r
  r   r   r   __iter__  s    z_LazyConfigMapping.__iter__c                 C   s   || j kp|| jkS r   )r   r   r   itemr   r   r   __contains__  s    z_LazyConfigMapping.__contains__Fc                 C   s0   || j  kr"|s"td| d|| j|< dS )z?
        Register a new configuration in this mapping.
        'z>' is already used by a Transformers config, pick another name.N)r   r	  
ValueErrorr   )r   r   r  exist_okr   r   r   register  s    z_LazyConfigMapping.registerN)F)r   
__module____qualname____doc__r   r  r	  r  r   r  r  r  r   r   r   r   r     s   r   c                   @   sP   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd ZdS )_LazyLoadAllMappingsz
    A mapping that will load all pairs of key values at the first access (either by indexing, requestions keys, values,
    etc.)

    Args:
        mapping: The mapping to load.
    c                 C   s   || _ d| _i | _d S )NF)r   _initialized_datar   r   r   r   r     s    z_LazyLoadAllMappings.__init__c                 C   sd   | j r
d S tdt | j D ]8\}}t|}td| d}t	||}| j
| q d| _ d S )NzALL_PRETRAINED_CONFIG_ARCHIVE_MAP is deprecated and will be removed in v5 of Transformers. It does not contain all available model checkpoints, far from it. Checkout hf.co/models for that.r   r   T)r  warningswarnFutureWarningr   r   r   r  r  r  r  update)r   
model_typeZmap_namer  moduler   r   r   r   _initialize"  s    
z _LazyLoadAllMappings._initializec                 C   s   |    | j| S r   r%  r  )r   r   r   r   r   r  3  s    z _LazyLoadAllMappings.__getitem__c                 C   s   |    | j S r   r%  r  r	  r
  r   r   r   r	  7  s    z_LazyLoadAllMappings.keysc                 C   s   |    | j S r   )r%  r  r  r
  r   r   r   r  ;  s    z_LazyLoadAllMappings.valuesc                 C   s   |    | j S r   r'  r
  r   r   r   r   ?  s    z_LazyLoadAllMappings.itemsc                 C   s   |    t| jS r   )r%  r  r  r
  r   r   r   r  C  s    z_LazyLoadAllMappings.__iter__c                 C   s   |    || jkS r   r&  r  r   r   r   r  G  s    z!_LazyLoadAllMappings.__contains__N)r   r  r  r  r   r%  r  r	  r  r   r  r  r   r   r   r   r    s   r  model_classc                 C   s.   t | ttfr"ddd | D S d|  dS )Nz or c                 S   s    g | ]}|d k	rd| dqS )N[``]r   )r  cr   r   r   r  Q  s      z#_get_class_name.<locals>.<listcomp>r*  r+  )
isinstancer  tuplejoinr(  r   r   r   _get_class_nameO  s    r0  Tc                    s   |d kr|st d|rd|d kr4dd t D ndd | D fddt D }nBdd | D dd t D   fd	dt D }d
|S )NzFUsing `use_model_types=False` requires a `config_to_class` dictionary.c                 S   s   i | ]\}}|d | dqS )r*  r+  r   r  r#  r   r   r   r   
<dictcomp>Z  s      z'_list_model_options.<locals>.<dictcomp>c                 S   s"   i | ]\}}|t kr|t|qS r   )MODEL_NAMES_MAPPINGr0  )r  r#  r)  r   r   r   r2  \  s    c              
      s0   g | ](}  d | d|  dt |  dqS )z- **z** --  ( model)r3  )r  r#  )indentmodel_type_to_namer   r   r  a  s   z'_list_model_options.<locals>.<listcomp>c                 S   s&   i | ]\}}|t krt | t|qS r   )r   r0  )r  r   Zclasr   r   r   r2  f  s    c                 S   s   i | ]\}}|t | qS r   r6  r1  r   r   r   r2  k  s     c              
      s0   g | ](} d | d|  d |  dqS )z- [`z`] configuration class: r4  r5  r   )r  Zconfig_name)config_to_model_nameconfig_to_namer7  r   r   r  n  s   
)r  r   r   sortedr	  r/  )r7  config_to_classuse_model_typeslinesr   )r9  r:  r7  r8  r   _list_model_optionsU  s*    

r@  c                    s    fdd}|S )Nc                    s   | j }|d}d}|t|k r>td|| d kr>|d7 }q|t|k rtd||  d }rp| d}t| d||< d|}ntd|  d| || _ | S )	Nr;  r   z^(\s*)List options\s*$   z    r=  r>  zThe function z\ should have an empty 'List options' in its docstring as placeholder, current docstring is:
)	r  splitlenresearchgroupsr@  r/  r  )fnZ
docstringsr?  ir7  rB  r   r   docstring_decoratorw  s     
 

z>replace_list_option_in_docstrings.<locals>.docstring_decoratorr   )r=  r>  rJ  r   rB  r   !replace_list_option_in_docstringsv  s    rK  c                   @   sJ   e Zd ZdZdd ZeedddZee dd Z	e
dd
dZdS )
AutoConfiga  
    This is a generic configuration class that will be instantiated as one of the configuration classes of the library
    when created with the [`~AutoConfig.from_pretrained`] class method.

    This class cannot be instantiated directly using `__init__()` (throws an error).
    c                 C   s   t dd S )NzwAutoConfig is designed to be instantiated using the `AutoConfig.from_pretrained(pretrained_model_name_or_path)` method.)EnvironmentErrorr
  r   r   r   r     s    zAutoConfig.__init__)r#  c                 O   s<   |t krt | }|||S td| ddt   d S )NzUnrecognized model identifier: z. Should contain one of , )r   r  r/  r	  )r   r#  argskwargsconfig_classr   r   r   	for_model  s    
zAutoConfig.for_modelc              
   K   s  | dd}|dk	r@tdt |dddk	r8td||d< d|d< ||d< | d	d}| d
d}tj|f|\}}d|kod|d k}d|ko|d tk}	t	|||	|}|r|r|d d }
t
|
|fd
|i|}tj|r|  |j|f|S d|kr t|d  }|j|f|S tt tddD ]*}|t|kr2t| j|f|  S q2td| dt ddt  dS )a  
        Instantiate one of the configuration classes of the library from a pretrained model configuration.

        The configuration class to instantiate is selected based on the `model_type` property of the config object that
        is loaded, or when it's missing, by falling back to using pattern matching on `pretrained_model_name_or_path`:

        List options

        Args:
            pretrained_model_name_or_path (`str` or `os.PathLike`):
                Can be either:

                    - A string, the *model id* of a pretrained model configuration hosted inside a model repo on
                      huggingface.co. Valid model ids can be located at the root-level, like `bert-base-uncased`, or
                      namespaced under a user or organization name, like `dbmdz/bert-base-german-cased`.
                    - A path to a *directory* containing a configuration file saved using the
                      [`~PretrainedConfig.save_pretrained`] method, or the [`~PreTrainedModel.save_pretrained`] method,
                      e.g., `./my_model_directory/`.
                    - A path or url to a saved configuration JSON *file*, e.g.,
                      `./my_model_directory/configuration.json`.
            cache_dir (`str` or `os.PathLike`, *optional*):
                Path to a directory in which a downloaded pretrained model configuration should be cached if the
                standard cache should not be used.
            force_download (`bool`, *optional*, defaults to `False`):
                Whether or not to force the (re-)download the model weights and configuration files and override the
                cached versions if they exist.
            resume_download (`bool`, *optional*, defaults to `False`):
                Whether or not to delete incompletely received files. Will attempt to resume the download if such a
                file exists.
            proxies (`Dict[str, str]`, *optional*):
                A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
                'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
            revision (`str`, *optional*, defaults to `"main"`):
                The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
                git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
                identifier allowed by git.
            return_unused_kwargs (`bool`, *optional*, defaults to `False`):
                If `False`, then this function returns just the final configuration object.

                If `True`, then this functions returns a `Tuple(config, unused_kwargs)` where *unused_kwargs* is a
                dictionary consisting of the key/value pairs whose keys are not configuration attributes: i.e., the
                part of `kwargs` which has not been used to update `config` and is otherwise ignored.
            trust_remote_code (`bool`, *optional*, defaults to `False`):
                Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
                should only be set to `True` for repositories you trust and in which you have read the code, as it will
                execute code present on the Hub on your local machine.
            kwargs(additional keyword arguments, *optional*):
                The values in kwargs of any keys which are configuration attributes will be used to override the loaded
                values. Behavior concerning key/value pairs whose keys are *not* configuration attributes is controlled
                by the `return_unused_kwargs` keyword parameter.

        Examples:

        ```python
        >>> from transformers import AutoConfig

        >>> # Download configuration from huggingface.co and cache.
        >>> config = AutoConfig.from_pretrained("bert-base-uncased")

        >>> # Download configuration from huggingface.co (user-uploaded) and cache.
        >>> config = AutoConfig.from_pretrained("dbmdz/bert-base-german-cased")

        >>> # If configuration file is in a directory (e.g., was saved using *save_pretrained('./test/saved_model/')*).
        >>> config = AutoConfig.from_pretrained("./test/bert_saved_model/")

        >>> # Load a specific configuration file.
        >>> config = AutoConfig.from_pretrained("./test/bert_saved_model/my_configuration.json")

        >>> # Change some config attributes when loading a pretrained config.
        >>> config = AutoConfig.from_pretrained("bert-base-uncased", output_attentions=True, foo=False)
        >>> config.output_attentions
        True

        >>> config, unused_kwargs = AutoConfig.from_pretrained(
        ...     "bert-base-uncased", output_attentions=True, foo=False, return_unused_kwargs=True
        ... )
        >>> config.output_attentions
        True

        >>> unused_kwargs
        {'foo': False}
        ```use_auth_tokenNzVThe `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.tokenzV`token` and `use_auth_token` are both specified. Please set only the argument `token`.TZ
_from_autoZname_or_pathtrust_remote_codecode_revisionZauto_maprL  r#  )r   reversezUnrecognized model in z(. Should have a `model_type` key in its z7, or contain one of the following strings in its name: rN  )popr  r   r!  getr  r   Zget_config_dictr   r   r   ospathisdirZregister_for_auto_classfrom_pretrained	from_dictr<  r	  rD  strr	   r/  )r   Zpretrained_model_name_or_pathrP  rS  rU  rV  Zconfig_dictZunused_kwargsZhas_remote_codeZhas_local_codeZ	class_refrQ  patternr   r   r   r]    s\    U     
zAutoConfig.from_pretrainedFc                 C   s@   t |tr,|j| kr,td|j d|  dtj| ||d dS )z
        Register a new configuration for this class.

        Args:
            model_type (`str`): The model type like "bert" or "gpt".
            config ([`PretrainedConfig`]): The config to register.
        zzThe config you are passing has a `model_type` attribute that is not consistent with the model type you passed (config has z and you passed z!. Fix one of those so they match!)r  N)
issubclassr   r#  r  r   r  )r#  r   r  r   r   r   r  )  s
    	zAutoConfig.registerN)F)r   r  r  r  r   classmethodr_  rR  rK  r]  staticmethodr  r   r   r   r   rL    s    rL  )NT)NT)%r  r  rZ  rE  r  collectionsr   typingr   r   Zconfiguration_utilsr   Zdynamic_module_utilsr   r   utilsr	   r
   Z
get_loggerr   loggerr   Z CONFIG_ARCHIVE_MAP_MAPPING_NAMESr3  r   r   r   r   r   r   r  Z!ALL_PRETRAINED_CONFIG_ARCHIVE_MAPr_  r0  r@  rK  rL  r   r   r   r   <module>   sf  
  Y  C  w38 !