dragonGPT
从数据私有化,到prompt向量库匹配,再到查询,一条龙服务,单机部署,极简操作
pre
a.需要下载gpt4all model到本地.
ggml Model Download Link
然后将存放model的地址写入.env
MODEL_PATH= your path
b.在dragongpt/source_documents下放入自己想要关联的私有化信息,可以是自己的数字分身信息,或者是其他业务信息.
c.Python 3.10.11
run
- pip3 install poetry //全局安装poetry管理python项目
- cd dragonGDP
- poetry shell //打开虚拟环境
- poetry install //安装三方包
- cd dragongpt
- python3 inject.py //将私有信息存入向量库
- python3 index.py //向量拟合,比对查询,起本地服务
test
以上进行完之后,就会在8080端口起一个服务,我们可以终端用curl对其测试请求
curl -X POST \
http://127.0.0.1:8000/speak \
-H 'Content-Type: application/json' \
-d '{"prompt": "Hello"}'
通过json传值,问题参数是prompt
packages
[tool.poetry.dependencies]
python = “^3.10”
langchain = “^0.0.187”
gpt4all = “^0.2.3”
chromadb = “^0.3.23”
llama-cpp-python = “^0.1.50”
urllib3 = “^2.0.2”
pdfminer-six = “^20221105”
python-dotenv =“^1.0.0”
unstructured = “^0.6.6”
extract-msg = “^0.41.1”
tabulate = “^0.9.0”
pandoc = “^2.3”
pypandoc =“^1.11”
tqdm = “^4.65.0”
sentence-transformers = “^2.2.2”
flask = “^2.3.2”