apply_chat_template result of Mistral is not restrictly align to the template on its website
Author: annahung31
Pull request: no

### System Info

- `transformers` version: 4.22.1
- Platform: Linux-5.4.0-150-generic-x86_64-with-debian-buster-sid
- Python version: 3.7.6
- Huggingface_hub version: 0.15.1
- PyTorch version (GPU?): 1.12.1+cu102 (True)
- 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?: N
- Using distributed or parallel set-up in script?: N

(I don't know why transformers-cli env got wrong transformers version. 
If I run 
```
import transformers
transformers.__version__
```
I'll get '4.34.0'.


### Who can help?

@ArthurZucker and @younesbelkada

### Information

- [X] 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


```
from transformers import AutoTokenizer
from transformers import AutoTokenizer
chat = [
  {"role": "user", "content": "USER_INSTRUCTION_1"},
  {"role": "assistant", "content": "RESPONSE_1"},
  {"role": "user", "content": "USER_INSTRUCTION_2"},
  {"role": "assistant", "content": "RESPONSE_2"},
]
res_apply_chat_template = tokenizer.apply_chat_template(chat, tokenize=False)
res_mistral_website = '

 USER_INSTRUCTION_1 
 RESPONSE_1

 USER_INSTRUCTION_2 
 RESPONSE_2
'
print(res_apply_chat_template)   
print(res_mistral_website)

```

The result is:

```
'

 USER_INSTRUCTION_1 
RESPONSE_1
 
 USER_INSTRUCTION_2 
RESPONSE_2
 '
'

 USER_INSTRUCTION_1 
 RESPONSE_1

 USER_INSTRUCTION_2 
 RESPONSE_2
'
```

There are two main difference:
1. According to the Mistral 7B website: https://docs.mistral.ai/usage/guardrailing/#appendix
There is always a blank after `
` and `
`, but result of `apply_chat_template` seems not following it. 

2. In `res_apply_chat_template`, There is an additional blank at the end of a turn.

I also encode the two sentences and decode them back. The results show that the word will be tokenized into different tokens because of the blank after `
`: 

```
decoded_apply_chat_template = []
for a in ids_apply_chat_template:
    decoded_apply_chat_template.append(tokenizer.decode(a))

decoded_mistral_website = []
for b in ids_mistral_website:
    decoded_mistral_website.append(tokenizer.decode(b))

#decoded_apply_chat_template
['
', '[', 'INST', ']', 'US', 'ER', '_', 'IN', 'STRU', 'CTION', '_', '1', '[', '/', 'INST', ']', 'RE', 'SP', 'ON', 'SE', '_', '1', '
', '', '[', 'INST', ']', 'US', 'ER', '_', 'IN', 'STRU', 'CTION', '_', '2', '[', '/', 'INST', ']', 'RE', 'SP', 'ON', 'SE', '_', '2', '
', ' ']

#decoded_mistral_website
['
', '[', 'INST', ']', 'US', 'ER', '_', 'IN', 'STRU', 'CTION', '_', '1', '[', '/', 'INST', ']', 'RES', 'P', 'ON', 'SE', '_', '1', '
', '[', 'INST', ']', 'US', 'ER', '_', 'IN', 'STRU', 'CTION', '_', '2', '[', '/', 'INST', ']', 'RES', 'P', 'ON', 'SE', '_', '2', '
']
```


I guess it's okay to do either way, but shall we better to align with how it was been done during finetuning?

(I think the problem is the chat_template provide in model condig.json, so I also post this issue under their hub.)

### Expected behavior

Behavior are align to each other.

Comments:
cc @Rocketknight1 if you can have a look! 

Thanks for the warning @annahung31! I wrote that chat template based on the layout in the model card, but I didn't realize there was a slightly different template on their website. I pinged some people from Mistral in the repo issue you opened, so hopefully we can get them to confirm the actual template that was used.

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.