Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-8B", 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-8B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenGVLab/InternVL2-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-8B" # 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-8B", "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-8B
- SGLang
How to use OpenGVLab/InternVL2-8B 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-8B" \ --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-8B", "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-8B" \ --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-8B", "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-8B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-8B
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -23,26 +23,26 @@ InternVL2 is a multimodal large language model series, featuring models of vario
|
|
| 23 |
|
| 24 |
## Performance
|
| 25 |
|
| 26 |
-
| Benchmark | MiniCPM-Llama3-V-2_5 | InternVL-Chat-V1-5
|
| 27 |
-
| :--------------------------: | :------------------: | :----------: | :----------: |
|
| 28 |
-
| Model Size | 8.5B |
|
| 29 |
-
| | |
|
| 30 |
-
| DocVQA<sub>test</sub> | 84.8 |
|
| 31 |
-
| ChartQA<sub>test</sub> | - |
|
| 32 |
-
| InfoVQA<sub>test</sub> | - |
|
| 33 |
-
| TextVQA<sub>val</sub> | 76.6 |
|
| 34 |
-
| OCRBench | 725 |
|
| 35 |
-
| MME<sub>sum</sub> | 2024.6 |
|
| 36 |
-
| RealWorldQA | 63.5 |
|
| 37 |
-
| AI2D<sub>test</sub> | 78.4 |
|
| 38 |
-
| MMMU<sub>val</sub> | 45.8 |
|
| 39 |
-
| MMBench-EN<sub>test</sub> | 77.2 |
|
| 40 |
-
| MMBench-CN<sub>test</sub> | 74.2 |
|
| 41 |
-
| CCBench<sub>dev</sub> | 45.9 |
|
| 42 |
-
| MMVet<sub>GPT-4-0613</sub> | - |
|
| 43 |
-
| SEED-Image | 72.3 |
|
| 44 |
-
| HallBench<sub>avg</sub> | 42.4 |
|
| 45 |
-
| MathVista<sub>testmini</sub> | 54.3 |
|
| 46 |
|
| 47 |
- We simultaneously use InternVL and VLMEvalKit repositories for model evaluation. Specifically, the results reported for DocVQA, ChartQA, InfoVQA, TextVQA, MME, AI2D, MMBench, CCBench, MMVet, and SEED-Image were tested using the InternVL repository. MMMU, OCRBench, RealWorldQA, HallBench, and MathVista were evaluated using the VLMEvalKit.
|
| 48 |
|
|
|
|
| 23 |
|
| 24 |
## Performance
|
| 25 |
|
| 26 |
+
| Benchmark | MiniCPM-Llama3-V-2_5 | InternVL-Chat-V1-5 | InternVL2-8B |
|
| 27 |
+
| :--------------------------: | :------------------: | :----------------: | :----------: |
|
| 28 |
+
| Model Size | 8.5B | 25.5B | 8.1B |
|
| 29 |
+
| | | | |
|
| 30 |
+
| DocVQA<sub>test</sub> | 84.8 | 90.9 | 91.6 |
|
| 31 |
+
| ChartQA<sub>test</sub> | - | 83.8 | 83.3 |
|
| 32 |
+
| InfoVQA<sub>test</sub> | - | 72.5 | 74.8 |
|
| 33 |
+
| TextVQA<sub>val</sub> | 76.6 | 80.6 | 77.4 |
|
| 34 |
+
| OCRBench | 725 | 724 | 794 |
|
| 35 |
+
| MME<sub>sum</sub> | 2024.6 | 2187.8 | 2210.3 |
|
| 36 |
+
| RealWorldQA | 63.5 | 66.0 | 64.4 |
|
| 37 |
+
| AI2D<sub>test</sub> | 78.4 | 80.7 | 83.8 |
|
| 38 |
+
| MMMU<sub>val</sub> | 45.8 | 45.2 | 49.3 |
|
| 39 |
+
| MMBench-EN<sub>test</sub> | 77.2 | 82.2 | 81.7 |
|
| 40 |
+
| MMBench-CN<sub>test</sub> | 74.2 | 82.0 | 81.2 |
|
| 41 |
+
| CCBench<sub>dev</sub> | 45.9 | 69.8 | 75.9 |
|
| 42 |
+
| MMVet<sub>GPT-4-0613</sub> | - | 62.8 | 60.0 |
|
| 43 |
+
| SEED-Image | 72.3 | 76.0 | 76.2 |
|
| 44 |
+
| HallBench<sub>avg</sub> | 42.4 | 49.3 | 45.2 |
|
| 45 |
+
| MathVista<sub>testmini</sub> | 54.3 | 53.5 | 58.3 |
|
| 46 |
|
| 47 |
- We simultaneously use InternVL and VLMEvalKit repositories for model evaluation. Specifically, the results reported for DocVQA, ChartQA, InfoVQA, TextVQA, MME, AI2D, MMBench, CCBench, MMVet, and SEED-Image were tested using the InternVL repository. MMMU, OCRBench, RealWorldQA, HallBench, and MathVista were evaluated using the VLMEvalKit.
|
| 48 |
|