tokenizer.add_tokens conflict with MBart's tokenizer
Author: znculee
Pull request: no
Labels: name: wontfix

name: Core: Tokenization

## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->
  
- `transformers` version: 3.1.0
- Platform: Linux-3.10.0-1127.el7.x86_64-x86_64-with-glibc2.10
- Python version: 3.8.3
- PyTorch version (GPU?): 1.6.0 (True)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>


### Who can help
<!-- Your issue will be replied to more quickly if you can figure out the right person to tag with @
 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

 albert, bert, GPT2, XLM: @LysandreJik 
 tokenizers: @mfuntowicz
 Trainer: @sgugger
 Speed and Memory Benchmarks: @patrickvonplaten
 Model Cards: @julien-c
 Translation: @sshleifer
 Summarization: @sshleifer
 TextGeneration: @TevenLeScao 
 examples/distillation: @VictorSanh
 nlp datasets: [different repo](https://github.com/huggingface/nlp)
 rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)
 Text Generation: @TevenLeScao
 blenderbot: @mariamabarham
 Bart: @sshleifer
 Marian: @sshleifer
 T5: @patrickvonplaten
 Longformer/Reformer: @patrickvonplaten
 TransfoXL/XLNet: @TevenLeScao 
 examples/seq2seq: @sshleifer
 examples/bert-loses-patience: @JetRunner
 tensorflow: @jplu
 examples/token-classification: @stefan-it
 documentation: @sgugger
 -->
@patil-suraj @mfuntowicz 

## To reproduce

Steps to reproduce the behavior:

1. import MBartTokenizer
2. try `tokenizer.add_tokens('__something_new__')`
3. `tokenizer('__something_new__')`

<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

<!-- A clear and concise description of what you would expect to happen. -->

`add_tokens()` should add new tokens after all existing tokens in the vocabulary, however, the `lang_code` will conflict with the added tokens.

## Current Workaround

```
new_token_to_id = {tok: vocab_size + i for i, tok in enumerate(new_tokens)}
self.tokenizer.fairseq_tokens_to_ids.update(new_token_to_id)
self.tokenizer.fairseq_ids_to_tokens = {v: k for k, v in self.tokenizer.fairseq_tokens_to_ids.items()}
self.tokenizer.unique_no_split_tokens.extend(new_tokens)
```


Comments:
I love your workaround and would definitely be interested in a clean contribution that made in accessible to everyone.

@sshleifer Thanks! I've created a pull request #7353 with this workaround.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.