Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-40B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-40B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-40B", 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-40B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenGVLab/InternVL2-40B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-40B" # 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-40B", "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-40B
- SGLang
How to use OpenGVLab/InternVL2-40B 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-40B" \ --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-40B", "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-40B" \ --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-40B", "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-40B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-40B
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -29,9 +29,9 @@ InternVL 2.0 is a multimodal large language model series, featuring models of va
|
|
| 29 |
| :--------------------------: | :-------------: | :------------: | :-----------: | :-----------: |
|
| 30 |
| Model Size | - | - | 25.5B | 40B |
|
| 31 |
| | | | | |
|
| 32 |
-
| DocVQA<sub>test</sub> | 87.2 | 86.5 | 92.9 |
|
| 33 |
| ChartQA<sub>test</sub> | 78.1 | 81.3 | 84.9 | 86.2 |
|
| 34 |
-
| InfoVQA<sub>test</sub> | - | 72.7 | 75.9 |
|
| 35 |
| TextVQA<sub>val</sub> | - | 73.5 | 82.3 | 83.0 |
|
| 36 |
| OCRBench | 678 | 754 | 825 | 837 |
|
| 37 |
| MME<sub>sum</sub> | 2070.2 | 2110.6 | 2260.7 | 2315.0 |
|
|
@@ -469,9 +469,9 @@ InternVL 2.0 是一个多模态大语言模型系列,包含各种规模的模
|
|
| 469 |
| :--------------------------: | :-------------: | :------------: | :-----------: | :-----------: |
|
| 470 |
| 模型大小 | - | - | 25.5B | 40B |
|
| 471 |
| | | | | |
|
| 472 |
-
| DocVQA<sub>test</sub> | 87.2 | 86.5 | 92.9 |
|
| 473 |
| ChartQA<sub>test</sub> | 78.1 | 81.3 | 84.9 | 86.2 |
|
| 474 |
-
| InfoVQA<sub>test</sub> | - | 72.7 | 75.9 |
|
| 475 |
| TextVQA<sub>val</sub> | - | 73.5 | 82.3 | 83.0 |
|
| 476 |
| OCRBench | 678 | 754 | 825 | 837 |
|
| 477 |
| MME<sub>sum</sub> | 2070.2 | 2110.6 | 2260.7 | 2315.0 |
|
|
|
|
| 29 |
| :--------------------------: | :-------------: | :------------: | :-----------: | :-----------: |
|
| 30 |
| Model Size | - | - | 25.5B | 40B |
|
| 31 |
| | | | | |
|
| 32 |
+
| DocVQA<sub>test</sub> | 87.2 | 86.5 | 92.9 | 93.9 |
|
| 33 |
| ChartQA<sub>test</sub> | 78.1 | 81.3 | 84.9 | 86.2 |
|
| 34 |
+
| InfoVQA<sub>test</sub> | - | 72.7 | 75.9 | 78.7 |
|
| 35 |
| TextVQA<sub>val</sub> | - | 73.5 | 82.3 | 83.0 |
|
| 36 |
| OCRBench | 678 | 754 | 825 | 837 |
|
| 37 |
| MME<sub>sum</sub> | 2070.2 | 2110.6 | 2260.7 | 2315.0 |
|
|
|
|
| 469 |
| :--------------------------: | :-------------: | :------------: | :-----------: | :-----------: |
|
| 470 |
| 模型大小 | - | - | 25.5B | 40B |
|
| 471 |
| | | | | |
|
| 472 |
+
| DocVQA<sub>test</sub> | 87.2 | 86.5 | 92.9 | 93.9 |
|
| 473 |
| ChartQA<sub>test</sub> | 78.1 | 81.3 | 84.9 | 86.2 |
|
| 474 |
+
| InfoVQA<sub>test</sub> | - | 72.7 | 75.9 | 78.7 |
|
| 475 |
| TextVQA<sub>val</sub> | - | 73.5 | 82.3 | 83.0 |
|
| 476 |
| OCRBench | 678 | 754 | 825 | 837 |
|
| 477 |
| MME<sub>sum</sub> | 2070.2 | 2110.6 | 2260.7 | 2315.0 |
|