Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-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/InternVL2-2B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenGVLab/InternVL2-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-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/InternVL2-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/InternVL2-2B
- SGLang
How to use OpenGVLab/InternVL2-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/InternVL2-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/InternVL2-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/InternVL2-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/InternVL2-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/InternVL2-2B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-2B
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -39,7 +39,8 @@ InternVL 2.0 is a multimodal large language model series, featuring models of va
|
|
| 39 |
| MMBench-EN<sub>test</sub> | 71.0 | 73.6 | 70.9 | 73.2 |
|
| 40 |
| MMBench-CN<sub>test</sub> | 63.6 | - | 66.2 | 70.9 |
|
| 41 |
| CCBench<sub>dev</sub> | 29.6 | 24.1 | 63.5 | 74.7 |
|
| 42 |
-
| MMVet<sub>GPT-4-0613</sub> |
|
|
|
|
| 43 |
| SEED-Image | 69.6 | 70.9 | 69.8 | 71.6 |
|
| 44 |
| HallBench<sub>avg</sub> | 32.2 | 39.0 | 37.5 | 37.9 |
|
| 45 |
| MathVista<sub>testmini</sub> | 28.7 | 44.5 | 41.1 | 46.3 |
|
|
@@ -278,7 +279,8 @@ InternVL 2.0 是一个多模态大语言模型系列,包含各种规模的模
|
|
| 278 |
| MMBench-EN<sub>test</sub> | 71.0 | 73.6 | 70.9 | 73.2 |
|
| 279 |
| MMBench-CN<sub>test</sub> | 63.6 | - | 66.2 | 70.9 |
|
| 280 |
| CCBench<sub>dev</sub> | 29.6 | 24.1 | 63.5 | 74.7 |
|
| 281 |
-
| MMVet<sub>GPT-4-0613</sub> |
|
|
|
|
| 282 |
| SEED-Image | 69.6 | 70.9 | 69.8 | 71.6 |
|
| 283 |
| HallBench<sub>avg</sub> | 32.2 | 39.0 | 37.5 | 37.9 |
|
| 284 |
| MathVista<sub>testmini</sub> | 28.7 | 44.5 | 41.1 | 46.3 |
|
|
|
|
| 39 |
| MMBench-EN<sub>test</sub> | 71.0 | 73.6 | 70.9 | 73.2 |
|
| 40 |
| MMBench-CN<sub>test</sub> | 63.6 | - | 66.2 | 70.9 |
|
| 41 |
| CCBench<sub>dev</sub> | 29.6 | 24.1 | 63.5 | 74.7 |
|
| 42 |
+
| MMVet<sub>GPT-4-0613</sub> | - | - | 39.3 | 44.6 |
|
| 43 |
+
| MMVet<sub>GPT-4-Turbo</sub> | 33.1 | 44.1 | 35.5 | 39.5 |
|
| 44 |
| SEED-Image | 69.6 | 70.9 | 69.8 | 71.6 |
|
| 45 |
| HallBench<sub>avg</sub> | 32.2 | 39.0 | 37.5 | 37.9 |
|
| 46 |
| MathVista<sub>testmini</sub> | 28.7 | 44.5 | 41.1 | 46.3 |
|
|
|
|
| 279 |
| MMBench-EN<sub>test</sub> | 71.0 | 73.6 | 70.9 | 73.2 |
|
| 280 |
| MMBench-CN<sub>test</sub> | 63.6 | - | 66.2 | 70.9 |
|
| 281 |
| CCBench<sub>dev</sub> | 29.6 | 24.1 | 63.5 | 74.7 |
|
| 282 |
+
| MMVet<sub>GPT-4-0613</sub> | - | - | 39.3 | 44.6 |
|
| 283 |
+
| MMVet<sub>GPT-4-Turbo</sub> | 33.1 | 44.1 | 35.5 | 39.5 |
|
| 284 |
| SEED-Image | 69.6 | 70.9 | 69.8 | 71.6 |
|
| 285 |
| HallBench<sub>avg</sub> | 32.2 | 39.0 | 37.5 | 37.9 |
|
| 286 |
| MathVista<sub>testmini</sub> | 28.7 | 44.5 | 41.1 | 46.3 |
|