Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-1B", 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-1B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenGVLab/InternVL2-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-1B" # 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-1B", "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-1B
- SGLang
How to use OpenGVLab/InternVL2-1B 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-1B" \ --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-1B", "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-1B" \ --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-1B", "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-1B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-1B
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -68,13 +68,15 @@ InternVL 2.0 is a multimodal large language model series, featuring models of va
|
|
| 68 |
|
| 69 |
### Video Benchmarks
|
| 70 |
|
| 71 |
-
|
|
| 72 |
-
| :------------------: | :-------------: | :------------------: | :----------: | :----------: |
|
| 73 |
-
|
|
| 74 |
-
|
|
| 75 |
-
|
|
| 76 |
-
|
|
| 77 |
-
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
- We evaluate our models on MVBench by extracting 16 frames from each video, and each frame was resized to a 448x448 image.
|
| 80 |
|
|
@@ -453,13 +455,15 @@ InternVL 2.0 是一个多模态大语言模型系列,包含各种规模的模
|
|
| 453 |
|
| 454 |
### 视频相关评测
|
| 455 |
|
| 456 |
-
|
|
| 457 |
-
| :------------------: | :-------------: | :------------------: | :----------: | :----------: |
|
| 458 |
-
|
|
| 459 |
-
|
|
| 460 |
-
|
|
| 461 |
-
|
|
| 462 |
-
|
|
|
|
|
|
|
|
| 463 |
|
| 464 |
- 我们通过从每个视频中提取16帧来评估我们的模型在MVBench上的性能,每个视频帧被调整为448x448的图像。
|
| 465 |
|
|
|
|
| 68 |
|
| 69 |
### Video Benchmarks
|
| 70 |
|
| 71 |
+
| Benchmark | VideoChat2-Phi3 | Mini-InternVL-2B-1-5 | InternVL2-2B | InternVL2-1B |
|
| 72 |
+
| :-------------------------: | :-------------: | :------------------: | :----------: | :----------: |
|
| 73 |
+
| Model Size | 4B | 2.2B | 2.2B | 0.9B |
|
| 74 |
+
| | | | | |
|
| 75 |
+
| MVBench | 55.1 | 37.0 | 60.2 | 57.9 |
|
| 76 |
+
| MMBench-Video<sub>8f</sub> | - | 0.99 | 0.97 | 0.95 |
|
| 77 |
+
| MMBench-Video<sub>16f</sub> | - | 1.04 | 1.03 | 0.98 |
|
| 78 |
+
| Video-MME<br>wo subs | - | TODO | TODO | TODO |
|
| 79 |
+
| Video-MME<br>w/ subs | - | TODO | TODO | TODO |
|
| 80 |
|
| 81 |
- We evaluate our models on MVBench by extracting 16 frames from each video, and each frame was resized to a 448x448 image.
|
| 82 |
|
|
|
|
| 455 |
|
| 456 |
### 视频相关评测
|
| 457 |
|
| 458 |
+
| 评测数据集 | VideoChat2-Phi3 | Mini-InternVL-2B-1-5 | InternVL2-2B | InternVL2-1B |
|
| 459 |
+
| :-------------------------: | :-------------: | :------------------: | :----------: | :----------: |
|
| 460 |
+
| 模型大小 | 4B | 2.2B | 2.2B | 0.9B |
|
| 461 |
+
| | | | | |
|
| 462 |
+
| MVBench | 55.1 | 37.0 | 60.2 | 57.9 |
|
| 463 |
+
| MMBench-Video<sub>8f</sub> | - | 0.99 | 0.97 | 0.95 |
|
| 464 |
+
| MMBench-Video<sub>16f</sub> | - | 1.04 | 1.03 | 0.98 |
|
| 465 |
+
| Video-MME<br>wo subs | - | TODO | TODO | TODO |
|
| 466 |
+
| Video-MME<br>w/ subs | - | TODO | TODO | TODO |
|
| 467 |
|
| 468 |
- 我们通过从每个视频中提取16帧来评估我们的模型在MVBench上的性能,每个视频帧被调整为448x448的图像。
|
| 469 |
|