Skip to content

Barebones LLM wrapper with llama_cpp_python [demo] + RAG with pdf docs

Notifications You must be signed in to change notification settings

peace-for-all/llama4ak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo of a LLM running on llama.cpp (python bindings)

Setup

Prep virtualenv

Prerequisite: have python3 installed.

python3 -m venv venv # creates venv directory
source venv/bin/activate # enters virtual environment
pip install llama-cpp-python \
  --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu # rm extra-index-url part if runs on GPU

Put a model into models/ dir

Run main.py

python3 main.py 2>error.log

NOTE: by default the model writes a lot of information out into STDERR. I filter that out with 2>error.log for you to see later. If you want to see all output, remove 2>error.log, just run python3 main.py.

Notes

RAG script

Setup

Script env

python3 -m venv venv # creates venv directory
source venv/bin/activate # enters virtual environment
pip install -r requirements.txt

Data for RAG

  1. Create directory data_rag_ru in this project;
  2. Put there PDF files to get the answers data from.

Run

python3 rag_from_pdf.py

then ask your questions from it.

Cheers.

About

Barebones LLM wrapper with llama_cpp_python [demo] + RAG with pdf docs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages