TrOCRProcessor.from_pretrained raise KeyError(key)
Author: laizhenhai88
Pull request: no

### System Info

@amyeroberts
1. background
I fine-tuned a model of [microsoft/trocr-base-printed](https://huggingface.co/microsoft/trocr-base-printed)
the model is https://huggingface.co/hongyusir/trocr-base-printed_captcha_ocr
and I load my model raise KeyError(key)



### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

2. the source code is:
```
import os, sys, itertools
os.environ['TOKENIZERS_PARALLELISM']='false'

import pandas as pd

from PIL import Image

import torch
from torch.utils.data import Dataset

import datasets
from datasets import load_dataset

import transformers
from transformers import Seq2SeqTrainingArguments, Seq2SeqTrainer
from transformers import VisionEncoderDecoderModel, TrOCRProcessor, default_data_collator

import evaluate

print("Python:".rjust(15), sys.version[0:6])
print("Pandas:".rjust(15), pd.__version__)
print("Datasets:".rjust(15), datasets.__version__)
print("Transformers:".rjust(15), transformers.__version__)
print("Torch:".rjust(15), torch.__version__)

print("load model")
processor = TrOCRProcessor.from_pretrained('hongyusir/trocr-base-printed_captcha_ocr')
model = VisionEncoderDecoderModel.from_pretrained('hongyusir/trocr-base-printed_captcha_ocr')

print("finish load model")
```

3.the output is:
```
        Python: 3.8.10
        Pandas: 2.0.3
      Datasets: 2.13.1
  Transformers: 4.30.2
         Torch: 2.0.1+cu117
load model
Traceback (most recent call last):
  File "x.py", line 27, in <module>
    processor = TrOCRProcessor.from_pretrained('hongyusir/trocr-base-printed_captcha_ocr')
  File "/home/pc/.local/lib/python3.8/site-packages/transformers/processing_utils.py", line 184, in from_pretrained
    args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
  File "/home/pc/.local/lib/python3.8/site-packages/transformers/processing_utils.py", line 228, in _get_arguments_from_pretrained
    args.append(attribute_class.from_pretrained(pretrained_model_name_or_path, **kwargs))
  File "/home/pc/.local/lib/python3.8/site-packages/transformers/models/auto/tokenization_auto.py", line 707, in from_pretrained
    tokenizer_class_py, tokenizer_class_fast = TOKENIZER_MAPPING[type(config)]
  File "/home/pc/.local/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 665, in __getitem__
    raise KeyError(key)
KeyError: <class 'transformers.models.vision_encoder_decoder.configuration_vision_encoder_decoder.VisionEncoderDecoderConfig'>
```

### Expected behavior

load model success

Comments:
Hi @laizhenhai88 

It seems you forgot to upload the tokenizer you loaded/used during training to your own model repo.
If you upload it. the issue you reported will disappear.

Let us know if you have further question.

> Hi @laizhenhai88
> 
> It seems you forgot to upload the tokenizer you loaded/used during training to your own model repo. If you upload it. the issue you reported will disappear.
> 
> Let us know if you have further question.

thanks!

my train code is 
```
trainer = Seq2SeqTrainer(
    model=model,
    tokenizer=processor.feature_extractor,
    args=args,
    compute_metrics=compute_metrics,
    train_dataset=train_ds,
    eval_dataset=test_ds,
    data_collator=default_data_collator
)

trainer.train()
trainer.save_model()
trainer.save_state()
trainer.evaluate()
```

maybe I need `trainer.push_to_hub("All Dunn!!!")` ?

Yes, but you already have a repo, so I assume you already used `push_to_hub`. I am not sure why you don't have tokenizer on the repo then.

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.