首页 > 其他分享 >Langchain——chatchat3.1版本docker部署流程Langchain-Chatchat

Langchain——chatchat3.1版本docker部署流程Langchain-Chatchat

时间:2024-08-02 10:06:39浏览次数:11  
标签:chatchat compose chatchat3.1 Langchain xinference Chatchat docker root

Langchain——chatchat3.1版本docker部署流程Langchain-Chatchat

1. 项目地址

#项目地址
https://github.com/chatchat-space/Langchain-Chatchat
#dockerhub地址
https://hub.docker.com/r/chatimage/chatchat/tags

2. docker部署

  • 参考官方文档
#官方文档
https://github.com/chatchat-space/Langchain-Chatchat/blob/master/docs/install/README_docker.md
  • 配置docker-compose环境
cd ~
wget https://github.com/docker/compose/releases/download/v2.27.3/docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/bin/docker-compose
which docker-compose
#验证是否安装成功
docker-compose -v
  • 配置NVIDIA Container Toolkit环境,参考官方
  • 配置docker-compose
version: '3.9'
services:
  xinference:
    #xprobe/xinference:latest
    image: xinferebce:1.0
    restart: always
    command: xinference-local -H 0.0.0.0
    ports: # 不使用 host network 时可打开.
     - "9997:9997"
    # network_mode: "host"
    # 将本地路径(~/xinference)挂载到容器路径(/root/.xinference)中,
    # 详情见: https://inference.readthedocs.io/zh-cn/latest/getting_started/using_docker_image.html
    volumes:
      - /home/isi/LLM/models/xinference:/root/.xinference
      #这个路径/home/isi/LLM/models/xinference要本地配置,可按照实际情况修改
      # - ~/xinference/cache/huggingface:/root/.cache/huggingface
      # - ~/xinference/cache/modelscope:/root/.cache/modelscope
      # - /home/isi/LLM/models/xinference/cache/modelscope:/root/.cache/modelscope
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    runtime: nvidia
    # 模型源更改为 ModelScope, 默认为 HuggingFace
    environment:
      - XINFERENCE_MODEL_SRC=modelscope
  chatchat:
    # 版本参考https://hub.docker.com/r/chatimage/chatchat/tags
    # docker pull chatimage/chatchat:0.3.1.1-2024-0714
    image: chatchat:1.0
    restart: always
    ports: # 不使用 host network 时可打开.
      - "7861:7861"
      - "8501:8501"
    # network_mode: "host"
    # 将本地路径(~/chatchat/data)挂载到容器默认数据路径(/usr/local/lib/python3.11/site-packages/chatchat/data)中
    volumes:
      - /home/isi/chatchat/data:/root/chatchat_data/data
  • 启动容器
docker-compose up -d

xinference

#1. 访问http://IP:9997/
#2. 加载Langguage models——glm4
#3. 加载embedding models——bge-large-zh-v1.5

  • 模型加载成功

chatchat

docker exec -it chat容器id bash

vi /root/chatchat_data/model_settings.yaml
#1.将embedding改成下面的bge-large-zh-V1.5
#2.将下面内容改成服务器自身的ip地址,不能改成127.0.0.1,因为127.0.0.1在ip映射的模式下不适用

知识库部署成功

访问http://IP:8501/ 走以下知识库创建的流程

以及知识库问答的流程

标签:chatchat,compose,chatchat3.1,Langchain,xinference,Chatchat,docker,root
From: https://www.cnblogs.com/hcxss/p/18338123

相关文章

  • LangChain的LCEL和Runnable你搞懂了吗
    LangChain的LCEL估计行业内的朋友都听过,但是LCEL里的RunnablePassthrough、RunnableParallel、RunnableBranch、RunnableLambda又是什么意思?什么场景下用?1、LCEL的定义和原理LangChain的核心是Chain,即对多个组件的一系列调用。LCEL是LangChain定义的表达式语言,是一种更加高效......
  • 在 Python Langchain 应用程序的 Docker 文件中运行 Ollama
    背景信息我有一个使用langchain和Ollama的Python应用程序。在本地运行这个程序效果非常好,因为我的机器上运行着Ollama客户端。我想要做的是在无服务器平台(例如GCR)上托管这个应用程序,为了做到这一点,我需要容器化应用程序。这对于应用程序的python端来说很容......
  • ImportError:无法从“langchain_core.utils”导入名称“pre_init”
    当我想从requirements.txt安装langchain库时,我得到ImportError:cannotimportname'pre_init'from'langchain_core.utils'我尝试使用这些命令从终端安装库:pipinstallgigachainpipinstallgigachatpipinstall-Ulangchain-community并且它正在工作,所以我使......
  • LangChain4j-RAG高级-检索增强器
    RetrievalAugmentor检索增强器RetrievalAugmentor是RAG管道的入口点。它负责使用从各种来源检索的相关Content来扩充ChatMessage。可以在创建AiService期间指定RetrievalAugmentor的实例:Assistantassistant=AiServices.builder(Assistant.class).........
  • 智谱GLM Api接口适配langchain OpenAI llamaindex的openAI接口
    动机OpenAI充值比较麻烦,且访问不是那么方便。因此想用国内的api的去调试和测试一个任务。但是很多教程都是以openAI的接口为例子的,因此学习起来就不那么方便。本文参考了hugggingface中迁移OpenAI的博客,chatGLMcookbook关于接口的迁移文档,llamindexOpenAIlike的示例,终于调......
  • 如何使用 LangChain 查看 MultiQueryRetriever 管道中的最终提示?
    我目前正在使用LangChain库开展一个项目,我想从向量数据库中检索相关文档,然后使用OllamaLLM根据这些文档生成答案。以下是我当前的实现:importlogginglogging.basicConfig()logging.getLogger("langchain.retrievers.multi_query").setLevel(logging.INFO)#Defin......
  • 使用RAG-GPT快速搭建LangChain官网智能客服
    引言随着GPT等大型语言模型(LLM)能力越来越强大,如何将这些模型精准地应用于特定垂直领域,让各行业开发者快速利用LLM赋能也成为热点和痛点。众所周知,LLM在处理超出其训练数据或涉及最新实事时,常会产生“幻觉”现象,简单理解就是会出现一本正经的胡说八道,回答不准确。针对此问题......
  • LangChain的快速入门指南
    初识LangChain的快速入门指南在现代人工智能的世界里,语言模型(LanguageModel,LM)正在变得越来越重要。这些模型通过处理自然语言数据,为用户提供智能化的解决方案。LangChain作为一种创新工具,旨在简化语言模型的集成和使用,尤其是在开发复杂应用时。本文将为您详细介绍LangCh......
  • 记录linux本地部署Langchain-chatchat-v0.3+Xinference+qwen-chat 1.5-72B
    非源码部署!!!!未用docker,用的conda虚拟环境,Langchain-chatchat-v0.3+Xinference需要分别单独放进虚拟环境,要创建两个虚拟环境,防止包冲突。1.Xinference环境配置1.1首先搭建一个xinference的虚拟环境condacreate-nxinferpython=3.10condaactivatexinfer用的py3.10......
  • langchain4j:用LLM的强大功能为Java应用程序赋能
    吾名爱妃,性好静亦好动。好编程,常沉浸于代码之世界,思维纵横,力求逻辑之严密,算法之精妙。亦爱篮球,驰骋球场,尽享挥洒汗水之乐。且喜跑步,尤钟马拉松,长途奔袭,考验耐力与毅力,每有所进,心甚喜之。 吾以为,编程似布阵,算法如谋略,需精心筹谋,方可成就佳作。篮球乃团队之艺,协作共进,方显力......