Why exist_ok=True is not supported in AutoConfig.register(model_type, config)
Author: CheungZeeCn
Pull request: no

https://github.com/huggingface/transformers/blob/55db70c63de2c07b6ffe36f24c0e7df8f967e935/src/transformers/models/auto/configuration_auto.py#L1035C38-L1035C38


Here is my code:

```
···
from libs.models.custom_layoutlmv3 import LayoutLMv3Model
···

encoder_model_path = "/home/ana/data4/models/layoutlmv3-base"
decoder_model_path = "/home/ana/data4/models/bert-base-uncased"
processor = LayoutLMv3Processor.from_pretrained(encoder_model_path, apply_ocr=False)

decoder_tokenizer = BertTokenizerFast.from_pretrained(decoder_model_path)

model = MyEncoderDecoderModelv3.from_encoder_decoder_pretrained(
    encoder_model_path, decoder_model_path
)
model.config.decoder_start_token_id = decoder_tokenizer.cls_token_id
model.config.eos_token_id = decoder_tokenizer.sep_token_id
model.config.pad_token_id = decoder_tokenizer.pad_token_id
model.config.vocab_size = model.config.decoder.vocab_size

model.config.max_length = 32
model.config.min_length = 5
model.config.no_repeat_ngram_size = 3
model.config.early_stopping = True
model.config.length_penalty = 2.0
model.config.num_beams = 4

print(model)
```

When I try to replace the origin Layoutlmv3 by my Custom layoutlmv3 like:
```
# in libs.models.custom_layoutlmv3.__init__.py :
AutoConfig.register("layoutlmv3", LayoutLMv3Config)
AutoModel.register(LayoutLMv3Config, LayoutLMv3Model, exist_ok=True)
AutoModelForTokenClassification.register(LayoutLMv3Config, LayoutLMv3ForTokenClassification, exist_ok=True)
AutoModelForQuestionAnswering.register(LayoutLMv3Config, LayoutLMv3ForQuestionAnswering, exist_ok=True)
AutoModelForSequenceClassification.register(LayoutLMv3Config, LayoutLMv3ForSequenceClassification, exist_ok=True)
```
it turns out to be:
```
Traceback (most recent call last):
  File "/home/ana/data4/projects/MyMLLM/examples/try_encoder_decoder_models_basic_709.py", line 35, in <module>
    from libs.models.custom_layoutlmv3 import LayoutLMv3Model
  File "/home/ana/data4/projects/MyMLLM/libs/models/custom_layoutlmv3/__init__.py", line 16, in <module>
    AutoConfig.register("layoutlmv3", LayoutLMv3Config)
  File "/home/ana/data4/installed_repos/transformers/src/transformers/models/auto/configuration_auto.py", line 1049, in register
    CONFIG_MAPPING.register(model_type, config)
  File "/home/ana/data4/installed_repos/transformers/src/transformers/models/auto/configuration_auto.py", line 753, in register
    raise ValueError(f"'{key}' is already used by a Transformers config, pick another name.")
ValueError: 'layoutlmv3' is already used by a Transformers config, pick another name.
```

Why  AutoConfig.register("layoutlmv3", LayoutLMv3Config) doesn't support the exist_ok like the AutoModel.register ? 
What should I do?

transformers source:
```
    @staticmethod
    def register(model_type, config):
        """
        Register a new configuration for this class.

        Args:
            model_type (`str`): The model type like "bert" or "gpt".
            config ([`PretrainedConfig`]): The config to register.
        """
        if issubclass(config, PretrainedConfig) and config.model_type != model_type:
            raise ValueError(
                "The config you are passing has a `model_type` attribute that is not consistent with the model type "
                f"you passed (config has {config.model_type} and you passed {model_type}. Fix one of those so they "
                "match!"
            )
        CONFIG_MAPPING.register(model_type, config)
```

Comments:
It's an oversight, feel free to open a PR to fix this!