CoolFace
Modelpublic

Shrideep/Retrieval_Augmented_Generation

sourceHugging Faceupdated 3y agoView on Hugging Face
2likes
Model Card

Summary:

Retrieval Augmented Generation (RAG) is a technique to specialize a language model with a specific knowledge domain by feeding in relevant data so that it can give better answers.

How does RAG works?

  1. 1.Ready/ Preprocess your input data i.e. tokenization & vectorization
  2. 2.Feed the processed data to the Language Model.
  3. 3.Indexing the stored data that matches the context of the query.

Implementing RAG with llama-index

1. Load relevant data and build an index

from llamaindex import VectorStoreIndex, SimpleDirectoryReader documents = SimpleDirectoryReader("data").loaddata() index = VectorStoreIndex.from_documents(documents)

2. Query your data

queryengine = index.asqueryengine() response = queryengine.query("What did the author do growing up?") print(response)

My application of RAG on ChatGPT

Check RAG.ipynb