AI创想

标题: LangChain-Chatchat [打印本页]

作者: naxieburu    时间: 昨天 22:54
标题: LangChain-Chatchat
作者:E的工程笔记
LLM、AIGC、RAG 开发交流裙:377891973

(, 下载次数: 0)



文章目录



关于 LangChain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM 等语言模型的本地知识库问答。

特性说明


实现原理

本项目实现原理如下图所示,过程包括:
加载文件 -> 读取文本 -> 文本分割 -> 文本向量化 -> 问句向量化 -> 在文本向量中匹配出与问句向量最相似的 top k个 -> 匹配出的文本作为上下文和问题一起添加到 prompt中 -> 提交给 LLM生成回答。
(, 下载次数: 0)



文档处理流程

(, 下载次数: 0)



技术路线图(截止0.2.10)


使用

Langchain-Chatchat 体验
https://mp.weixin.qq.com/s/RvS85gPjWOXkfQa9A2izpw

1、克隆项目
首先将以上项目克隆至本地,并安装相关依赖。
  1. git clone https://github.com/chatchat-space/Langchain-Chatchat.git
复制代码
  1. pip install-r requirements.txt --trusted-host mirrors.aliyun.com
  2. pip install-r requirements_webui.txt --trusted-host mirrors.aliyun.com
复制代码

2、下载模型
  1. git clone https://www.modelscope.cn/qwen/Qwen-1_8B-Chat-Int8.git
  2. git clone https://www.modelscope.cn/AI-ModelScope/bge-large-zh.git  
复制代码
模型下载路径为 /models

3、初始化配置文件和知识库
  1. python copy_config_example.py
  2. python init_database.py --recreate-vs
复制代码

4、修改配置信息
model_config.py
  1. # 修改为下载模型的地址
  2. MODEL_ROOT_PATH ="/models"# 修改为本地使用模型
  3. LLM_MODELS =["Qwen-1_8B-Chat-Int8"]
复制代码

5、启动
  1. python startup.py --all-webui --model-name Qwen-1_8B-Chat-Int
复制代码

2024-03-20(三)
喝了一杯 黑糖珍珠鲜牛奶~




原文地址:https://blog.csdn.net/lovechris00/article/details/136870525




欢迎光临 AI创想 (https://www.llms-ai.com/) Powered by Discuz! X3.4