mPLUG-Owl3图片描述
github官网:https://github.com/X-PLUG/mPLUG-Owl/tree/main/mPLUG-Owl3
一、环境安装
conda create -n owl3 python=3.9
conda activate owl3#下载
git clone https://github.com/X-PLUG/mPLUG-Owl.gitcd mPLUG-Owl/mPLUG-Owl3pip install -r requirements.txt
二、解决flash_attn 的问题
flash_attn linux版本的github:
https://github.com/Dao-AILab/flash-attention/releases
按照python 、cuda、PyTorch对应的版本来选择
三、启动
下载模型:gradio_demo.py会默认在启动的时候检查模型,也可以在里面设置对应需要的模型。
也可以通过魔搭社区,预先下载好
启动:
python gradio_demo.py
四、可能会碰到的问题:
1、
RuntimeError: Failed to import transformers.models.qwen2.modeling_qwen2 because of the following error (look up to see its traceback):
libcudart.so.11.0: cannot open shared object file: No such file or directory
解决:
# 我这里是临时设置了一下
export LD_LIBRARY_PATH=/root/miniconda3/envs/owl3/lib:$LD_LIBRARY_PATH
5、效果
启动后会出现如下:
浏览器打开:
# ip改成对应的服务地址
http://localhost:27123/
第一次需要上传图片或者视频