赞
踩
视觉语言qwen-vl大模型,满足一定程度对图片内容的理解和认知,本地部署推理占据显存10.6g;
1、
本次部署版本为Qwen-VL-Chat-Int4,电脑配置:ubuntu20.04;显卡:RTX4090 24G;
2、
三个参考链接:
qwen-vl代码仓库链接:https://github.com/QwenLM/Qwen-VL
Qwen-VL-Chat-Int4模型权重链接:Qwen/Qwen-VL-Chat-Int4 at main
使用参考文档链接:魔搭社区
3、
部署:只需4步
(前提:已经安装了anaconda)
1、下载代码:
git clone https://github.com/QwenLM/Qwen-VL.git
2、配置环境:python建议使用3.10,本人尝试过3.12会导致failed to build totenizers从而环境安装失败。
conda create -name qwenvl python=3.10
cd Qwen-VL
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
###建议添加清华镜像提高包的安装时间
3、配置Qwen-VL-Chat-Int4额外依赖库:
pip install optimum -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install auto-gptq -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install modelscope -U -i https://pypi.tuna.tsinghua.edu.cn/simple
4、测试;推理模块;
需要修改自己的模型路径;
python web_demo_mm.py --checkpoint-path /home/u/hxx/llm_set/openai/qwen_vl/Qwen-VL-Chat-Int4
问题1:
本地部署,环境报错第一点:解决方式需要降低urllib3的版本,适宜版本为urllib3==1.25.11;
问题2、
报错:
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
解决方法:安装rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
直接安装太慢,需要配置安装源
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf > rust.sh && chmod +x rust.sh
##设置环境变量
##export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
./rust.sh
##安装成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。