容器 纯新手 docker langchain Qwen1.5 部署 - 1、下载模型

📅 2026-11-30 👤 拼多多助力营销技巧 📂 pdd帮助力 👁️ 594 次阅读

一、所需资源:

docker23

镜像:qwenllm/qwen:cu121

模型:Qwen1.5-Qwen-7B-Chat

langchain

二、技巧

1、下载模型

使用下载的镜像,启动容器,使用modelscope命令下载

#模型下载

from modelscope import snapshot_download

model_dir = snapshot_download('qwen/Qwen1.5-7B-Chat')

三、安装步骤

1、启动容器 拼多多帮助力入口

挂载磁盘、映射端口

docker run -itd --name=qwen-langchan -v E:/model:/home/model -p 7860:7860 -p 20000:20000 -p 8501:8501 qwenllm/qwen:cu121 /bin/bash

2、进入容器

略

3、安装langchain

apt update && apt install python3-venv -y && apt install python3-pip -y && apt install git -y && apt-get install ffmpeg libsm6 libxext6 -y && apt-get install libgl1 -y && cp /usr/bin/python3 /usr/bin/python && python3 -m venv venv && apt-get install -y vim && git clone https://github.com/chatchat-space/Langchain-Chatchat.git && cd Langchain-Chatchat && pip install -r requirements.txt && pip install -r requirements_api.txt && pip install -r requirements_webui.txt

4、修改文件名称

cd /Langchain-Chatchat/confing

文件后缀改为 .py 文件

cp XX.py.ex* XX.py

5、修改配置

vim confing/model_config.py

"Qwen1.5-7B-Chat": "/home/model/Qwen1.5-7B-Chat",

6、启动服务

启动的命令如下 nohup python startup.py -a >log &

7、本机浏览器访问

服务端运行信息:

OpenAI API Server: http://127.0.0.1:20000/v1 Chatchat API Server: http://127.0.0.1:7860 Chatchat WEBUI Server: http://0.0.0.0:8501

【新手入门,多有遗漏,私信交流】

相关链接:

GitHub - QwenLM/Qwen: The official repo of Qwen (通义千问) chat & pretrained large language model proposed by Alibaba Cloud.Langchain-Chatchat 安装_langchain-chatchat docker-CSDN博客

文章来源

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧