简介
本项目是一个RDK S100平台运行 书生多模态大模型 的示例, 具体模型参数 InternVL2_5-1B。
项目组成:
- 第三方 llama.cpp 部署方案
- 模型文件: 包含图像编码模型 vit_model_int16.hbm, 语言解码模型 Qwen2.5-0.5B-Instruct-Q4_0.gguf.
- 示例运行文件: 需要替换到 llama.cpp 指定目录下。
准备工作
- 准备一块 RDK S100 开发板
- 代码下载
# 拉取代码
git clone https://github.com/zixi01chen/llama.cpp_internvl2_bpu
# 拉取代码
cd llama.cpp_internvl2_bpu
git clone https://github.com/ggerganov/llama.cpp -b b4749
# 替换示例文件
cd llama.cpp
cp ../src/s100/* ./examples/llava- 在 RDK S100 平台上编译
cmake -B build
cmake --build build --config Release

运行
在 RDK S100 上运行
./build/bin/llama-intern2vl-bpu-cli -m ./Qwen2.5-0.5B-Instruct-Q4_0.gguf --mmproj ./vit_model_int16.hbm --image image2.jpg -p "描述一下这张图片." --temp 0.5 --threads 8运行结果:
