Skip to content

COSCUP/polyhistor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG

Installation

We use Poetry to manage dependencies.

poetry shell
poetry install

Create testdata directory in the root directory and add files.

Now we only support .md files.

Use pre-commit.

pre-commit install

(Optional) Create a .env file in the root directory and add the following environment variables:

LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=<LANGCHAIN_API_KEY>
MODEL_API=<the model api from Mattermost>

Note:

  1. You can get the LANGCHAIN_API_KEY from LangSmith.
  2. Get the MODEL_API from Mattermost.

Usage

qdrant

預設使用port:6333

Add or Update Data

如果要新增或修改資料請使用此方法

cd vectorDB
docker-compose -f addData/docker-compose.yml up -d  

Run DB

cd vectorDB
docker build -t polyhistor:db .
docker run -d --restart always -p 6333:6333 --name polyhistor_qdrant polyhistor:db

ollama

Run ollama:

ollama serve

Default embedding model is chevalblanc/acge_text_embedding and default language model is qwen:4b.

Open a new terminal and run the following command:

cd src
python main.py

Then you can ask questions to the model. If you want to exit, type bye.