<p dir="auto">I tried to load RAG according to the documentation.</p>
<p dir="auto"><code class="notranslate">retriever = RagRetriever.from_pretrained("facebook/rag-token-base", index_name="exact", use_dummy_dataset=True)</code></p>
<p dir="auto">The above line gave the following error.</p>
<p dir="auto"><strong>/python3.6/site-packages/transformers/retrieval_rag.py", line 220, in init<br>
self.dataset = load_dataset(<br>
NameError: name 'load_dataset' is not defined</strong></p>
<h2 dir="auto">Environment info</h2>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version: 3.3.1</li>
<li>Platform: Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic</li>
<li>Python version: 3.6.9</li>
<li>PyTorch version (GPU?): 1.6.0+cu101 (True)</li>
<li>Tensorflow version (GPU?): 2.3.0 (True)</li>
<li>Using GPU in script?: Yes</li>
<li>Using distributed or parallel set-up in script?: No</li>
</ul>
<h3 dir="auto">Who can help</h3>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/julien-c/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/julien-c">@julien-c</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/VictorSanh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/VictorSanh">@VictorSanh</a></p>
<h2 dir="auto">Information</h2>
<p dir="auto">Model I am using RAG</p>
<p dir="auto">The problem arises when using:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> the official example scripts: (give details below)</li>
</ul>
<h2 dir="auto">To reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Open a new colab notebook</li>
<li>!pip install transformers</li>
<li>execute the RAG model example code</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
tokenizer = RagTokenizer.from_pretrained(&quot;facebook/rag-token-nq&quot;)
retriever = RagRetriever.from_pretrained(&quot;facebook/rag-token-nq&quot;, index_name=&quot;exact&quot;, use_dummy_dataset=True)
model = RagTokenForGeneration.from_pretrained(&quot;facebook/rag-token-nq&quot;, retriever=retriever)

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

generated = model.generate(input_ids=input_dict[&quot;input_ids&quot;]) 
print(tokenizer.batch_decode(generated, skip_special_tokens=True)[0]) "><pre lang="from" class="notranslate"><code class="notranslate">
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]) 
</code></pre></div>
<p dir="auto">error traceback</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="NameError                                 Traceback (most recent call last)

&lt;ipython-input-5-fcc46db034ee&gt; in &lt;module&gt;()
      2 
      3 tokenizer = RagTokenizer.from_pretrained(&quot;facebook/rag-token-nq&quot;)
----&gt; 4 retriever = RagRetriever.from_pretrained(&quot;facebook/rag-token-nq&quot;, index_name=&quot;exact&quot;, use_dummy_dataset=True)
      5 model = RagTokenForGeneration.from_pretrained(&quot;facebook/rag-token-nq&quot;, 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(&quot;Loading passages from {}&quot;.format(self.dataset_name))
--&gt; 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"><pre class="notranslate"><code class="notranslate">NameError                                 Traceback (most recent call last)

&lt;ipython-input-5-fcc46db034ee&gt; in &lt;module&gt;()
      2 
      3 tokenizer = RagTokenizer.from_pretrained("facebook/rag-token-nq")
----&gt; 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))
--&gt; 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
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">I would expect the model card example to be output:</p>
<h1 dir="auto">should give michael phelps =&gt; sounds reasonable</h1>
<p dir="auto">or something to this effect.</p>