RAG (Retrievel Augmented Generation) implementation using the Mistral-7B-Instruct-v0.1
This repository contains the implementation of the Retrieval Augmented Generation (RAG) model, using the newly released Mistral-7B-Instruct-v0.1 as the Language Model, SentenceTransformers for embedding, and llama-index for data ingestion, vectorization, and storage. The model has been implemented in a Google Colab notebook, optimized for a v100 instance.
The implementation focuses on querying data from Amazon’s Annual Report for the fiscal year ended December 31, 2022. This enables the extraction of insightful information and knowledge encapsulated in the fiscal documents.
RAG_testing_mistral7b.ipynb
: The main Google Colab notebook containing the entire implementation and execution details.
- Google Colab with v100 instance.
- Knowledge on RAG, SentenceTransformers, and Mistral 7B models.
- Access token for HuggingFace (read)
- Clone the repository:
git clone https://github.com/mickymult/RAG-Mistral7b.git
- Open the
RAG_testing_mistral7b.ipynb
notebook in Google Colab. - Set up the environment with the necessary libraries and dependencies.
- Create a new folder called "data" and store the Amazon 10k repport in it.
- Run the notebook cells in sequence.
This implementation utilizes Mistral 7B as the Large Language Model to generate human-like, coherent responses based on the retrieved documents.
SentenceTransformers is used to create embeddings for the sentences, enabling efficient and semantic similarity search among them. all-mpnet-base-v2 pretrained model was used as it had the best performance.
llama-index is employed for ingesting and vectorizing the dataset and for storing the vectorized representations of the data.
The data queried in this implementation is sourced from Amazon’s Annual Report for the fiscal year ended December 31, 2022.
Follow the instructions in the RAG_testing_mistral7b.ipynb
notebook to run the cells and execute the implementation on Google Colab.
This project is licensed under the MIT License.
- The entire team at Mistral for the powerful language model.
- SentenceTransformers for the efficient embedding model.
- llama-index for data ingestion and vectorization.
- Amazon for the annual report data.
For any queries or discussions related to this implementation, feel free to raise an issue in this GitHub repository.