# Regarding Rag-end2end retriever

**URL:** <https://discuss.huggingface.co/t/regarding-rag-end2end-retriever/30424>\
**Category:** 🤗Transformers\
**Created:** [January 25, 2023, 8:48pm UTC](https://discuss.huggingface.co/t/regarding-rag-end2end-retriever/30424 "2023-01-25T20:48:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RajDoshi](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RajDoshi](https://discuss.huggingface.co/u/RajDoshi)\
**Post date:** [January 25, 2023, 8:48pm UTC](https://discuss.huggingface.co/t/regarding-rag-end2end-retriever/30424/1 "2023-01-25T20:48:59Z")

</div>

@shamanez  
How to use the finetuned rag-end2end retriever for model prediction similar to hugging face.  
for eg: model.generate(“text”) and answer should be there  
Also,  
trainer.test() in finetune\_rag.py ( what is this supposed to do exactly?)

---

<div class="post-metadata">

**Author:** ![shamanez](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/shamanez/32/17994_2.png) [@shamanez](https://discuss.huggingface.co/u/shamanez)\
**Post date:** [January 31, 2023, 8:06am UTC](https://discuss.huggingface.co/t/regarding-rag-end2end-retriever/30424/2 "2023-01-31T08:06:37Z")

</div>

Hi, for that you need to finetune your models and use the checkpoints. But it is not simple as other language models, since RAG has a retrieval phase. Please follow the HF documentation of RAG.
