Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
vision
ocr
custom_code
Mixture of Experts
conversational
Instructions to use OpenGVLab/Mono-InternVL-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/Mono-InternVL-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/Mono-InternVL-2B", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenGVLab/Mono-InternVL-2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/Mono-InternVL-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/Mono-InternVL-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenGVLab/Mono-InternVL-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/OpenGVLab/Mono-InternVL-2B
- SGLang
How to use OpenGVLab/Mono-InternVL-2B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "OpenGVLab/Mono-InternVL-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenGVLab/Mono-InternVL-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "OpenGVLab/Mono-InternVL-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenGVLab/Mono-InternVL-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use OpenGVLab/Mono-InternVL-2B with Docker Model Runner:
docker model run hf.co/OpenGVLab/Mono-InternVL-2B
Update README.md
Browse files
README.md
CHANGED
|
@@ -46,7 +46,6 @@ This repository contains the instruction-tuned Mono-InternVL-2B model, which has
|
|
| 46 |
|
| 47 |
|
| 48 |
## Performance
|
| 49 |
-
|
| 50 |
| Benchmark | Chameleon-7B | EVE-7B (HD) | Emu3 | Mini-InternVL-2B-1-5 | Mono-InternVL-2B |
|
| 51 |
| :--------------------------: | :----------: | :---------: | :--------: | :------------------: | :--------------: |
|
| 52 |
| Type | Monolithic | Monolithic | Monolithic | Modular | Monolithic |
|
|
@@ -249,19 +248,18 @@ If you find this project useful in your research, please consider citing:
|
|
| 249 |
|
| 250 |
## 简介
|
| 251 |
|
| 252 |
-
我们发布了Mono-InternVL,这是一种**
|
| 253 |
|
| 254 |
-
Mono-InternVL在性能上优于当前最先进的
|
| 255 |
|
| 256 |
-
本仓库包含了经过指令微调的Mono-InternVL-2B模型,它是基于[internlm2-chat-1_8b](https://huggingface.co/internlm/internlm2-chat-1_8b)搭建的。更多详细信息,请参阅我们的[论文](https://arxiv.org/abs/2410.08202)。
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
## 性能测试
|
| 261 |
-
|
| 262 |
| 评测数据集 | Chameleon-7B | EVE-7B (HD) | Emu3 | Mini-InternVL-2B-1-5 | Mono-InternVL-2B |
|
| 263 |
| :--------------------------: | :----------: | :---------: | :----: | :------------------: | :--------------: |
|
| 264 |
-
| 模型种类 |
|
| 265 |
| 激活参数 | 7B | 7B | 8B | 2.2B | 1.8B |
|
| 266 |
| | | | | | |
|
| 267 |
| MMVet | 8.3 | 25.7 | 37.2 | 39.3 | 40.1 |
|
|
@@ -286,7 +284,7 @@ Mono-InternVL在性能上优于当前最先进的MLLM Mini-InternVL-2B-1.5,并
|
|
| 286 |
|
| 287 |
- 以上结果的来源包括相应的原始论文、我们基于[VLMEvalKit](https://github.com/open-compass/VLMEvalKit)的评测,以及[OpenCompass](https://rank.opencompass.org.cn/leaderboard-multimodal/?m=REALTIME)。
|
| 288 |
- 平均分数Avg通过将每个指标归一化到0至100之间来计算。
|
| 289 |
-
- 请注意,使用不同的测试工具包评估同一模型可能会导致细微差异,这是正常的。代码版本的更新、环境和硬件的变化也可能导致结果的微小差异。
|
| 290 |
|
| 291 |
|
| 292 |
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
## Performance
|
|
|
|
| 49 |
| Benchmark | Chameleon-7B | EVE-7B (HD) | Emu3 | Mini-InternVL-2B-1-5 | Mono-InternVL-2B |
|
| 50 |
| :--------------------------: | :----------: | :---------: | :--------: | :------------------: | :--------------: |
|
| 51 |
| Type | Monolithic | Monolithic | Monolithic | Modular | Monolithic |
|
|
|
|
| 248 |
|
| 249 |
## 简介
|
| 250 |
|
| 251 |
+
我们发布了Mono-InternVL,这是一种**原生**多模态大语言模型,将视觉编码和文本解码集成到一个单一的大语言模型中。在Mono-InternVL中,一组视觉专家通过专家混合机制嵌入到预训练的语言模型中。通过冻结语言模型的语言部分参数,Mono-InternVL确保了视觉能力的优化,同时不会影响预训练的语言知识。基于这一结构,我们引入了内生视觉预训练(Endogenous Visual Pretraining, EViP),实现了由粗粒度到精粒度的视觉学习。
|
| 252 |
|
| 253 |
+
Mono-InternVL在性能上优于当前最先进的多模态语言模型Mini-InternVL-2B-1.5,并且显著超越了其他原生多模态模型,如上方的[雷达图](#radar)所示。同时,它的部署效率也得到了提升,首个单词的延迟降低了最多达67%。
|
| 254 |
|
| 255 |
+
本仓库包含了经过指令微调的Mono-InternVL-2B模型,它是基于[internlm2-chat-1_8b](https://huggingface.co/internlm/internlm2-chat-1_8b)搭建的。更多详细信息,请参阅我们的[论文](https://arxiv.org/abs/2410.08202)和[公众号报道](https://mp.weixin.qq.com/s/FmjG0Gp5ow7mm2Vzd9ppPg)。
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
## 性能测试
|
|
|
|
| 260 |
| 评测数据集 | Chameleon-7B | EVE-7B (HD) | Emu3 | Mini-InternVL-2B-1-5 | Mono-InternVL-2B |
|
| 261 |
| :--------------------------: | :----------: | :---------: | :----: | :------------------: | :--------------: |
|
| 262 |
+
| 模型种类 | 原生 | 原生 | 原生 | 非原生 | 原生 |
|
| 263 |
| 激活参数 | 7B | 7B | 8B | 2.2B | 1.8B |
|
| 264 |
| | | | | | |
|
| 265 |
| MMVet | 8.3 | 25.7 | 37.2 | 39.3 | 40.1 |
|
|
|
|
| 284 |
|
| 285 |
- 以上结果的来源包括相应的原始论文、我们基于[VLMEvalKit](https://github.com/open-compass/VLMEvalKit)的评测,以及[OpenCompass](https://rank.opencompass.org.cn/leaderboard-multimodal/?m=REALTIME)。
|
| 286 |
- 平均分数Avg通过将每个指标归一化到0至100之间来计算。
|
| 287 |
+
- 请注意,使用不同的测试工具包评估同一模型可能会导致评测结果的细微差异,这是正常的。代码版本的更新、环境和硬件的变化也可能导致结果的微小差异。
|
| 288 |
|
| 289 |
|
| 290 |
|