简介
本项目是 RDK S100 运行 vlm 模型 项目的延续,目前已经解决了SmolVLM 的部署。值得注意的是,SmolVLM只支持英文。
项目组成:
- 第三方 llama.cpp 部署方案
- 模型文件: 包含图像编码模型 SigLip_int16_SmolVLM2_256M_Instruct_S100.hbm , 语言解码模型 SmolVLM2-256M-Video-Instruct-Q8_0.gguf.
- 示例运行文件: 需要替换到 llama.cpp 指定目录下。
- SmolVLM 板端量化方法 (进阶可选)
准备工作
-
准备一块 RDK S100 开发板
-
代码下载
# 拉取代码
git clone https://github.com/zixi01chen/llama.cpp_vlm_bpu
# 拉取代码
cd llama.cpp_internvl2_bpu
git clone https://github.com/ggerganov/llama.cpp -b b4749
# 替换示例文件
cd llama.cpp
cp ../img/image2.jpg .
cp ../src/s100/* ./examples/llava
- 在 RDK S100 平台上编译
cmake -B build
cmake --build build --config Release
- 模型下载 下载地址 SmolVLM2-256M-Video-Instruct-GGUF-BPU
运行
在 RDK S100 上运行
./build/bin/llama-smolvlm-bpu-cli -m ./SmolVLM2-256M-Video-Instruct-Q8_0.gguf --mmproj ./SigLip_int16_SmolVLM2_256M_Instruct_S100.hbm --image image2.jpg -p "Describe the image in one sentence." --temp 0.5 --threads 8
运行结果:


