o
    h                     @   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g d	Zeg d
Zeg dZ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de	e ee  f f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))albertAlbertConfig)alignAlignConfig)altclipAltCLIPConfig)audio-spectrogram-transformer	ASTConfig)
autoformerAutoformerConfig)bark
BarkConfig)bart
BartConfig)beit
BeitConfig)bert
BertConfig)bert-generationBertGenerationConfig)big_birdBigBirdConfig)bigbird_pegasusBigBirdPegasusConfig)biogptBioGptConfig)bit	BitConfig)
blenderbotBlenderbotConfig)blenderbot-smallBlenderbotSmallConfig)blip
BlipConfig)blip-2Blip2Config)bloomBloomConfig)bridgetowerBridgeTowerConfig)bros
BrosConfig)	camembertCamembertConfig)canineCanineConfig)chinese_clipChineseCLIPConfig)clap
ClapConfig)clip
CLIPConfig)clip_vision_modelCLIPVisionConfig)clipsegCLIPSegConfig)clvp
ClvpConfig)
code_llamaLlamaConfig)codegenCodeGenConfig)conditional_detrConditionalDetrConfig)convbertConvBertConfig)convnextConvNextConfig)
convnextv2ConvNextV2Config)cpmantCpmAntConfig)ctrl
CTRLConfig)cvt	CvtConfig)data2vec-audioData2VecAudioConfig)data2vec-textData2VecTextConfig)data2vec-visionData2VecVisionConfig)debertaDebertaConfig)
deberta-v2DebertaV2Config)decision_transformerDecisionTransformerConfig)deformable_detrDeformableDetrConfig)deit
DeiTConfig)deta
DetaConfig)detr
DetrConfig)dinatDinatConfig)dinov2Dinov2Config)
distilbertDistilBertConfig)
donut-swinDonutSwinConfig)dpr	DPRConfig)dpt	DPTConfig)efficientformerEfficientFormerConfig)efficientnetEfficientNetConfig)electraElectraConfig)encodecEncodecConfig)encoder-decoderEncoderDecoderConfig)ernieErnieConfig)ernie_mErnieMConfig)esm	EsmConfig)falconFalconConfig)flaubertFlaubertConfig)flavaFlavaConfig)fnet
FNetConfig)focalnetFocalNetConfig)fsmt
FSMTConfig)funnelFunnelConfig)fuyu
FuyuConfig)git	GitConfig)glpn
GLPNConfig)gpt-sw3
GPT2Config)gpt2r   )gpt_bigcodeGPTBigCodeConfig)gpt_neoGPTNeoConfig)gpt_neoxGPTNeoXConfig)gpt_neox_japaneseGPTNeoXJapaneseConfig)gptj
GPTJConfig)gptsan-japaneseGPTSanJapaneseConfig)
graphormerGraphormerConfig)groupvitGroupViTConfig)hubertHubertConfig)ibertIBertConfig)ideficsIdeficsConfig)imagegptImageGPTConfig)informerInformerConfig)instructblipInstructBlipConfig)jukeboxJukeboxConfig)kosmos-2Kosmos2Config)layoutlmLayoutLMConfig)
layoutlmv2LayoutLMv2Config)
layoutlmv3LayoutLMv3Config)led	LEDConfig)levitLevitConfig)lilt
LiltConfig)llamarF   )llavaLlavaConfig)
longformerLongformerConfig)longt5LongT5Config)luke
LukeConfig)lxmertLxmertConfig)m2m_100M2M100Config)marianMarianConfig)markuplmMarkupLMConfig)mask2formerMask2FormerConfig)
maskformerMaskFormerConfig)maskformer-swinMaskFormerSwinConfig)mbartMBartConfig)mctctMCTCTConfig)mega
MegaConfig)megatron-bertMegatronBertConfig)mgp-strMgpstrConfig)mistralMistralConfig)mixtralMixtralConfig)
mobilebertMobileBertConfig)mobilenet_v1MobileNetV1Config)mobilenet_v2MobileNetV2Config)	mobilevitMobileViTConfig)mobilevitv2MobileViTV2Config)mpnetMPNetConfig)mpt	MptConfig)mra	MraConfig)mt5	MT5Config)musicgenMusicgenConfig)mvp	MvpConfig)nat	NatConfig)nezhaNezhaConfig)nllb-moeNllbMoeConfig)nougatVisionEncoderDecoderConfig)nystromformerNystromformerConfig)	oneformerOneFormerConfig)
open-llamaOpenLlamaConfig)
openai-gptOpenAIGPTConfig)opt	OPTConfig)owlv2Owlv2Config)owlvitOwlViTConfig)patchtsmixerPatchTSMixerConfig)patchtstPatchTSTConfig)pegasusPegasusConfig)	pegasus_xPegasusXConfig)	perceiverPerceiverConfig)	persimmonPersimmonConfig)phi	PhiConfig)
pix2structPix2StructConfig)plbartPLBartConfig)
poolformerPoolFormerConfig)	pop2pianoPop2PianoConfig)
prophetnetProphetNetConfig)pvt	PvtConfig)qdqbertQDQBertConfig)rag	RagConfig)realmRealmConfig)reformerReformerConfig)regnetRegNetConfig)rembertRemBertConfig)resnetResNetConfig)	retribertRetriBertConfig)robertaRobertaConfig)roberta-prelayernormRobertaPreLayerNormConfig)roc_bertRoCBertConfig)roformerRoFormerConfig)rwkv
RwkvConfig)sam	SamConfig)seamless_m4tSeamlessM4TConfig)seamless_m4t_v2SeamlessM4Tv2Config)	segformerSegformerConfig)sew	SEWConfig)sew-d
SEWDConfig)speech-encoder-decoderSpeechEncoderDecoderConfig)speech_to_textSpeech2TextConfig)speech_to_text_2Speech2Text2Config)speecht5SpeechT5Config)splinterSplinterConfig)squeezebertSqueezeBertConfig)swiftformerSwiftFormerConfig)swin
SwinConfig)swin2srSwin2SRConfig)swinv2Swinv2Config)switch_transformersSwitchTransformersConfig)t5T5Config)table-transformerTableTransformerConfig)tapasTapasConfig)time_series_transformerTimeSeriesTransformerConfig)timesformerTimesformerConfig)timm_backboneTimmBackboneConfig)trajectory_transformerTrajectoryTransformerConfig)
transfo-xlTransfoXLConfig)trocrTrOCRConfig)tvlt
TvltConfig)tvp	TvpConfig)umt5
UMT5Config)	unispeechUniSpeechConfig)unispeech-satUniSpeechSatConfig)univnetUnivNetConfig)upernetUperNetConfig)van	VanConfig)videomaeVideoMAEConfig)vilt
ViltConfig)vision-encoder-decoderr  )vision-text-dual-encoderVisionTextDualEncoderConfig)visual_bertVisualBertConfig)vit	ViTConfig)
vit_hybridViTHybridConfig)vit_maeViTMAEConfig)vit_msnViTMSNConfig)vitdetVitDetConfig)vitmatteVitMatteConfig)vits
VitsConfig)vivitVivitConfig)wav2vec2Wav2Vec2Config)wav2vec2-conformerWav2Vec2ConformerConfig)wavlmWavLMConfig)whisperWhisperConfig)xclipXCLIPConfig)xglm
XGLMConfig)xlm	XLMConfig)xlm-prophetnetXLMProphetNetConfig)xlm-robertaXLMRobertaConfig)xlm-roberta-xlXLMRobertaXLConfig)xlnetXLNetConfig)xmod
XmodConfig)yolosYolosConfig)yoso
YosoConfig))r   $ALBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r   ;AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   (AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "BARK_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "BART_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &BIG_BIRD_PRETRAINED_CONFIG_ARCHIVE_MAP)r!   -BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP)r#   $BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r%   !BIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r'   (BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP)r)   .BLENDERBOT_SMALL_PRETRAINED_CONFIG_ARCHIVE_MAP)r+   "BLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r-   $BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP)r/   #BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP)r1   )BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP)r3   "BROS_PRETRAINED_CONFIG_ARCHIVE_MAP)r5   'CAMEMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r7   $CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP)r9   *CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r;   "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST)r=   "CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)rA   %CLIPSEG_PRETRAINED_CONFIG_ARCHIVE_MAP)rC   "CLVP_PRETRAINED_CONFIG_ARCHIVE_MAP)rG   %CODEGEN_PRETRAINED_CONFIG_ARCHIVE_MAP)rI   .CONDITIONAL_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)rK   &CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rM   &CONVNEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)rO   (CONVNEXTV2_PRETRAINED_CONFIG_ARCHIVE_MAP)rQ   $CPMANT_PRETRAINED_CONFIG_ARCHIVE_MAP)rS   "CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP)rU   !CVT_PRETRAINED_CONFIG_ARCHIVE_MAP)rW   ,DATA2VEC_AUDIO_PRETRAINED_CONFIG_ARCHIVE_MAP)rY   +DATA2VEC_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)r[   -DATA2VEC_VISION_PRETRAINED_CONFIG_ARCHIVE_MAP)r]   %DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)r_   (DEBERTA_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)rc   -DEFORMABLE_DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)re   "DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP)rg   "DETA_PRETRAINED_CONFIG_ARCHIVE_MAP)ri   "DETR_PRETRAINED_CONFIG_ARCHIVE_MAP)rk   #DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP)rm   $DINOV2_PRETRAINED_CONFIG_ARCHIVE_MAP)ro   (DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rq   (DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP)rs   !DPR_PRETRAINED_CONFIG_ARCHIVE_MAP)ru   !DPT_PRETRAINED_CONFIG_ARCHIVE_MAP)rw   -EFFICIENTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)ry   *EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r{   %ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP)r}   %ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #ERNIE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %ERNIE_M_PRETRAINED_CONFIG_ARCHIVE_MAP)r   !ESM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   $FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #FLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "FNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "FSMT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   $FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "FUYU_PRETRAINED_CONFIG_ARCHIVE_MAP)r   !GIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "GLPN_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   )GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &GPT_NEOX_PRETRAINED_CONFIG_ARCHIVE_MAP)r   /GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP)r   -GPTSAN_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   (GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   $HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %IDEFICS_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &INFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   *INSTRUCTBLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %KOSMOS2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &LAYOUTLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   (LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   (LAYOUTLMV3_PRETRAINED_CONFIG_ARCHIVE_MAP)r   !LED_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "LILT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #LLAVA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   (LONGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   $LONGT5_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP)r   $LXMERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %M2M_100_PRETRAINED_CONFIG_ARCHIVE_MAP)r   &MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r   )MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   (MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #MBART_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   "MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP)r   +MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %MISTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP)r   %MIXTRAL_PRETRAINED_CONFIG_ARCHIVE_MAP)r   *MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP)r   *MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   'MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   )MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r   #MPNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r   !MPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r   !MRA_PRETRAINED_CONFIG_ARCHIVE_MAP)r  &MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !MVP_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !NAT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  #NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP)r	  &NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP)r  +NYSTROMFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r  'ONEFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r  (OPEN_LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP)r  (OPENAI_GPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !OPT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  #OWLV2_PRETRAINED_CONFIG_ARCHIVE_MAP)r  $OWLVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  *PATCHTSMIXER_PRETRAINED_CONFIG_ARCHIVE_MAP)r  &PATCHTST_PRETRAINED_CONFIG_ARCHIVE_MAP)r  %PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP)r!  'PEGASUS_X_PRETRAINED_CONFIG_ARCHIVE_MAP)r#  'PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP)r%  'PERSIMMON_PRETRAINED_CONFIG_ARCHIVE_MAP)r'  !PHI_PRETRAINED_CONFIG_ARCHIVE_MAP)r)  (PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP)r+  $PLBART_PRETRAINED_CONFIG_ARCHIVE_MAP)r-  (POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r/  'POP2PIANO_PRETRAINED_CONFIG_ARCHIVE_MAP)r1  (PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r3  !PVT_PRETRAINED_CONFIG_ARCHIVE_MAP)r5  %QDQBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r9  #REALM_PRETRAINED_CONFIG_ARCHIVE_MAP)r=  $REGNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r?  %REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rA  $RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP)rC  'RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rE  %ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)rG  2ROBERTA_PRELAYERNORM_PRETRAINED_CONFIG_ARCHIVE_MAP)rI  &ROC_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rK  &ROFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rM  "RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP)rO  !SAM_PRETRAINED_CONFIG_ARCHIVE_MAP)rQ  *SEAMLESS_M4T_PRETRAINED_CONFIG_ARCHIVE_MAP)rS  -SEAMLESS_M4T_V2_PRETRAINED_CONFIG_ARCHIVE_MAP)rU  'SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)rW  !SEW_PRETRAINED_CONFIG_ARCHIVE_MAP)rY  #SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP)r]  ,SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP)r_  .SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP)ra  &SPEECHT5_PRETRAINED_CONFIG_ARCHIVE_MAP)rc  &SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP)re  )SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP)rg  )SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)ri  "SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP)rk  %SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP)rm  $SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP)ro  1SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP)rq   T5_PRETRAINED_CONFIG_ARCHIVE_MAP)rs  /TABLE_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)ru  #TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP)rw  5TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)ry  )TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r  (TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP)r  "TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !TVP_PRETRAINED_CONFIG_ARCHIVE_MAP)r  'UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP)r  +UNISPEECH_SAT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  %UNIVNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !VAN_PRETRAINED_CONFIG_ARCHIVE_MAP)r  &VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP)r  "VILT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  )VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !VIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  (VIT_HYBRID_PRETRAINED_CONFIG_ARCHIVE_MAP)r  %VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP)r  %VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP)r  $VITDET_PRETRAINED_CONFIG_ARCHIVE_MAP)r  &VITMATTE_PRETRAINED_CONFIG_ARCHIVE_MAP)r  "VITS_PRETRAINED_CONFIG_ARCHIVE_MAP)r  #VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP)r  )WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP)r  0WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP)r  %WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP)r  #XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP)r  "XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r  !XLM_PRETRAINED_CONFIG_ARCHIVE_MAP)r  ,XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r  )XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP)r  #XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP)r  "XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP)r  #YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP)r  "YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP))r   ALBERT)r   ALIGN)r   AltCLIP)r   zAudio Spectrogram Transformer)r   
Autoformer)r   Bark)r   BART)barthezBARThez)bartphoBARTpho)r   BEiT)r   BERT)r   zBert Generation)zbert-japaneseBertJapanese)bertweetBERTweet)r   BigBird)r!   zBigBird-Pegasus)r#   BioGpt)r%   BiT)r'   
Blenderbot)r)   BlenderbotSmall)r+   BLIP)r-   zBLIP-2)r/   BLOOM)bortBORT)r1   BridgeTower)r3   BROS)byt5ByT5)r5   	CamemBERT)r7   CANINE)r9   zChinese-CLIP)r;   CLAP)r=   CLIP)r?   CLIPVisionModel)rA   CLIPSeg)rC   CLVP)rE   	CodeLlama)rG   CodeGen)rI   zConditional DETR)rK   ConvBERT)rM   ConvNeXT)rO   
ConvNeXTV2)cpmCPM)rQ   zCPM-Ant)rS   CTRL)rU   CvT)rW   Data2VecAudio)rY   Data2VecText)r[   Data2VecVision)r]   DeBERTa)r_   z
DeBERTa-v2)ra   zDecision Transformer)rc   zDeformable DETR)re   DeiT)deplotDePlot)rg   DETA)ri   DETR)dialogptDialoGPT)rk   DiNAT)rm   DINOv2)ro   
DistilBERT)ditDiT)rq   	DonutSwin)rs   DPR)ru   DPT)rw   EfficientFormer)ry   EfficientNet)r{   ELECTRA)r}   EnCodec)r   zEncoder decoder)r   ERNIE)r   ErnieM)r   ESM)r   Falcon)zflan-t5zFLAN-T5)zflan-ul2zFLAN-UL2)r   FlauBERT)r   FLAVA)r   FNet)r   FocalNet)r   zFairSeq Machine-Translation)r   zFunnel Transformer)r   Fuyu)r   GIT)r   GLPN)r   zGPT-Sw3)r   zOpenAI GPT-2)r   
GPTBigCode)r   zGPT Neo)r   zGPT NeoX)r   zGPT NeoX Japanese)r   zGPT-J)r   zGPTSAN-japanese)r   
Graphormer)r   GroupViT)herbertHerBERT)r   Hubert)r   zI-BERT)r   IDEFICS)r   ImageGPT)r   Informer)r   InstructBLIP)r   Jukebox)r   zKOSMOS-2)r   LayoutLM)r   
LayoutLMv2)r   
LayoutLMv3)	layoutxlm	LayoutXLM)r   LED)r   LeViT)r   LiLT)r   LLaMA)llama2Llama2)r   LLaVa)r   
Longformer)r   LongT5)r   LUKE)r   LXMERT)r   M2M100)z
madlad-400z
MADLAD-400)r   Marian)r   MarkupLM)r   Mask2Former)r   
MaskFormer)r   MaskFormerSwin)matchaMatCha)r   mBART)mbart50zmBART-50)r   zM-CTC-T)r   MEGA)r   zMegatron-BERT)megatron_gpt2zMegatron-GPT2)r   zMGP-STR)r   Mistral)r   Mixtral)mlukemLUKE)mmsMMS)r   
MobileBERT)r   MobileNetV1)r   MobileNetV2)r   	MobileViT)r   MobileViTV2)r   MPNet)r   MPT)r   MRA)r   MT5)r  MusicGen)r  MVP)r  NAT)r  Nezha)nllbNLLB)r	  zNLLB-MOE)r  Nougat)r  u   Nyströmformer)r  	OneFormer)r  	OpenLlama)r  z
OpenAI GPT)r  OPT)r  OWLv2)r  zOWL-ViT)r  PatchTSMixer)r  PatchTST)r  Pegasus)r!  z	PEGASUS-X)r#  	Perceiver)r%  	Persimmon)r'  Phi)phobertPhoBERT)r)  
Pix2Struct)r+  PLBart)r-  
PoolFormer)r/  	Pop2Piano)r1  
ProphetNet)r3  PVT)r5  QDQBert)r7  RAG)r9  REALM)r;  Reformer)r=  RegNet)r?  RemBERT)rA  ResNet)rC  	RetriBERT)rE  RoBERTa)rG  zRoBERTa-PreLayerNorm)rI  RoCBert)rK  RoFormer)rM  RWKV)rO  SAM)rQ  SeamlessM4T)rS  SeamlessM4Tv2)rU  	SegFormer)rW  SEW)rY  zSEW-D)r[  zSpeech Encoder decoder)r]  Speech2Text)r_  Speech2Text2)ra  SpeechT5)rc  Splinter)re  SqueezeBERT)rg  SwiftFormer)ri  zSwin Transformer)rk  Swin2SR)rm  zSwin Transformer V2)ro  SwitchTransformers)rq  T5)zt5v1.1zT5v1.1)rs  zTable Transformer)ru  TAPAS)tapexTAPEX)rw  zTime Series Transformer)ry  TimeSformer)r{  TimmBackbone)r}  zTrajectory Transformer)r  zTransformer-XL)r  TrOCR)r  TVLT)r  TVP)ul2UL2)r  UMT5)r  	UniSpeech)r  UniSpeechSat)r  UnivNet)r  UPerNet)r  VAN)r  VideoMAE)r  ViLT)r  zVision Encoder decoder)r  VisionTextDualEncoder)r  
VisualBERT)r  ViT)r  z
ViT Hybrid)r  ViTMAE)r  ViTMSN)r  VitDet)r  ViTMatte)r  VITS)r  ViViT)r  Wav2Vec2)r  zWav2Vec2-Conformer)wav2vec2_phonemeWav2Vec2Phoneme)r  WavLM)r  Whisper)r  zX-CLIP)r  XGLM)r  XLM)r  zXLM-ProphetNet)r  zXLM-RoBERTa)r  zXLM-RoBERTa-XL)zxlm-vzXLM-V)r  XLNet)xls_rzXLS-R)xlsr_wav2vec2zXLSR-Wav2Vec2)r  zX-MOD)r  YOLOS)r  YOSO)	r  r   mmbt
open_llamarC  rI  r}  
transfo_xlr  )	)r  openai)rW   data2vec)rY   rs  )r[   rs  )rq   donut)r   kosmos2)r   r   )r  x_clip)r?   r=   c                 C   s2   | t v rt |  S | dd} | tv rd|  } | S )z2Converts a config key to the corresponding module.-_zdeprecated.)!SPECIAL_MODEL_TYPE_TO_MODULE_NAMEreplaceDEPRECATED_MODELS)key r}  a/var/www/html/ai/venv/lib/python3.10/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__     
z_LazyConfigMapping.__init__c                 C   s   || j v r
| j | S || jvrt|| j| }t|}|| jvr-td| d| j|< t| j| |r=t| j| |S td}t||S )N.transformers.modelstransformers)	r  r  KeyErrorr  r  	importlibimport_modulehasattrgetattr)r  r|  valuemodule_name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                    &    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  +     &z_LazyConfigMapping.valuesc                    r  )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  .  r  z_LazyConfigMapping.itemsc                 C   s    t t| j t| j  S r  )iterr  r  r  r  r  r}  r}  r~  __iter__1  s    z_LazyConfigMapping.__iter__c                 C   s   || j v p	|| jv S r  )r  r  r  itemr}  r}  r~  __contains__4  s   z_LazyConfigMapping.__contains__Fc                 C   s0   || j  v 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~  register7  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  L  r  z_LazyLoadAllMappings.__init__c                 C   sd   | j rd S tdt | j D ]\}}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_typemap_namer  moduler  r}  r}  r~  _initializeQ  s   

z _LazyLoadAllMappings._initializec                 C   s   |    | j| S r  r  r  )r  r|  r}  r}  r~  r  b     
z _LazyLoadAllMappings.__getitem__c                 C      |    | j S r  r  r  r  r  r}  r}  r~  r  f  r  z_LazyLoadAllMappings.keysc                 C   r  r  )r  r  r  r  r}  r}  r~  r  j  r  z_LazyLoadAllMappings.valuesc                 C   r  r  r  r  r}  r}  r~  r  n  r  z_LazyLoadAllMappings.itemsc                 C   s   |    t| jS r  )r  r  r  r  r}  r}  r~  r  r  r  z_LazyLoadAllMappings.__iter__c                 C   s   |    || jv S r  r  r  r}  r}  r~  r  v  r  z!_LazyLoadAllMappings.__contains__N)r  r  r  r  r  r  r  r  r  r  r  r  r}  r}  r}  r~  r  C  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    s     z#_get_class_name.<locals>.<listcomp>r  r  )
isinstancer  tuplejoin)r  r}  r}  r~  _get_class_name~  s   r  Tc                    s   |d u r
|s
t d|r2|d u rdd t D n	dd | D fddt D }n!d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>  s    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  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  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 }|t|k r.td|| d u s|t|k rVtd||  d }rG| 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  )fn
docstringsr  ir  r  r}  r~  docstring_decorator  s&   
  
z>replace_list_option_in_docstrings.<locals>.docstring_decoratorr}  )r  r  r  r}  r  r~  !replace_list_option_in_docstrings  s   r  c                   @   sJ   e Zd ZdZdd Zedef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)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 v rt | }||i |S td| ddt   )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ur tdt |dddurtd||d< d|d< ||d< | d	d}| d
d}tj|fi |\}}d|v oHd|d v }d|v oR|d tv }	t	|||	|}|r|r|d d }
t
|
|fd
|i|}tj|ry|  |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  )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_tokenNzrThe `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.tokenzV`token` and `use_auth_token` are both specified. Please set only the argument `token`.T
_from_autoname_or_pathtrust_remote_codecode_revisionauto_mapr  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: r  )popr  r  r  getr  r   get_config_dictr  r   r   ospathisdirregister_for_auto_classfrom_pretrained	from_dictr  r  r  strr	   r  )r  pretrained_model_name_or_pathr  r  r  r  config_dictunused_kwargshas_remote_codehas_local_code	class_refr  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  Y  s   	zAutoConfig.registerNr  )r  r  r  r  r  classmethodr  r  r  r  staticmethodr  r}  r}  r}  r~  r    s     r  )NT)%r  r  r  r  r  collectionsr   typingr   r   configuration_utilsr   dynamic_module_utilsr   r   utilsr	   r
   
get_loggerr  loggerr   CONFIG_ARCHIVE_MAP_MAPPING_NAMESr  r{  ry  r  r  r  r  r  !ALL_PRETRAINED_CONFIG_ARCHIVE_MAPr  r  r  r  r  r}  r}  r}  r~  <module>   sL   
 g P  38

!