# AutoConfig

### AutoConfig

#### class transformers.AutoConfig

[\<source>](https://github.com/huggingface/transformers/blob/v4.34.1/src/transformers/models/auto/configuration_auto.py#L910)

( )

This is a generic configuration class that will be instantiated as one of the configuration classes of the library when created with the [from\_pretrained()](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/auto#transformers.AutoConfig.from_pretrained) class method.

This class cannot be instantiated directly using `__init__()` (throws an error).

**from\_pretrained**

[\<source>](https://github.com/huggingface/transformers/blob/v4.34.1/src/transformers/models/auto/configuration_auto.py#L933)

( pretrained\_model\_name\_or\_path\*\*kwargs )

Parameters

* **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 [save\_pretrained()](https://huggingface.co/docs/transformers/v4.34.1/en/main_classes/configuration#transformers.PretrainedConfig.save_pretrained) method, or the [save\_pretrained()](https://huggingface.co/docs/transformers/v4.34.1/en/main_classes/model#transformers.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.

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`:

* **albert** — [AlbertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/albert#transformers.AlbertConfig) (ALBERT model)
* **align** — [AlignConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/align#transformers.AlignConfig) (ALIGN model)
* **altclip** — [AltCLIPConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/altclip#transformers.AltCLIPConfig) (AltCLIP model)
* **audio-spectrogram-transformer** — [ASTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/audio-spectrogram-transformer#transformers.ASTConfig) (Audio Spectrogram Transformer model)
* **autoformer** — [AutoformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/autoformer#transformers.AutoformerConfig) (Autoformer model)
* **bark** — [BarkConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bark#transformers.BarkConfig) (Bark model)
* **bart** — [BartConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bart#transformers.BartConfig) (BART model)
* **beit** — [BeitConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/beit#transformers.BeitConfig) (BEiT model)
* **bert** — [BertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bert#transformers.BertConfig) (BERT model)
* **bert-generation** — [BertGenerationConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bert-generation#transformers.BertGenerationConfig) (Bert Generation model)
* **big\_bird** — [BigBirdConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/big_bird#transformers.BigBirdConfig) (BigBird model)
* **bigbird\_pegasus** — [BigBirdPegasusConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bigbird_pegasus#transformers.BigBirdPegasusConfig) (BigBird-Pegasus model)
* **biogpt** — [BioGptConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/biogpt#transformers.BioGptConfig) (BioGpt model)
* **bit** — [BitConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bit#transformers.BitConfig) (BiT model)
* **blenderbot** — [BlenderbotConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/blenderbot#transformers.BlenderbotConfig) (Blenderbot model)
* **blenderbot-small** — [BlenderbotSmallConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/blenderbot-small#transformers.BlenderbotSmallConfig) (BlenderbotSmall model)
* **blip** — [BlipConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/blip#transformers.BlipConfig) (BLIP model)
* **blip-2** — [Blip2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/blip-2#transformers.Blip2Config) (BLIP-2 model)
* **bloom** — [BloomConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bloom#transformers.BloomConfig) (BLOOM model)
* **bridgetower** — [BridgeTowerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bridgetower#transformers.BridgeTowerConfig) (BridgeTower model)
* **bros** — [BrosConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/bros#transformers.BrosConfig) (BROS model)
* **camembert** — [CamembertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/camembert#transformers.CamembertConfig) (CamemBERT model)
* **canine** — [CanineConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/canine#transformers.CanineConfig) (CANINE model)
* **chinese\_clip** — [ChineseCLIPConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig) (Chinese-CLIP model)
* **clap** — [ClapConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/clap#transformers.ClapConfig) (CLAP model)
* **clip** — [CLIPConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/clip#transformers.CLIPConfig) (CLIP model)
* **clipseg** — [CLIPSegConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/clipseg#transformers.CLIPSegConfig) (CLIPSeg model)
* **code\_llama** — [LlamaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/llama2#transformers.LlamaConfig) (CodeLlama model)
* **codegen** — [CodeGenConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/codegen#transformers.CodeGenConfig) (CodeGen model)
* **conditional\_detr** — [ConditionalDetrConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/conditional_detr#transformers.ConditionalDetrConfig) (Conditional DETR model)
* **convbert** — [ConvBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/convbert#transformers.ConvBertConfig) (ConvBERT model)
* **convnext** — [ConvNextConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/convnext#transformers.ConvNextConfig) (ConvNeXT model)
* **convnextv2** — [ConvNextV2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/convnextv2#transformers.ConvNextV2Config) (ConvNeXTV2 model)
* **cpmant** — [CpmAntConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/cpmant#transformers.CpmAntConfig) (CPM-Ant model)
* **ctrl** — [CTRLConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/ctrl#transformers.CTRLConfig) (CTRL model)
* **cvt** — [CvtConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/cvt#transformers.CvtConfig) (CvT model)
* **data2vec-audio** — [Data2VecAudioConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/data2vec#transformers.Data2VecAudioConfig) (Data2VecAudio model)
* **data2vec-text** — [Data2VecTextConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/data2vec#transformers.Data2VecTextConfig) (Data2VecText model)
* **data2vec-vision** — [Data2VecVisionConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/data2vec#transformers.Data2VecVisionConfig) (Data2VecVision model)
* **deberta** — [DebertaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/deberta#transformers.DebertaConfig) (DeBERTa model)
* **deberta-v2** — [DebertaV2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/deberta-v2#transformers.DebertaV2Config) (DeBERTa-v2 model)
* **decision\_transformer** — [DecisionTransformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/decision_transformer#transformers.DecisionTransformerConfig) (Decision Transformer model)
* **deformable\_detr** — [DeformableDetrConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/deformable_detr#transformers.DeformableDetrConfig) (Deformable DETR model)
* **deit** — [DeiTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/deit#transformers.DeiTConfig) (DeiT model)
* **deta** — [DetaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/deta#transformers.DetaConfig) (DETA model)
* **detr** — [DetrConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/detr#transformers.DetrConfig) (DETR model)
* **dinat** — [DinatConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/dinat#transformers.DinatConfig) (DiNAT model)
* **dinov2** — [Dinov2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/dinov2#transformers.Dinov2Config) (DINOv2 model)
* **distilbert** — [DistilBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/distilbert#transformers.DistilBertConfig) (DistilBERT model)
* **donut-swin** — [DonutSwinConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/donut#transformers.DonutSwinConfig) (DonutSwin model)
* **dpr** — [DPRConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/dpr#transformers.DPRConfig) (DPR model)
* **dpt** — [DPTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/dpt#transformers.DPTConfig) (DPT model)
* **efficientformer** — [EfficientFormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/efficientformer#transformers.EfficientFormerConfig) (EfficientFormer model)
* **efficientnet** — [EfficientNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/efficientnet#transformers.EfficientNetConfig) (EfficientNet model)
* **electra** — [ElectraConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/electra#transformers.ElectraConfig) (ELECTRA model)
* **encodec** — [EncodecConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/encodec#transformers.EncodecConfig) (EnCodec model)
* **encoder-decoder** — [EncoderDecoderConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/encoder-decoder#transformers.EncoderDecoderConfig) (Encoder decoder model)
* **ernie** — [ErnieConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/ernie#transformers.ErnieConfig) (ERNIE model)
* **ernie\_m** — [ErnieMConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/ernie_m#transformers.ErnieMConfig) (ErnieM model)
* **esm** — [EsmConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/esm#transformers.EsmConfig) (ESM model)
* **falcon** — [FalconConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/falcon#transformers.FalconConfig) (Falcon model)
* **flaubert** — [FlaubertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/flaubert#transformers.FlaubertConfig) (FlauBERT model)
* **flava** — [FlavaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/flava#transformers.FlavaConfig) (FLAVA model)
* **fnet** — [FNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/fnet#transformers.FNetConfig) (FNet model)
* **focalnet** — [FocalNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/focalnet#transformers.FocalNetConfig) (FocalNet model)
* **fsmt** — [FSMTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/fsmt#transformers.FSMTConfig) (FairSeq Machine-Translation model)
* **funnel** — [FunnelConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/funnel#transformers.FunnelConfig) (Funnel Transformer model)
* **git** — [GitConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/git#transformers.GitConfig) (GIT model)
* **glpn** — [GLPNConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/glpn#transformers.GLPNConfig) (GLPN model)
* **gpt-sw3** — [GPT2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gpt2#transformers.GPT2Config) (GPT-Sw3 model)
* **gpt2** — [GPT2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gpt2#transformers.GPT2Config) (OpenAI GPT-2 model)
* **gpt\_bigcode** — [GPTBigCodeConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gpt_bigcode#transformers.GPTBigCodeConfig) (GPTBigCode model)
* **gpt\_neo** — [GPTNeoConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gpt_neo#transformers.GPTNeoConfig) (GPT Neo model)
* **gpt\_neox** — [GPTNeoXConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gpt_neox#transformers.GPTNeoXConfig) (GPT NeoX model)
* **gpt\_neox\_japanese** — [GPTNeoXJapaneseConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseConfig) (GPT NeoX Japanese model)
* **gptj** — [GPTJConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gptj#transformers.GPTJConfig) (GPT-J model)
* **gptsan-japanese** — [GPTSanJapaneseConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/gptsan-japanese#transformers.GPTSanJapaneseConfig) (GPTSAN-japanese model)
* **graphormer** — [GraphormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/graphormer#transformers.GraphormerConfig) (Graphormer model)
* **groupvit** — [GroupViTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/groupvit#transformers.GroupViTConfig) (GroupViT model)
* **hubert** — [HubertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/hubert#transformers.HubertConfig) (Hubert model)
* **ibert** — [IBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/ibert#transformers.IBertConfig) (I-BERT model)
* **idefics** — [IdeficsConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/idefics#transformers.IdeficsConfig) (IDEFICS model)
* **imagegpt** — [ImageGPTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/imagegpt#transformers.ImageGPTConfig) (ImageGPT model)
* **informer** — [InformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/informer#transformers.InformerConfig) (Informer model)
* **instructblip** — [InstructBlipConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/instructblip#transformers.InstructBlipConfig) (InstructBLIP model)
* **jukebox** — [JukeboxConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/jukebox#transformers.JukeboxConfig) (Jukebox model)
* **layoutlm** — [LayoutLMConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/layoutlm#transformers.LayoutLMConfig) (LayoutLM model)
* **layoutlmv2** — [LayoutLMv2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/layoutlmv2#transformers.LayoutLMv2Config) (LayoutLMv2 model)
* **layoutlmv3** — [LayoutLMv3Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/layoutlmv3#transformers.LayoutLMv3Config) (LayoutLMv3 model)
* **led** — [LEDConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/led#transformers.LEDConfig) (LED model)
* **levit** — [LevitConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/levit#transformers.LevitConfig) (LeViT model)
* **lilt** — [LiltConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/lilt#transformers.LiltConfig) (LiLT model)
* **llama** — [LlamaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/llama2#transformers.LlamaConfig) (LLaMA model)
* **longformer** — [LongformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/longformer#transformers.LongformerConfig) (Longformer model)
* **longt5** — [LongT5Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/longt5#transformers.LongT5Config) (LongT5 model)
* **luke** — [LukeConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/luke#transformers.LukeConfig) (LUKE model)
* **lxmert** — [LxmertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/lxmert#transformers.LxmertConfig) (LXMERT model)
* **m2m\_100** — [M2M100Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/m2m_100#transformers.M2M100Config) (M2M100 model)
* **marian** — [MarianConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/marian#transformers.MarianConfig) (Marian model)
* **markuplm** — [MarkupLMConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/markuplm#transformers.MarkupLMConfig) (MarkupLM model)
* **mask2former** — [Mask2FormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mask2former#transformers.Mask2FormerConfig) (Mask2Former model)
* **maskformer** — [MaskFormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/maskformer#transformers.MaskFormerConfig) (MaskFormer model)
* **maskformer-swin** — `MaskFormerSwinConfig` (MaskFormerSwin model)
* **mbart** — [MBartConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mbart#transformers.MBartConfig) (mBART model)
* **mctct** — [MCTCTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mctct#transformers.MCTCTConfig) (M-CTC-T model)
* **mega** — [MegaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mega#transformers.MegaConfig) (MEGA model)
* **megatron-bert** — [MegatronBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/megatron-bert#transformers.MegatronBertConfig) (Megatron-BERT model)
* **mgp-str** — [MgpstrConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mgp-str#transformers.MgpstrConfig) (MGP-STR model)
* **mistral** — [MistralConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mistral#transformers.MistralConfig) (Mistral model)
* **mobilebert** — [MobileBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mobilebert#transformers.MobileBertConfig) (MobileBERT model)
* **mobilenet\_v1** — [MobileNetV1Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mobilenet_v1#transformers.MobileNetV1Config) (MobileNetV1 model)
* **mobilenet\_v2** — [MobileNetV2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mobilenet_v2#transformers.MobileNetV2Config) (MobileNetV2 model)
* **mobilevit** — [MobileViTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mobilevit#transformers.MobileViTConfig) (MobileViT model)
* **mobilevitv2** — [MobileViTV2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mobilevitv2#transformers.MobileViTV2Config) (MobileViTV2 model)
* **mpnet** — [MPNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mpnet#transformers.MPNetConfig) (MPNet model)
* **mpt** — [MptConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mpt#transformers.MptConfig) (MPT model)
* **mra** — [MraConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mra#transformers.MraConfig) (MRA model)
* **mt5** — [MT5Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mt5#transformers.MT5Config) (MT5 model)
* **musicgen** — [MusicgenConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/musicgen#transformers.MusicgenConfig) (MusicGen model)
* **mvp** — [MvpConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/mvp#transformers.MvpConfig) (MVP model)
* **nat** — [NatConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/nat#transformers.NatConfig) (NAT model)
* **nezha** — [NezhaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/nezha#transformers.NezhaConfig) (Nezha model)
* **nllb-moe** — [NllbMoeConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/nllb-moe#transformers.NllbMoeConfig) (NLLB-MOE model)
* **nougat** — [VisionEncoderDecoderConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vision-encoder-decoder#transformers.VisionEncoderDecoderConfig) (Nougat model)
* **nystromformer** — [NystromformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/nystromformer#transformers.NystromformerConfig) (Nyströmformer model)
* **oneformer** — [OneFormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/oneformer#transformers.OneFormerConfig) (OneFormer model)
* **open-llama** — [OpenLlamaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/open-llama#transformers.OpenLlamaConfig) (OpenLlama model)
* **openai-gpt** — [OpenAIGPTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/openai-gpt#transformers.OpenAIGPTConfig) (OpenAI GPT model)
* **opt** — [OPTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/opt#transformers.OPTConfig) (OPT model)
* **owlvit** — [OwlViTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/owlvit#transformers.OwlViTConfig) (OWL-ViT model)
* **pegasus** — [PegasusConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/pegasus#transformers.PegasusConfig) (Pegasus model)
* **pegasus\_x** — [PegasusXConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/pegasus_x#transformers.PegasusXConfig) (PEGASUS-X model)
* **perceiver** — [PerceiverConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/perceiver#transformers.PerceiverConfig) (Perceiver model)
* **persimmon** — [PersimmonConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/persimmon#transformers.PersimmonConfig) (Persimmon model)
* **pix2struct** — [Pix2StructConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/pix2struct#transformers.Pix2StructConfig) (Pix2Struct model)
* **plbart** — [PLBartConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/plbart#transformers.PLBartConfig) (PLBart model)
* **poolformer** — [PoolFormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/poolformer#transformers.PoolFormerConfig) (PoolFormer model)
* **pop2piano** — [Pop2PianoConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/pop2piano#transformers.Pop2PianoConfig) (Pop2Piano model)
* **prophetnet** — [ProphetNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/prophetnet#transformers.ProphetNetConfig) (ProphetNet model)
* **pvt** — [PvtConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/pvt#transformers.PvtConfig) (PVT model)
* **qdqbert** — [QDQBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/qdqbert#transformers.QDQBertConfig) (QDQBert model)
* **rag** — [RagConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/rag#transformers.RagConfig) (RAG model)
* **realm** — [RealmConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/realm#transformers.RealmConfig) (REALM model)
* **reformer** — [ReformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/reformer#transformers.ReformerConfig) (Reformer model)
* **regnet** — [RegNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/regnet#transformers.RegNetConfig) (RegNet model)
* **rembert** — [RemBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/rembert#transformers.RemBertConfig) (RemBERT model)
* **resnet** — [ResNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/resnet#transformers.ResNetConfig) (ResNet model)
* **retribert** — [RetriBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/retribert#transformers.RetriBertConfig) (RetriBERT model)
* **roberta** — [RobertaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/roberta#transformers.RobertaConfig) (RoBERTa model)
* **roberta-prelayernorm** — [RobertaPreLayerNormConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/roberta-prelayernorm#transformers.RobertaPreLayerNormConfig) (RoBERTa-PreLayerNorm model)
* **roc\_bert** — [RoCBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/roc_bert#transformers.RoCBertConfig) (RoCBert model)
* **roformer** — [RoFormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/roformer#transformers.RoFormerConfig) (RoFormer model)
* **rwkv** — [RwkvConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/rwkv#transformers.RwkvConfig) (RWKV model)
* **sam** — [SamConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/sam#transformers.SamConfig) (SAM model)
* **segformer** — [SegformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/segformer#transformers.SegformerConfig) (SegFormer model)
* **sew** — [SEWConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/sew#transformers.SEWConfig) (SEW model)
* **sew-d** — [SEWDConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/sew-d#transformers.SEWDConfig) (SEW-D model)
* **speech-encoder-decoder** — [SpeechEncoderDecoderConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/speech-encoder-decoder#transformers.SpeechEncoderDecoderConfig) (Speech Encoder decoder model)
* **speech\_to\_text** — [Speech2TextConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/speech_to_text#transformers.Speech2TextConfig) (Speech2Text model)
* **speech\_to\_text\_2** — [Speech2Text2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/speech_to_text_2#transformers.Speech2Text2Config) (Speech2Text2 model)
* **speecht5** — [SpeechT5Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/speecht5#transformers.SpeechT5Config) (SpeechT5 model)
* **splinter** — [SplinterConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/splinter#transformers.SplinterConfig) (Splinter model)
* **squeezebert** — [SqueezeBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/squeezebert#transformers.SqueezeBertConfig) (SqueezeBERT model)
* **swiftformer** — [SwiftFormerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/swiftformer#transformers.SwiftFormerConfig) (SwiftFormer model)
* **swin** — [SwinConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/swin#transformers.SwinConfig) (Swin Transformer model)
* **swin2sr** — [Swin2SRConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/swin2sr#transformers.Swin2SRConfig) (Swin2SR model)
* **swinv2** — [Swinv2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/swinv2#transformers.Swinv2Config) (Swin Transformer V2 model)
* **switch\_transformers** — [SwitchTransformersConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/switch_transformers#transformers.SwitchTransformersConfig) (SwitchTransformers model)
* **t5** — [T5Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/t5#transformers.T5Config) (T5 model)
* **table-transformer** — [TableTransformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/table-transformer#transformers.TableTransformerConfig) (Table Transformer model)
* **tapas** — [TapasConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/tapas#transformers.TapasConfig) (TAPAS model)
* **time\_series\_transformer** — [TimeSeriesTransformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/time_series_transformer#transformers.TimeSeriesTransformerConfig) (Time Series Transformer model)
* **timesformer** — [TimesformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/timesformer#transformers.TimesformerConfig) (TimeSformer model)
* **timm\_backbone** — `TimmBackboneConfig` (TimmBackbone model)
* **trajectory\_transformer** — [TrajectoryTransformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/trajectory_transformer#transformers.TrajectoryTransformerConfig) (Trajectory Transformer model)
* **transfo-xl** — [TransfoXLConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/transfo-xl#transformers.TransfoXLConfig) (Transformer-XL model)
* **trocr** — [TrOCRConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/trocr#transformers.TrOCRConfig) (TrOCR model)
* **tvlt** — [TvltConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/tvlt#transformers.TvltConfig) (TVLT model)
* **umt5** — [UMT5Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/umt5#transformers.UMT5Config) (UMT5 model)
* **unispeech** — [UniSpeechConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/unispeech#transformers.UniSpeechConfig) (UniSpeech model)
* **unispeech-sat** — [UniSpeechSatConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/unispeech-sat#transformers.UniSpeechSatConfig) (UniSpeechSat model)
* **upernet** — [UperNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/upernet#transformers.UperNetConfig) (UPerNet model)
* **van** — [VanConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/van#transformers.VanConfig) (VAN model)
* **videomae** — [VideoMAEConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/videomae#transformers.VideoMAEConfig) (VideoMAE model)
* **vilt** — [ViltConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vilt#transformers.ViltConfig) (ViLT model)
* **vision-encoder-decoder** — [VisionEncoderDecoderConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vision-encoder-decoder#transformers.VisionEncoderDecoderConfig) (Vision Encoder decoder model)
* **vision-text-dual-encoder** — [VisionTextDualEncoderConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vision-text-dual-encoder#transformers.VisionTextDualEncoderConfig) (VisionTextDualEncoder model)
* **visual\_bert** — [VisualBertConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/visual_bert#transformers.VisualBertConfig) (VisualBERT model)
* **vit** — [ViTConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vit#transformers.ViTConfig) (ViT model)
* **vit\_hybrid** — [ViTHybridConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vit_hybrid#transformers.ViTHybridConfig) (ViT Hybrid model)
* **vit\_mae** — [ViTMAEConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vit_mae#transformers.ViTMAEConfig) (ViTMAE model)
* **vit\_msn** — [ViTMSNConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vit_msn#transformers.ViTMSNConfig) (ViTMSN model)
* **vitdet** — [VitDetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vitdet#transformers.VitDetConfig) (VitDet model)
* **vitmatte** — [VitMatteConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vitmatte#transformers.VitMatteConfig) (ViTMatte model)
* **vits** — [VitsConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vits#transformers.VitsConfig) (VITS model)
* **vivit** — [VivitConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/vivit#transformers.VivitConfig) (ViViT model)
* **wav2vec2** — [Wav2Vec2Config](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/wav2vec2#transformers.Wav2Vec2Config) (Wav2Vec2 model)
* **wav2vec2-conformer** — [Wav2Vec2ConformerConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/wav2vec2-conformer#transformers.Wav2Vec2ConformerConfig) (Wav2Vec2-Conformer model)
* **wavlm** — [WavLMConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/wavlm#transformers.WavLMConfig) (WavLM model)
* **whisper** — [WhisperConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/whisper#transformers.WhisperConfig) (Whisper model)
* **xclip** — [XCLIPConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xclip#transformers.XCLIPConfig) (X-CLIP model)
* **xglm** — [XGLMConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xglm#transformers.XGLMConfig) (XGLM model)
* **xlm** — [XLMConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xlm#transformers.XLMConfig) (XLM model)
* **xlm-prophetnet** — [XLMProphetNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xlm-prophetnet#transformers.XLMProphetNetConfig) (XLM-ProphetNet model)
* **xlm-roberta** — [XLMRobertaConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xlm-roberta#transformers.XLMRobertaConfig) (XLM-RoBERTa model)
* **xlm-roberta-xl** — [XLMRobertaXLConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xlm-roberta-xl#transformers.XLMRobertaXLConfig) (XLM-RoBERTa-XL model)
* **xlnet** — [XLNetConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xlnet#transformers.XLNetConfig) (XLNet model)
* **xmod** — [XmodConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/xmod#transformers.XmodConfig) (X-MOD model)
* **yolos** — [YolosConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/yolos#transformers.YolosConfig) (YOLOS model)
* **yoso** — [YosoConfig](https://huggingface.co/docs/transformers/v4.34.1/en/model_doc/yoso#transformers.YosoConfig) (YOSO model)



Examples:

Copied

```
>>> 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}
```

**register**

[\<source>](https://github.com/huggingface/transformers/blob/v4.34.1/src/transformers/models/auto/configuration_auto.py#L1065)

( model\_typeconfigexist\_ok = False )

Parameters

* **model\_type** (`str`) — The model type like “bert” or “gpt”.
* **config** ([PretrainedConfig](https://huggingface.co/docs/transformers/v4.34.1/en/main_classes/configuration#transformers.PretrainedConfig)) — The config to register.

Register a new configuration for this class.
