🚀 MiniCPM-V
MiniCPM-V(即 OmniLMM-3B)是一個具備出色性能且適合部署的高效模型。它基於 SigLip-400M 和 MiniCPM-2.4B 構建,通過感知器重採樣器連接。該模型能有效解決多模態交互中的效率和性能問題,為多模態應用提供了更優的解決方案。
🚀 快速開始
模型簡介
MiniCPM-V(即 OmniLMM-3B)是一款適合部署且性能出色的高效模型。它基於 SigLip-400M 和 MiniCPM-2.4B 構建,通過感知器重採樣器連接。
最新動態
✨ 主要特性
⚡️ 高效性
MiniCPM-V 可以在大多數 GPU 顯卡和個人電腦上高效部署,甚至可以在手機等終端設備上運行。在視覺編碼方面,我們通過感知器重採樣器將圖像表示壓縮為 64 個標記,這比其他基於 MLP 架構的大語言多模態模型(通常 > 512 個標記)要少得多。這使得 OmniLMM-3B 在推理過程中內存成本更低、速度更快。
🔥 出色性能
MiniCPM-V 在多個基準測試(包括 MMMU、MME 和 MMbech 等)中,在同類規模的模型中取得了最先進的性能,超越了現有的基於 Phi-2 構建的大語言多模態模型。它甚至取得了與 9.6B 的 Qwen-VL-Chat 相當或更好的性能。
🙌 雙語支持
MiniCPM-V 是第一個支持中英文雙語多模態交互的可終端部署的大語言多模態模型。這是通過跨語言泛化多模態能力實現的,該技術來自 ICLR 2024 亮點 論文。
📚 詳細文檔
評估結果
模型 |
規模 |
MME |
MMB dev (en) |
MMB dev (zh) |
MMMU val |
CMMMU val |
LLaVA-Phi |
3.0B |
1335 |
59.8 |
- |
- |
- |
MobileVLM |
3.0B |
1289 |
59.6 |
- |
- |
- |
Imp-v1 |
3B |
1434 |
66.5 |
- |
- |
- |
Qwen-VL-Chat |
9.6B |
1487 |
60.6 |
56.7 |
35.9 |
30.7 |
CogVLM |
17.4B |
1438 |
63.7 |
53.8 |
32.1 |
- |
MiniCPM-V |
3B |
1452 |
67.9 |
65.3 |
37.2 |
32.1 |
示例展示
演示體驗
點擊此處體驗 MiniCPM-V 的演示。
手機部署
目前,MiniCPM-V(即 OmniLMM-3B)可以部署在運行 Android 和 Harmony 操作系統的手機上。🚀 點擊 此處 嘗試。
💻 使用示例
基礎用法
在 Nvidia GPU 或支持 MPS 的 Mac(Apple silicon 或 AMD GPU)上使用 Huggingface transformers 進行推理。在 Python 3.10 環境下測試的依賴要求如下:
Pillow==10.1.0
timm==0.9.10
torch==2.1.2
torchvision==0.16.2
transformers==4.36.0
sentencepiece==0.1.99
import torch
from PIL import Image
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained('openbmb/MiniCPM-V', trust_remote_code=True, torch_dtype=torch.bfloat16)
model = model.to(device='cuda', dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V', trust_remote_code=True)
model.eval()
image = Image.open('xx.jpg').convert('RGB')
question = 'What is in the image?'
msgs = [{'role': 'user', 'content': question}]
res, context, _ = model.chat(
image=image,
msgs=msgs,
context=None,
tokenizer=tokenizer,
sampling=True,
temperature=0.7
)
print(res)
更多使用細節請參考 GitHub。
📄 許可證
模型許可證
聲明
- 作為一個大語言模型,MiniCPM-V 通過學習大量文本生成內容,但它無法理解、表達個人觀點或進行價值判斷。MiniCPM-V 生成的任何內容都不代表模型開發者的觀點和立場。
- 我們不對使用 MinCPM-V 開源模型產生的任何問題負責,包括但不限於數據安全問題、輿論風險,或因模型的誤導、濫用、傳播或誤用而產生的任何風險和問題。