a
    d                     @   s  d 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g d	Zeg d
Zeg dZeg dZdd Zdd ZG dd deZeeZG dd de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)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)	camembertZCamembertConfig)canineZCanineConfig)chinese_clipZChineseCLIPConfig)clapZ
ClapConfig)clipZ
CLIPConfig)clipsegZCLIPSegConfig)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)
distilbertZDistilBertConfig)
donut-swinZDonutSwinConfig)dprZ	DPRConfig)dptZ	DPTConfig)efficientformerZEfficientFormerConfig)efficientnetZEfficientNetConfig)electraZElectraConfig)encoder-decoderZEncoderDecoderConfig)ernieZErnieConfig)ernie_mZErnieMConfig)esmZ	EsmConfig)flaubertZFlaubertConfig)flavaZFlavaConfig)fnetZ
FNetConfig)focalnetZFocalNetConfig)fsmtZ
FSMTConfig)funnelZFunnelConfig)gitZ	GitConfig)glpnZ
GLPNConfig)gpt-sw3
GPT2Config)gpt2rK   )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)imagegptZImageGPTConfig)informerZInformerConfig)jukeboxZJukeboxConfig)layoutlmZLayoutLMConfig)
layoutlmv2ZLayoutLMv2Config)
layoutlmv3ZLayoutLMv3Config)ledZ	LEDConfig)levitZLevitConfig)liltZ
LiltConfig)llamaZLlamaConfig)
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)
mobilebertZMobileBertConfig)mobilenet_v1ZMobileNetV1Config)mobilenet_v2ZMobileNetV2Config)	mobilevitZMobileViTConfig)mobilevitv2ZMobileViTV2Config)mpnetZMPNetConfig)mt5Z	MT5Config)mvpZ	MvpConfig)natZ	NatConfig)nezhaZNezhaConfig)nllb-moeZNllbMoeConfig)nystromformerZNystromformerConfig)	oneformerZOneFormerConfig)
open-llamaZOpenLlamaConfig)
openai-gptZOpenAIGPTConfig)optZ	OPTConfig)owlvitZOwlViTConfig)pegasusZPegasusConfig)	pegasus_xZPegasusXConfig)	perceiverZPerceiverConfig)
pix2structZPix2StructConfig)plbartZPLBartConfig)
poolformerZPoolFormerConfig)
prophetnetZProphetNetConfig)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)	unispeechZUniSpeechConfig)unispeech-satZUniSpeechSatConfig)upernetZUperNetConfig)vanZ	VanConfig)videomaeZVideoMAEConfig)viltZ
ViltConfig)vision-encoder-decoderZVisionEncoderDecoderConfig)vision-text-dual-encoderZVisionTextDualEncoderConfig)visual_bertZVisualBertConfig)vitZ	ViTConfig)
vit_hybridZViTHybridConfig)vit_maeZViTMAEConfig)vit_msnZViTMSNConfig)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"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'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)r,   Z,DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP)r-   Z+DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)r.   Z-DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP)r/   Z%DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)r0   Z(DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)r2   Z-DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)r3   Z"DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r4   Z"DETA_PRETRAINED_CONFIG_ARCHIVE_MAP)r5   Z"DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)r6   Z#DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP)r7   Z(DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r8   Z(DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP)r9   Z!DPR_PRETRAINED_CONFIG_ARCHIVE_MAP)r:   Z!DPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r;   Z-EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r<   Z*EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r=   Z%ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP)r?   Z#ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP)r@   Z%ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP)rA   Z!ESM_PRETRAINED_CONFIG_ARCHIVE_MAP)rB   Z&FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rC   Z#FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP)rD   Z"FNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rE   Z&FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rF   Z"FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP)rG   Z$FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP)rH   Z!GIT_PRETRAINED_CONFIG_ARCHIVE_MAP)rI   Z"GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP)rL   Z"GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP)rM   Z)GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP)rN   Z%GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP)rO   Z&GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP)rP   Z/GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP)rQ   Z"GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP)rR   Z-GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP)rS   Z(GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rT   Z&GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)rU   Z$HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rV   Z#IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rW   Z&IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP)rX   Z&INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rY   Z%JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP)rZ   Z&LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r[   Z(LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r\   Z(LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP)r]   Z!LED_PRETRAINED_CONFIG_ARCHIVE_MAP)r^   Z#LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r_   Z"LILT_PRETRAINED_CONFIG_ARCHIVE_MAP)r`   Z#LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP)ra   Z(LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rb   Z$LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP)rc   Z"LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP)rd   Z$LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP)re   Z%M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP)rg   Z&MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP)rh   Z)MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)ri   Z(MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rk   Z#MBART_PRETRAINED_CONFIG_ARCHIVE_MAP)rl   Z#MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP)rm   Z"MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP)rn   Z+MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)ro   Z%MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP)rq   Z*MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP)rr   Z*MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)rs   Z'MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)rt   Z)MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP)ru   Z#MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rw   Z!MVP_PRETRAINED_CONFIG_ARCHIVE_MAP)rx   Z!NAT_PRETRAINED_CONFIG_ARCHIVE_MAP)ry   Z#NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP)rz   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(PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z$PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   Z(PROPHETNET_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)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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)ZbortZBORT)r   ZBridgeTower)Zbyt5ZByT5)r   Z	CamemBERT)r   ZCANINE)r    zChinese-CLIP)r!   ZCLAP)r"   ZCLIP)r#   ZCLIPSeg)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)r,   ZData2VecAudio)r-   ZData2VecText)r.   ZData2VecVision)r/   ZDeBERTa)r0   z
DeBERTa-v2)r1   zDecision Transformer)r2   zDeformable DETR)r3   ZDeiT)ZdeplotZDePlot)r4   ZDETA)r5   ZDETR)ZdialogptZDialoGPT)r6   ZDiNAT)r7   Z
DistilBERT)ZditZDiT)r8   Z	DonutSwin)r9   ZDPR)r:   ZDPT)r;   ZEfficientFormer)r<   ZEfficientNet)r=   ZELECTRA)r>   zEncoder decoder)r?   ZERNIE)r@   ZErnieM)rA   ZESM)zflan-t5zFLAN-T5)zflan-ul2zFLAN-UL2)rB   ZFlauBERT)rC   ZFLAVA)rD   ZFNet)rE   ZFocalNet)rF   zFairSeq Machine-Translation)rG   zFunnel Transformer)rH   ZGIT)rI   ZGLPN)rJ   zGPT-Sw3)rL   zOpenAI GPT-2)rM   Z
GPTBigCode)rN   zGPT Neo)rO   zGPT NeoX)rP   zGPT NeoX Japanese)rQ   zGPT-J)rR   zGPTSAN-japanese)rS   Z
Graphormer)rT   ZGroupViT)ZherbertZHerBERT)rU   ZHubert)rV   zI-BERT)rW   ZImageGPT)rX   ZInformer)rY   ZJukebox)rZ   ZLayoutLM)r[   Z
LayoutLMv2)r\   Z
LayoutLMv3)Z	layoutxlmZ	LayoutXLM)r]   ZLED)r^   ZLeViT)r_   ZLiLT)r`   ZLLaMA)ra   Z
Longformer)rb   ZLongT5)rc   ZLUKE)rd   ZLXMERT)re   ZM2M100)rf   ZMarian)rg   ZMarkupLM)rh   ZMask2Former)ri   Z
MaskFormer)rj   ZMaskFormerSwin)ZmatchaZMatCha)rk   ZmBART)Zmbart50zmBART-50)rl   zM-CTC-T)rm   ZMEGA)rn   zMegatron-BERT)Zmegatron_gpt2zMegatron-GPT2)ro   zMGP-STR)ZmlukeZmLUKE)mmsZMMS)rp   Z
MobileBERT)rq   ZMobileNetV1)rr   ZMobileNetV2)rs   Z	MobileViT)rt   ZMobileViTV2)ru   ZMPNet)rv   ZMT5)rw   ZMVP)rx   ZNAT)ry   ZNezha)ZnllbZNLLB)rz   zNLLB-MOE)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)ZphobertZPhoBERT)r   Z
Pix2Struct)r   ZPLBart)r   Z
PoolFormer)r   Z
ProphetNet)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)Z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	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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YOSO))r~   Zopenai)r,   data2vec)r-   r   )r.   r   )r8   Zdonut)rj   ri   )r   Zx_clipc                 C   s   | t v rt |  S | ddS )z2Converts a config key to the corresponding module.-_)!SPECIAL_MODEL_TYPE_TO_MODULE_NAMEreplace)key r   t/var/www/html/stable-diffusion-webui/venv/lib/python3.9/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                   @   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 )_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 v r| j | S || jvr&t|| j| }t|}|| jv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>      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     r   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 v p|| jv S r   )r   r   r   itemr   r   r   __contains__  s    z_LazyConfigMapping.__contains__c                 C   s,   || j  v r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   r   r   r   register  s    z_LazyConfigMapping.registerN)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     s    z _LazyLoadAllMappings.__getitem__c                 C   s   |    | j S r   r  r  r   r   r   r   r   r     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     s    z_LazyLoadAllMappings.__iter__c                 C   s   |    || jv S r   r  r   r   r   r   r     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 urd| dqS )N[``]r   )r   cr   r   r   r     r   z#_get_class_name.<locals>.<listcomp>r  r  )
isinstancer   tuplejoinr  r   r   r   _get_class_name  s    r  Tc                    s   |d u r|st d|rd|d u 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>  r   z'_list_model_options.<locals>.<dictcomp>c                 S   s"   i | ]\}}|t v r|t|qS r   )MODEL_NAMES_MAPPINGr  )r   r	  r  r   r   r   r    s   c              
      s0   g | ](}  d | d|  dt |  dqS )z- **z** --  ( model)r  )r   r	  )indentmodel_type_to_namer   r   r     s   z'_list_model_options.<locals>.<listcomp>c                 S   s&   i | ]\}}|t v rt | t|qS r   )r   r  )r   r   Zclasr   r   r   r    s   c                 S   s   i | ]\}}|t | qS r   r  r  r   r   r   r    s   c              
      s0   g | ](} d | d|  d |  dqS )z- [`z`] configuration class: r  r  r   )r   Zconfig_name)config_to_model_nameconfig_to_namer  r   r   r   !  s   
)r   r   r   sortedr   r  )r  config_to_classuse_model_typeslinesr   )r  r   r  r  r   _list_model_options  s*    

r&  c                    s    fdd}|S )Nc                    s   | j }|d}d}|t|k r>td|| d u 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%  ir  r(  r   r   docstring_decorator*  s$    
 

z>replace_list_option_in_docstrings.<locals>.docstring_decoratorr   )r#  r$  r0  r   r(  r   !replace_list_option_in_docstrings)  s    r1  c                   @   sH   e Zd ZdZdd ZeedddZee dd Z	e
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   I  s    zAutoConfig.__init__)r	  c                 O   s@   |t v rt | }||i |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_modelO  s    zAutoConfig.for_modelc              
   K   s8  d|d< ||d< | dd}tj|fi |\}}d|v oDd|d v }d|v oX|d tv }t||||}|r|r|d d }t||fi |}	| d	d}
|	j|fi |S d|v rt|d  }	|	j|fi |S tt	 t
dd
D ]*}|t|v rt| j|fi |  S qt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}
        ```TZ
_from_autoZname_or_pathtrust_remote_codeNZauto_mapr2  r	  Zcode_revision)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: r4  )popr   Zget_config_dictr   r   r   from_pretrained	from_dictr"  r   r*  strr   r	   r  )r   Zpretrained_model_name_or_pathr6  r9  Zconfig_dictZunused_kwargsZhas_remote_codeZhas_local_codeZ	class_refr7  r   patternr   r   r   r<  X  s6    UzAutoConfig.from_pretrainedc                 C   s<   t |tr,|j| kr,td|j d|  dt| | 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!N)
issubclassr   r	  r   r   r   )r	  r   r   r   r   r     s    	zAutoConfig.registerN)r   r   r   r  r   classmethodr>  r8  r1  r<  staticmethodr   r   r   r   r   r2  A  s   rr2  )NT)NT)#r  r   r+  r  collectionsr   typingr   r   Zconfiguration_utilsr   Zdynamic_module_utilsr   r   utilsr	   r
   Z
get_loggerr   loggerr   Z CONFIG_ARCHIVE_MAP_MAPPING_NAMESr  r   r   r   r   r   r  Z!ALL_PRETRAINED_CONFIG_ARCHIVE_MAPr>  r  r&  r1  r2  r   r   r   r   <module>   sD   
 D 1 `	38
!
