Hi,


generator is Bart encoder-decoder. If you have a rag model, you can access it by model.generator


RAG’s question-encoder is not the same as RAG’s generator’s encoder … This really may be confusing, so let me try to explain 

question encoder is for encoding “question” to retrieve “documents” (or so-called “contexts”) from  retriever.
Then, retriever will concatenate “contexts” with “question” ; this concatenated texts are the new input.
This new input will be encoded by Bart’s encoder to generate answer via Bart’s decoder



Hope this helps!