Recursion error when creating AutoTokenizer
Author: markovalexander
Pull request: no

### System Info

```
- `transformers` version: 4.30.2
- Platform: Linux-5.15.0-1033-oracle-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.15.1
- Safetensors version: 0.3.1
- PyTorch version (GPU?): 2.0.0+cu117 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No
```

### Who can help?

@ArthurZucker

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

1) Save `"Yhyu13/chimera-inst-chat-13b-hf"` tokenizer as `save_pretrained` to some folder

2) Try to create auto tokenizer from that folder 
```bash
python -c "from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained('/local/path/to/tokenizer'); print(tok)"
```
And see recursion error when running `.from_pretrained` (last lines in stack trace):

```
  File "/home/alexander/llm_training/.venv/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 257, in _convert_token_to_id_with_added_voc
    return self.unk_token_id
  File "/home/alexander/llm_training/.venv/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1155, in unk_token_id
    return self.convert_tokens_to_ids(self.unk_token)
  File "/home/alexander/llm_training/.venv/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 250, in convert_tokens_to_ids
    return self._convert_token_to_id_with_added_voc(tokens)
  File "/home/alexander/llm_training/.venv/lib/python3.8/site-packages/transformers/tokenization_utils_fast.py", line 257, in _convert_token_to_id_with_added_voc
    return self.unk_token_id
  File "/home/alexander/llm_training/.venv/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1155, in unk_token_id
    return self.convert_tokens_to_ids(self.unk_token)
  File "/home/alexander/llm_training/.venv/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 1035, in unk_token
    return str(self._unk_token)
RecursionError: maximum recursion depth exceeded while getting the str of an object

```

### Expected behavior

After running `pip install transformers==4.29` everything works fine:

```bash
❯ python -c "from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained('/local/path/to/tokenizer'); print(tok)"

LlamaTokenizerFast(name_or_path='/local/path/to/tokenizer', vocab_size=32000, model_max_length=2048, is_fast=True, padding_side='right', truncation_side='right', special_tokens={'bos_token': '
', 'eos_token': '
', 'unk_token': '<unk>', 'pad_token': '<pad>'}, clean_up_tokenization_spaces=False)
```

Working transformers-cli env:

```
- `transformers` version: 4.29.0
- Platform: Linux-5.15.0-1033-oracle-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.15.1
- Safetensors version: 0.3.1
- PyTorch version (GPU?): 2.0.0+cu117 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No
```

Comments:
Interesting, I can't even load the autotokenizer from remote, i.e., just loading `from_pretrained` using the remote identifier doesn't work and leads to a recursion error.

Hey! There seems to be something a bit strange with the `tokenizer_config.json`, since the `unk_token`, the `bos_token` as well as the `eos_token` are `""`, which means that they are empty. This is the root cause of the issue. 
The following works: 
```python 
>>> from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained(path, unk_token ="
")
```
While this does not work:
```python 
>>> from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained(path, unk_token =" 
")
```
`""` is not part of the vocab, thus it cannot be used as an unknown token. You should update the tokenizer to have a  `tok._unk_token = None`

There's something strange going on. I am facing the same problem and am unable to load a `LlamaTokenizer` on 4.30.2 that I have used previously (with 4.28.x). Here's my `tokenizer_config.json` in case that's relevant:

```json
{
  "bos_token": "
",
  "clean_up_tokenization_spaces": false,
  "eos_token": "
",
  "model_max_length": 1000000000000000019884624838656,
  "tokenizer_class": "LlamaTokenizer",
  "unk_token": "<unk>"
}
```

You are giving way too little informations, no traceback and this is not related to the mentioned issue. If you still have a problem, feel free to open a new issue, add a full reproducer and make sure you have a correctly converted tokenizer

> Hey! There seems to be something a bit strange with the `tokenizer_config.json`, since the `unk_token`, the `bos_token` as well as the `eos_token` are `""`, which means that they are empty. This is the root cause of the issue. The following works:
> 
> ```python
> >>> from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained(path, unk_token ="
")
> ```
> 
> While this does not work:
> 
> ```python
> >>> from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained(path, unk_token =" 
")
> ```
> 
> `""` is not part of the vocab, thus it cannot be used as an unknown token. You should update the tokenizer to have a `tok._unk_token = None`

I think it is not a solution. Why does simple save/load not work then? Maybe at least add that information to docs?

If you load using `from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained("Yhyu13/chimera-inst-chat-13b-hf",  legacy=False, use_fast = False)`, you can load and save. 

The reason why it does not work is because the tokenizer was saved using the `LlamaTokenizer` class. When doing the automatic conversion to a fast tokenizer, (`AutoTokenizer` automatically converts the slow to a fast tokenizer using the [`LlamaConverter` ](https://github.com/ArthurZucker/transformers/blob/1f2434777ecfc436aed40c282b074034f7232d6f/src/transformers/convert_slow_tokenizer.py#L1123).  

The issue lies with `self.update_post_processor()`, which does not check if the `bos` and `eos` tokens are defined or if `add_bos_token` and `add_eos_token` are set to ` True`. 

However the configuration files are still wrong, the `eos` and `bos` and `unk` tokens from the slow tokenizer are going to be different:

```python 
 >>> from transformers import AutoTokenizer; tok = AutoTokenizer.from_pretrained("Yhyu13/chimera-inst-chat-13b-hf",  legacy=True, use_fast = False)
>>> tok
LlamaTokenizer(name_or_path='Yhyu13/chimera-inst-chat-13b-hf', vocab_size=32000, model_max_length=2048, is_fast=False, padding_side='right', truncation_side='right', special_tokens={'bos_token': '
', 'eos_token': '
', 'unk_token': '<unk>', 'pad_token': '<pad>'}, clean_up_tokenization_spaces=False)
```
the values the `tokenizer_config` were not used because the `[special_tokens_map](https://huggingface.co/Yhyu13/chimera-inst-chat-13b-hf/blob/main/special_tokens_map.json)` was saved. 

TLDR; the tokenizer was not properly saved, priority is given to the `tokenizer_config.json` when loading the tokenizer, which is wrong in this case.