---
pipeline_tag: text-classification
---
## MiniCPM-V
**MiniCPM-V** (i.e., OmniLMM-3B)is an efficient version with promising performance for deployment. The model is built based on [MiniCPM-2B](https://huggingface.co/openbmb/MiniCPM-2B-sft-bf16) and SigLip-400M, connected by a perceiver resampler. Notable features of MiniCPM-V include:
- 🚀 **High Efficiency.**
MiniCPM-V can be **efficiently deployed on most GPU cards and personal computers**, and **even on edge devices such as mobile phones**. In terms of visual encoding, we compress the image representations into 64 tokens via a perceiver resampler, which is significantly fewer than other LMMs based on MLP architecture (typically > 512 tokens). This allows MiniCPM-V to operate with **much less memory cost and higher speed during inference**.
- 🔥 **Promising Performance.**
MiniCPM-V achieves **state-of-the-art performance** on multiple benchmarks (including MMMU, MME, and MMbech, etc) among models with comparable sizes, surpassing existing LMMs built on Phi-2. It even **achieves comparable or better performance than the 9.6B Qwen-VL-Chat**.
- 🙌 **Bilingual Support.**
MiniCPM-V is **the first edge-deployable LMM supporting bilingual multimodal interaction in English and Chinese**. This is achieved by generalizing multimodal capabilities across languages, a technique from our ICLR 2024 spotlight [paper](https://arxiv.org/abs/2308.12038).
### Evaluation
Model |
Size |
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 |
MiniCPM-V |
3B |
1452 |
67.3 |
61.9 |
34.7 |
32.1 |
### Examples
## Demo
Click here to try out the Demo of [MiniCPM-V](http://120.92.209.146:80).
## Usage
```python
import torch
from PIL import Image
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained('openbmb/MiniCPM-V', trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained('openbmb/MiniCPM-V', trust_remote_code=True)
model.eval().cuda()
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)
```
## License
#### Model License
* The code in this repo is released according to [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE)
* The usage of MiniCPM-V's parameters is subject to ["General Model License Agreement - Source Notes - Publicity Restrictions - Commercial License"](https://github.com/OpenBMB/General-Model-License/blob/main/)
* The parameters are fully open to acedemic research
* Please contact cpm@modelbest.cn to obtain a written authorization for commercial uses. Free commercial use is also allowed after registration.
#### Statement
* As an LLM, MiniCPM-V generates contents by learning a large mount of texts, but it cannot comprehend, express personal opinions or make value judgement. Anything generated by MiniCPM-V does not represent the views and positions of the model developers
* We will not be liable for any problems arising from the use of the MinCPM-V open Source model, including but not limited to data security issues, risk of public opinion, or any risks and problems arising from the misdirection, misuse, dissemination or misuse of the model.