Skip to content

abaoxomtieu/RAG-API-VietnamesePDF

Repository files navigation

RAG-Vietnamese-PDF

Description: Runs on gpu, windows 11, cuda11.8 .

Framework: Langchain

API : FastAPI

UI: Streamlit

GPU: RTX 2060 Max-Q

Installation and Dependencies

  1. Clone this repository:
git clone https://github.com/hotonbao/RAG-API-VietnamesePDF.git
cd RAG-API-VietnamesePDF
  1. Setup environment:
!pip install -r requirements.txt
  1. Dowload weight vinallama-7b-chat_q5_0.gguf : https://huggingface.co/vilm/vinallama-7b-chat-GGUF/tree/main

Usage

  1. Put all PDF files in data folder and model files in model folder:
RAG-API-VietnamesePDF/
                └── data/
                |   ├──abc.pdf
                |   ├──abc2.pdf
                |   ├──....pdf
                |
                └── img/
                └── models
                |   ├──all-MiniLM-L6-v2-f16.gguf
                |   ├──vinallama-7b-chat_q5_0.gguf
                |
                └──API.py
                └──...py

  1. Run application:
streamlit run .\app.py

Input: text, pdf file, folder contain all pdf files

Alt text

Output: vector data is stored in vector database

After processing successfully then:

  1. Run Q&A API:
python API.py

Now, you can use Q&A base on your private PDF data files.

Input: question from user

Alt text

Output: answer from model

About

Build API for Q&A on private PDF.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published