GithubHelp home page GithubHelp logo

llm-rag's Introduction

LLM RAG

Overview

This project integrates a language model (LLM) with a Retrieval-Augmented Generation (RAG) approach to enhance question-answering capabilities. It leverages the power of the Llama 2-7B model for generating responses and combines it with a retrieval system for fetching relevant information from a database created from PDF documents. The project demonstrates how to split, embed, and retrieve document data to support the LLM in generating accurate and informative answers.

Prerequisites

Before running this project, ensure you have the following prerequisites installed or available:

  • Python 3.9 or later
  • Llama-2-7B-Chat model. Download the llama-2-7b-chat.Q4_K_M.gguf model file from HuggingFace.

How to Run

  1. Install the required Python packages:
pip install -r requirements.txt
  1. Clone this repository
git clone https://github.com/lileetung/LLM-RAG.git
  1. Navigate to the project directory:
cd LLM-RAG
  1. Run the main script:
python RAG.py

Usage

After running the RAG.py script, the system will prompt you to input a question. You can use the suggested questions or input your own. The system operates in two modes:

  • LLMChain mode: Directly utilizes the LLM for answering questions.
  • RetrievalQA mode: Uses a retrieval system to fetch relevant information which is then passed to the LLM for generating answers.

GUI Development

I'm currently developing a GUI for the project using Tkinter. Here's a screenshot:

LLMGUI

llm-rag's People

Contributors

lileetung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.