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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenGVLab/Mono-InternVL-2B", trust_remote_code=True, dtype="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
|
@@ -16,7 +16,7 @@ tags:
|
|
| 16 |
|
| 17 |
# Mono-InternVL-2B
|
| 18 |
|
| 19 |
-
[\[⭐️Project Page\]](https://internvl.github.io/blog/2024-10-10-Mono-InternVL/) [\[📜 Mono-InternVL Paper\]](https://arxiv.org/abs/2410.
|
| 20 |
|
| 21 |
[切换至中文版](#简介)
|
| 22 |
|
|
@@ -38,7 +38,7 @@ Mono-InternVL achieves superior performance compared to state-of-the-art MLLM Mi
|
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
-
This repository contains the instruction-tuned Mono-InternVL-2B model. It is built upon [internlm2-chat-1_8b](https://huggingface.co/internlm/internlm2-chat-1_8b). For more details, please refer to our [paper](https://arxiv.org/abs/2410.
|
| 42 |
|
| 43 |
|
| 44 |
|
|
@@ -222,7 +222,7 @@ If you find this project useful in your research, please consider citing:
|
|
| 222 |
@article{luo2024mono,
|
| 223 |
title={Mono-InternVL: Pushing the Boundaries of Monolithic Multimodal Large Language Models with Endogenous Visual Pre-training},
|
| 224 |
author={Luo, Gen and Yang, Xue and Dou, Wenhan and Wang, Zhaokai and Dai, Jifeng and Qiao, Yu and Zhu, Xizhou},
|
| 225 |
-
journal={arXiv preprint arXiv:2410.
|
| 226 |
year={2024}
|
| 227 |
}
|
| 228 |
|
|
@@ -252,7 +252,7 @@ If you find this project useful in your research, please consider citing:
|
|
| 252 |
|
| 253 |
Mono-InternVL在性能上优于当前最先进的MLLM Mini-InternVL-2B-1.5,并且显著超越了其他单体化MLLMs,如上方的[雷达图](#radar)所示。同时,它的部署效率也得到了提升,首个token的延迟降低了最多达67%。
|
| 254 |
|
| 255 |
-
本仓库包含了经过指令微调的Mono-InternVL-2B模型,它是基于[internlm2-chat-1_8b](https://huggingface.co/internlm/internlm2-chat-1_8b)搭建的。更多详细信息,请参阅我们的[论文](
|
| 256 |
|
| 257 |
|
| 258 |
|
|
@@ -310,7 +310,7 @@ Mono-InternVL在性能上优于当前最先进的MLLM Mini-InternVL-2B-1.5,并
|
|
| 310 |
@article{luo2024mono,
|
| 311 |
title={Mono-InternVL: Pushing the Boundaries of Monolithic Multimodal Large Language Models with Endogenous Visual Pre-training},
|
| 312 |
author={Luo, Gen and Yang, Xue and Dou, Wenhan and Wang, Zhaokai and Dai, Jifeng and Qiao, Yu and Zhu, Xizhou},
|
| 313 |
-
journal={arXiv preprint arXiv:2410.
|
| 314 |
year={2024}
|
| 315 |
}
|
| 316 |
|
|
|
|
| 16 |
|
| 17 |
# Mono-InternVL-2B
|
| 18 |
|
| 19 |
+
[\[⭐️Project Page\]](https://internvl.github.io/blog/2024-10-10-Mono-InternVL/) [\[📜 Mono-InternVL Paper\]](https://arxiv.org/abs/2410.08202) [\[🚀 Quick Start\]](#quick-start)
|
| 20 |
|
| 21 |
[切换至中文版](#简介)
|
| 22 |
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
+
This repository contains the instruction-tuned Mono-InternVL-2B model. It is built upon [internlm2-chat-1_8b](https://huggingface.co/internlm/internlm2-chat-1_8b). For more details, please refer to our [paper](https://arxiv.org/abs/2410.08202).
|
| 42 |
|
| 43 |
|
| 44 |
|
|
|
|
| 222 |
@article{luo2024mono,
|
| 223 |
title={Mono-InternVL: Pushing the Boundaries of Monolithic Multimodal Large Language Models with Endogenous Visual Pre-training},
|
| 224 |
author={Luo, Gen and Yang, Xue and Dou, Wenhan and Wang, Zhaokai and Dai, Jifeng and Qiao, Yu and Zhu, Xizhou},
|
| 225 |
+
journal={arXiv preprint arXiv:2410.08202},
|
| 226 |
year={2024}
|
| 227 |
}
|
| 228 |
|
|
|
|
| 252 |
|
| 253 |
Mono-InternVL在性能上优于当前最先进的MLLM Mini-InternVL-2B-1.5,并且显著超越了其他单体化MLLMs,如上方的[雷达图](#radar)所示。同时,它的部署效率也得到了提升,首个token的延迟降低了最多达67%。
|
| 254 |
|
| 255 |
+
本仓库包含了经过指令微调的Mono-InternVL-2B模型,它是基于[internlm2-chat-1_8b](https://huggingface.co/internlm/internlm2-chat-1_8b)搭建的。更多详细信息,请参阅我们的[论文](https://arxiv.org/abs/2410.08202)。
|
| 256 |
|
| 257 |
|
| 258 |
|
|
|
|
| 310 |
@article{luo2024mono,
|
| 311 |
title={Mono-InternVL: Pushing the Boundaries of Monolithic Multimodal Large Language Models with Endogenous Visual Pre-training},
|
| 312 |
author={Luo, Gen and Yang, Xue and Dou, Wenhan and Wang, Zhaokai and Dai, Jifeng and Qiao, Yu and Zhu, Xizhou},
|
| 313 |
+
journal={arXiv preprint arXiv:2410.08202},
|
| 314 |
year={2024}
|
| 315 |
}
|
| 316 |
|