赞
踩
基于Langchain与ChatGLM等语言模型的本地知识库问答应用实现。项目中默认LLM模型改为THUDM/chatglm2-6b[2],默认Embedding模型改为moka-ai/m3e-base[3]。
2.支持LLM模型 本地LLM模型接入基于FastChat实现,支持模型如下:
说明:在线LLM模型目前已支持:ChatGPT、智谱AI、MiniMax、讯飞星火和百度千帆。
3.支持Embedding模型 本项目支持调用HuggingFace中的Embedding模型:
4.安装FastChat
二.设置配置项1.LLM模型配置 配置Langchain-Chatchat/configs/model_config.py文件中的llm_model_dict参数:
2.Embedding模型配置 配置Langchain-Chatchat/configs/model_config.py文件中的embedding_model_dict参数:
3.知识库初始化与迁移 首次运行项目,需要初始化或重建知识库,如下所示:
三.启动API服务和Web UI 一键启动所有Fastchat服务、API服务、WebUI服务:1.启动命令
2.FastAPI docs界面
图片
3.Web UI对话界面
图片
4.Web UI知识库管理页面
图片
参考文献:[1]Langchain-Chatchat:https://github.com/chatchat-space/Langchain-Chatchat[2]https://huggingface.co/THUDM/chatglm2-6b[3]https://huggingface.co/moka-ai/m3e-base[4]https://github.com/lm-sys/FastChat[5]https://github.com/chatchat-space/Langchain-Chatchat/issues
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。