ImportError: cannot import name 'MBart50TokenizerFast' from 'transformers' (unknown location)
Author: loretoparisi
Pull request: no

## 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: 4.3.2
- Platform: Linux-4.19.121-linuxkit-x86_64-with-debian-10.1
- Python version: 3.7.4
- PyTorch version (GPU?): 1.7.1 (False)
- Tensorflow version (GPU?): 2.4.1 (False)
- Using GPU in script?: <NO>
- Using distributed or parallel set-up in script?: <NO>

### Who can help

Model:
https://huggingface.co/facebook/mbart-large-50-one-to-many-mmt
@patrickvonplaten, @patil-suraj

<!-- 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.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @jplu


Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- nlp datasets: [different repo](https://github.com/huggingface/nlp)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh


 -->

## Information

Model I am using (Bert, XLNet ...):

The problem arises when using:
* [X] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [X] an official GLUE/SQUaD task: (translation)
* [ ] my own task or dataset: (give details below)

## To reproduce

Steps to reproduce the behavior:

```python
import os
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast

article_en = "The head of the United Nations says there is no military solution in Syria"
model = MBartForConditionalGeneration.from_pretrained(
    "facebook/mbart-large-50-one-to-many-mmt", cache_dir=os.getenv("cache_dir", "model"))
tokenizer = MBart50TokenizerFast.from_pretrained(
    "facebook/mbart-large-50-one-to-many-mmt", src_lang="en_XX")

model_inputs = tokenizer(article_en, return_tensors="pt")

# translate from English to Hindi
generated_tokens = model.generate(
    **model_inputs,
    forced_bos_token_id=tokenizer.lang_code_to_id["hi_IN"]
)
tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
# => 'संयुक्त राष्ट्र के नेता कहते हैं कि सीरिया में कोई सैन्य समाधान नहीं है'

# translate from English to Chinese
generated_tokens = model.generate(
    **model_inputs,
    forced_bos_token_id=tokenizer.lang_code_to_id["zh_CN"]
)
decoded = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
# => '联合国首脑说,叙利亚没有军事解决办法'
print(decoded)
````

ERROR:

```
Traceback (most recent call last):
  File "src/translation/run.py", line 7, in <module>
    from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
ImportError: cannot import name 'MBart50TokenizerFast' from 'transformers' (unknown location)
```

<!-- 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
no error
<!-- A clear and concise description of what you would expect to happen. -->


Comments:
Hi @loretoparisi 

Did you install sentencepiece ? The tokenizer needs sentencepiece

@patil-suraj thanks I did right now

```
root@d2f0e8a5ec76:/app# pip install sentencepiece
Collecting sentencepiece
  Downloading https://files.pythonhosted.org/packages/f5/99/e0808cb947ba10f575839c43e8fafc9cc44e4a7a2c8f79c60db48220a577/sentencepiece-0.1.95-cp37-cp37m-manylinux2014_x86_64.whl (1.2MB)
     |████████████████████████████████| 1.2MB 507kB/s 
Installing collected packages: sentencepiece
Successfully installed sentencepiece-0.1.95
WARNING: You are using pip version 19.3; however, version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@d2f0e8a5ec76:/app# python src/translation/run.py 
Traceback (most recent call last):
  File "src/translation/run.py", line 7, in <module>
    from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
ImportError: cannot import name 'MBart50TokenizerFast' from 'transformers' (unknown location)
```

Codebase is here: https://github.com/loretoparisi/hf-experiments/blob/master/src/translation/run.py

Hi @loretoparisi! Could you show the results of `pip list` so we can investigate? Maybe `tokenizers` is missing, that's what's required for the fast tokenizer. Thanks!

@LysandreJik of course!

```
root@d2f0e8a5ec76:/app# pip list
Package                Version     
---------------------- ------------
absl-py                0.11.0      
appdirs                1.4.4       
astunparse             1.6.3       
audioread              2.1.9       
cached-property        1.5.2       
cachetools             4.2.1       
certifi                2020.12.5   
cffi                   1.14.5      
chardet                4.0.0       
click                  7.1.2       
cycler                 0.10.0      
decorator              4.4.2       
docopt                 0.6.2       
filelock               3.0.12      
flatbuffers            1.12        
gast                   0.3.3       
google-auth            1.26.1      
google-auth-oauthlib   0.4.2       
google-pasta           0.2.0       
grpcio                 1.32.0      
h5py                   2.10.0      
idna                   2.10        
imageio                2.9.0       
importlib-metadata     3.4.0       
joblib                 1.0.1       
Keras                  2.4.3       
Keras-Preprocessing    1.1.2       
kiwisolver             1.3.1       
librosa                0.8.0       
llvmlite               0.35.0      
Markdown               3.3.3       
matplotlib             3.3.4       
munkres                1.1.4       
networkx               2.5         
numba                  0.52.0      
numpy                  1.19.5      
oauthlib               3.1.0       
opt-einsum             3.3.0       
packaging              20.9        
pandas                 1.2.2       
Pillow                 8.1.0       
pip                    19.3        
pooch                  1.3.0       
protobuf               3.14.0      
pyannote.algorithms    0.8         
pyannote.core          4.1         
pyannote.parser        0.8         
pyasn1                 0.4.8       
pyasn1-modules         0.2.8       
pycparser              2.20        
pyparsing              2.4.7       
python-dateutil        2.8.1       
pytz                   2021.1      
PyWavelets             1.1.1       
PyYAML                 5.4.1       
regex                  2020.11.13  
requests               2.25.1      
requests-oauthlib      1.3.0       
resampy                0.2.2       
rsa                    4.7.1       
sacremoses             0.0.43      
scikit-image           0.18.1      
scikit-learn           0.24.1      
scipy                  1.6.0       
sentencepiece          0.1.95      
setuptools             41.4.0      
SIDEKIT                1.3.8.5.2   
simplejson             3.17.2      
six                    1.15.0      
sortedcollections      2.1.0       
sortedcontainers       2.3.0       
SoundFile              0.10.3.post1
tensorboard            2.4.1       
tensorboard-plugin-wit 1.8.0       
tensorflow             2.4.1       
tensorflow-estimator   2.4.0       
termcolor              1.1.0       
threadpoolctl          2.1.0       
tifffile               2021.2.1    
tokenizers             0.10.1      
torch                  1.7.1       
torchvision            0.8.2       
tqdm                   4.56.2      
transformers           4.3.2       
typing-extensions      3.7.4.3     
urllib3                1.26.3      
Werkzeug               1.0.1       
wheel                  0.36.2      
wrapt                  1.12.1      
xarray                 0.16.2      
zipp                   3.4.0 
```

Here I can see `tokenizers             0.10.1 `, not sure if that's the right version though.

Ah, I think I have found the culprit! MBart-50 was only just released on the `master` branch and you seem to be using version v4.3.2, which does not have it yet. Could you install from source and let me know if you still have the issue?

I installed transformer 4.3.2
Could any let me know how to install it from the source?
![image](https://user-images.githubusercontent.com/58412261/108588225-090f4000-737e-11eb-80ef-e565672891ac.png)


To install from source clone the repo and run `pip install .` from the root of the repo or run

`pip install git+https://github.com/huggingface/transformers.git`, which will install the master branch.


Confirmed it works with master branch install!
```
['联合国首脑说,叙利亚没有军事解决办法']
```