RAG model card code not working in Colab
## Environment info

- `transformers` version: 3.3.1
- Platform: Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.6.9
- PyTorch version (GPU?): 1.6.0+cu101 (True)
- Tensorflow version (GPU?): 2.3.0 (True)
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No
   

### Who can help
 
@julien-c @VictorSanh

## Information

Model I am using RAG

The problem arises when using:
* [X] the official example scripts: (give details below)

## To reproduce

Steps to reproduce the behavior:

1. Open a new colab notebook 
2. !pip install transformers
3. execute the RAG model example code 

```from transformers import RagTokenizer, RagRetriever, RagTokenForGeneration

tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="exact", use_dummy_dataset=True)
model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq", retriever=retriever)

input_dict = tokenizer.prepare_seq2seq_batch("who holds the record in 100m freestyle", return_tensors="pt") 

generated = model.generate(input_ids=input_dict["input_ids"]) 
print(tokenizer.batch_decode(generated, skip_special_tokens=True)[0]) 
```
error traceback

``` 
NameError                                 Traceback (most recent call last)

<ipython-input-5-fcc46db034ee> in <module>()
      2 
      3 tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
----> 4 retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="exact", use_dummy_dataset=True)
      5 model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq", retriever=retriever)
      6 

2 frames

/usr/local/lib/python3.6/dist-packages/transformers/retrieval_rag.py in __init__(self, dataset_name, dataset_split, index_name, vector_size, index_path, use_dummy_dataset)
    218 
    219         logger.info("Loading passages from {}".format(self.dataset_name))
--> 220         self.dataset = load_dataset(
    221             self.dataset_name, with_index=False, split=self.dataset_split, dummy=self.use_dummy_dataset
    222         )

NameError: name 'load_dataset' is not defined
```


## Expected behavior

I would expect the model card example to be output:

# should give michael phelps => sounds reasonable

or something to this effect.

You need to install `datasets` too for this model:
```
! pip install datasets
```
I'll work on some cleaner error messages.<|||||>Thanks for responding @sgugger !

Sadly that didn't fix it:

!pip install transformers
!pip install datasets
```

NameError                                 Traceback (most recent call last)

<ipython-input-2-fcc46db034ee> in <module>()
      2 
      3 tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
----> 4 retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="exact", use_dummy_dataset=True)
      5 model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq", retriever=retriever)
      6 

2 frames

/usr/local/lib/python3.6/dist-packages/transformers/retrieval_rag.py in __init__(self, dataset_name, dataset_split, index_name, vector_size, index_path, use_dummy_dataset)
    218 
    219         logger.info("Loading passages from {}".format(self.dataset_name))
--> 220         self.dataset = load_dataset(
    221             self.dataset_name, with_index=False, split=self.dataset_split, dummy=self.use_dummy_dataset
    222         )

NameError: name 'load_dataset' is not defined
```

Still resulted in the same error.<|||||>Did you try restarting the colab? `datasets` requires that if I'm not mistaken.<|||||>Problem persists after restarting. 

I tried it locally as well and I get the same error, but with a more verbose message.

```
NameError                                 Traceback (most recent call last)
<ipython-input-4-e0fde23b2cd7> in <module>
      2
      3 tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
----> 4 retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="exact", use_dummy_dataset=True)
      5 model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq", retriever=retriever)
      6

~/Library/Caches/pypoetry/virtualenvs/bbc-transformer-vt1pdFaV-py3.8/lib/python3.8/site-packages/transformers/retrieval_rag.py in from_pretrained(cls, retriever_name_or_path, **kwargs)
    306         question_encoder_tokenizer = rag_tokenizer.question_encoder
    307         generator_tokenizer = rag_tokenizer.generator
--> 308         return cls(
    309             config, question_encoder_tokenizer=question_encoder_tokenizer, generator_tokenizer=generator_tokenizer
    310         )

~/Library/Caches/pypoetry/virtualenvs/bbc-transformer-vt1pdFaV-py3.8/lib/python3.8/site-packages/transformers/retrieval_rag.py in __init__(self, config, question_encoder_tokenizer, generator_tokenizer)
    281             )
    282             if config.index_name == "legacy"
--> 283             else HFIndex(
    284                 config.dataset,
    285                 config.dataset_split,

~/Library/Caches/pypoetry/virtualenvs/bbc-transformer-vt1pdFaV-py3.8/lib/python3.8/site-packages/transformers/retrieval_rag.py in __init__(self, dataset_name, dataset_split, index_name, vector_size, index_path, use_dummy_dataset)
    218
    219         logger.info("Loading passages from {}".format(self.dataset_name))
--> 220         self.dataset = load_dataset(
    221             self.dataset_name, with_index=False, split=self.dataset_split, dummy=self.use_dummy_dataset
    222         )

NameError: name 'load_dataset' is not defined
```<|||||>I think I found why while fixing the error message. This also needs the faiss library: `! pip install faiss`.<|||||>@sgugger Confirmed.

```
!pip install transformers
!pip install datasets
!pip install faiss
```

give the expected behaviour. Thank you!<|||||>Working on having some clear error message for the next users in #7537 :-)
Thanks for flagging the problem!<|||||>Thanks for the help! :) <|||||>@sgugger, I have the following versions of the packages installed : 
transformers==3.3.1
datasets==1.1.2
faiss==1.5.3
I still see the error.
It would be great if you could document which versions of faiss, datasets, and transformers works !<|||||>I imported datasets to see if it helps. Didn't.<|||||>on Google Colab, switch to a GPU runtime, then try with:
`!pip install faiss-gpu`
finally restart the runtime.

It worked for me :)<|||||>I have the same question, which is 
`ImportError                               Traceback (most recent call last)
[<ipython-input-7-d8ba1013a0e5>](https://localhost:8080/#) in <module>()
      6 
      7 tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
----> 8 retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="exact", use_dummy_dataset=True)
      9 model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq", retriever=retriever)
     10 

1 frames
[/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py](https://localhost:8080/#) in requires_backends(obj, backends)
    846     failed = [msg.format(name) for available, msg in checks if not available()]
    847     if failed:
--> 848         raise ImportError("".join(failed))
    849 
    850 

ImportError: 
RagRetriever requires the 🤗 Datasets library but it was not found in your environment. You can install it with:
```
pip install datasets
```
In a notebook or a colab, you can install it by executing a cell with
```
!pip install datasets
```
then restarting your kernel.

Note that if you have a local folder named `datasets` or a local python file named `datasets.py` in your current
working directory, python may try to import this instead of the 🤗 Datasets library. You should rename this folder or
that python file if that's the case.

RagRetriever requires the faiss library but it was not found in your environment. Checkout the instructions on the
installation page of its repo: https://github.com/facebookresearch/faiss/blob/master/INSTALL.md and follow the ones
that match your environment.


---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------`
but either I add !pip install faiss-gpu or !pip install faiss is not useful.<|||||>> @sgugger Confirmed.
> 
> ```
> !pip install transformers
> !pip install datasets
> !pip install faiss
> ```
> 
> give the expected behaviour. Thank you!

I used above commands and it shows faiss is imported but still gives the import error for faiss.

ImportError                               Traceback (most recent call last)
[<ipython-input-5-c04f039ae844>](https://localhost:8080/#) in <cell line: 4>()
      2 
      3 tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
----> 4 retriever = RagRetriever.from_pretrained("facebook/rag-token-nq", index_name="exact", use_dummy_dataset=True)
      5 model = RagTokenForGeneration.from_pretrained("facebook/rag-token-nq", retriever=retriever)
      6 

1 frames
[/usr/local/lib/python3.10/dist-packages/transformers/utils/import_utils.py](https://localhost:8080/#) in requires_backends(obj, backends)
   1012     failed = [msg.format(name) for available, msg in checks if not available()]
   1013     if failed:
-> 1014         raise ImportError("".join(failed))
   1015 
   1016 

ImportError: 
RagRetriever requires the faiss library but it was not found in your environment. Checkout the instructions on the installation page of its repo: https://github.com/facebookresearch/faiss/blob/master/INSTALL.md and follow the ones
that match your environment. Please note that you may need to restart your runtime after installation.
<img width="1002" alt="image" src="https://github.com/huggingface/transformers/assets/75541422/2d1d974e-e292-4b5d-acbc-ec2ae644ef3f">
