RagSequenceForGeneration how to get document texts retrieved  in response to a query
When I run the retriever separately, how can I find out the text of the documents (from the doc_ids ?) that are retrieved ?

I created the retriever using:
retriever = RagRetriever.from_pretrained(rag_example_args.rag_model_name,index_name="custom",passages_path=passages_path,index_path=index_path,n_docs=8)
tokenizer = RagTokenizer.from_pretrained(rag_example_args.rag_model_name)

model = RagSequenceForGeneration.from_pretrained(rag_example_args.rag_model_name,index_name="custom",indexed_dataset=dataset)

question_hidden_states = model.question_encoder(input_ids)[0]
docs_dict = retriever(input_ids.numpy(), question_hidden_states.detach().numpy(), return_tensors="pt")

retriever.index.get_doc_dicts(docs_dict["doc_ids"])[0]['text']  gets me the text of the retrieved documents.