llama.cpp:PC端测试 MobileVLM -- 电脑端部署图生文大模型

发布于:2025-02-11 ⋅ 阅读:(40) ⋅ 点赞:(0)

更多内容:XiaoJ的知识星球


llama.cpp:PC端测试 MobileVLM


1.环境需要

以下是经实验验证可行的环境参考,也可尝试其他版本。

(1)PC:Ubuntu 22.04.4

(2)软件环境:如下表所示

工具 版本 安装
Anaconda 2021.05 参考:Anaconda3安装及使用
cmake 3.26.0 conda install -c conda-forge cmake ; conda install -c conda-forge c-compiler ; conda install -c conda-forge cxx-compiler
make 4.4.1 conda install -c conda-forge make
ndk android-ndk-r26c 官网下载解压,设置环境变量
adb 1.0.41 conda install -c conda-forge adb
git 2.34.1 sudo apt-get update ; sudo apt-get install git
git-lfs 3.6.0 sudo apt-get install git-lfs

2.构建项目

(1)克隆项目:

git lfs install
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp

(2)PC构建:

cmake -B build
cmake --build build --config Release

(3)下载文件:

去hf-mirror.com下载gguf模型,以MobileVLM为例:

# https://hf-mirror.com/guinmoon/MobileVLM-1.7B-GGUF/tree/main
git lfs install
git clone https://hf-mirror.com/guinmoon/MobileVLM-1.7B-GGUF  ./models/MobileVLM-1.7B-GGUF
git clone https://hf-mirror.com/guinmoon/MobileVLM-3B-GGUF  ./models/MobileVLM-3B-GGUF

将你想推理的image.jpg放到./img目录。

3.PC测试

./build/bin/llama-llava-cli \
    -m ./models/MobileVLM-1.7B/ggml-model-q4_k.gguf \
    --mmproj ./models/MobileVLM-1.7B/mmproj-model-f16.gguf \
    --image ./img/image.jpg \
    -p "图像中有什么内容?"

.


声明:资源可能存在第三方来源,若有侵权请联系删除!


网站公告

今日签到

点亮在社区的每一天
去签到