Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.2 KB

README.md

File metadata and controls

54 lines (34 loc) · 1.2 KB

基于LangChain和ChatGLM3-6B的搜索引擎总结问答

一个小玩具demo:调用本地ChatGLM3-6B模型,使用LangChain实现的搜索引擎agent

环境准备

  1. 为防止本项目文件过大,项目中没有放模型文件,需要自己下载:
# 在根目录下创建model文件夹, 然后分别git clone ChatGLM模型和Embedding模型
git clone https://www.modelscope.cn/ZhipuAI/chatglm3-6b.git
git clone https://www.modelscope.cn/AI-ModelScope/bge-large-zh-v1.5.git

目录结构是这样的:./model/chatglm3-6b./model/bge-large-zh-v1.5

  1. 创建、激活conda虚拟环境
$> conda create -n summary python=3.10
$> conda activate summary
  1. 安装依赖
(summary) $> pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

如果torch安装有问题可以直接去官网下载

(summary) $> pip install cu118/torch-2.1.2+cu118-cp310-cp310-win_amd64.whl

启动

  1. 启动chatglm模型
(summary) $> python api_server.py
  1. 然后新开一个终端测试
(summary) $> python app.py

效果如下图所示

result