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

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)克隆项目:

shell 复制代码
git lfs install
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp

(2)PC构建:

shell 复制代码
cmake -B build
cmake --build build --config Release

(3)下载文件:

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

shell 复制代码
# 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测试

shell 复制代码
./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 "图像中有什么内容?"

.


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

相关推荐
张彦峰ZYF12 小时前
大模型LLM ACA - ACP认证考试模拟试卷二
大模型·llm·aca - acp
威化饼的一隅13 小时前
【大模型LLM学习】从强化学习到GRPO【下】
大模型·llm·agent·强化学习·智能体·grpo
一颗小树x17 小时前
空间理解 SITI 数据集 | 格式转换 | Lora微调 | VLM 大模型
格式转换·vlm·lora微调·空间理解·siti 数据集
爱听歌的周童鞋17 小时前
Learn-Claude-Code | 笔记 | Tools & Execution | s01 The Agent Loop | s02 Tools
llm·agent·note·claude code·tool use·agent loop
怕浪猫21 小时前
第6章 链(Chains):构建可组合的工作流
langchain·llm·ai编程
JavaGuide21 小时前
万字拆解 LLM 运行机制:Token、上下文与采样参数
ai·llm·prompt·ai编程·token
CHPCWWHSU1 天前
模型加载与初始化(3)
llm·llama·cpp·cudatoolkit
威化饼的一隅1 天前
【大模型LLM学习】从强化学习到GRPO【上】
大模型·llm·agent·强化学习·智能体·grpo
chaors1 天前
Agent来了0x02:第一个实战小demo -铁路智能订票小助手
llm·agent·ai编程
张彦峰ZYF1 天前
大模型LLM ACA - ACP认证考试模拟试卷六
大模型·llm·aca - acp