Chat with your documents, fully local.
- Install ollama
-
ollama pull nomic-embed-text
-
ollama pull llama3
-
git clone https://github.com/AD1616/rag
-
cd local_scripts
-
pip install -r requirements.txt
-
chmod +x kill.sh
-
./kill.sh
-
chmod +x start.sh
-
./start.sh
Note that if it says "address already in use", that (likely) means ollama is already running. From the Mac taskbar, you can always quit ollama so you can start and stop from command line. Make sure to run step 12 again if you do this.
Your current terminal is now running ollama, and will show any requests made to ollama. To continue with the next steps, keep this terminal running and open a new terminal window. Navigate to the directory where the cloned repository is located.
- Upload pdfs to the data directory.
-
python dense_embeddings.py
-
python sparse_embedding.py
If all of the above was done properly, you can now run:
python answer.py <query>
where <query> is your question.
python query.py "Some query relevant to your documents."
When finished, run:
./local_scripts/kill.sh
- Upload pdfs to the data directory.
-
./local_scripts/start.sh
-
python query.py "Some query relevant to your documents."
-
./local_scripts/kill.sh