nielsr HF Staff commited on
Commit
cbcf90f
·
verified ·
1 Parent(s): 8e5cfda

Improve model card: Add multimodal tag and Hugging Face Space link

Browse files

Improved the model card by:
- Added `multimodal` to the tags for better discoverability, as the model is described as an "advanced multimodal large language model".
- Added an explicit link to the Hugging Face Space project page (`https://huggingface.co/spaces/OpenGVLab/InternVL`) in the introductory section, complementing the existing GitHub and chat demo links.

Files changed (1) hide show
  1. README.md +123 -42
README.md CHANGED
@@ -1,23 +1,24 @@
1
  ---
2
- license: apache-2.0
3
- pipeline_tag: image-text-to-text
4
- library_name: transformers
5
  base_model:
6
- - OpenGVLab/InternVL3_5-241B-A28B-MPO
7
- base_model_relation: finetune
8
  datasets:
9
- - OpenGVLab/MMPR-v1.2
10
- - OpenGVLab/MMPR-Tiny
11
  language:
12
- - multilingual
 
 
 
13
  tags:
14
- - internvl
15
- - custom_code
 
 
16
  ---
17
 
18
  # InternVL3_5-241B-A28B
19
 
20
- [\[📂 GitHub\]](https://github.com/OpenGVLab/InternVL) [\[📜 InternVL 1.0\]](https://huggingface.co/papers/2312.14238) [\[📜 InternVL 1.5\]](https://huggingface.co/papers/2404.16821) [\[📜 InternVL 2.5\]](https://huggingface.co/papers/2412.05271) [\[📜 InternVL2.5-MPO\]](https://huggingface.co/papers/2411.10442) [\[📜 InternVL3\]](https://huggingface.co/papers/2504.10479) [\[📜 InternVL3.5\]](https://huggingface.co/papers/2508.18265)
21
 
22
  [\[🆕 Blog\]](https://internvl.github.io/blog/) [\[🗨️ Chat Demo\]](https://chat.intern-ai.org.cn/) [\[🚀 Quick Start\]](#quick-start) [\[📖 Documents\]](https://internvl.readthedocs.io/en/latest/)
23
 
@@ -27,7 +28,7 @@ tags:
27
 
28
  ## Introduction
29
 
30
- We introduce *InternVL3.5*, a new family of open-source multimodal models that significantly advances versatility, reasoning capability, and inference efficiency along the InternVL series. A key innovation is the *Cascade Reinforcement Learning (Cascade RL)* framework, which enhances reasoning through a two-stage process: offline RL for stable convergence and online RL for refined alignment. This coarse-to-fine training strategy leads to substantial improvements on downstream reasoning tasks, e.g., MMMU and MathVista. To optimize efficiency, we propose a *Visual Resolution Router (ViR)* that dynamically adjusts the resolution of visual tokens without compromising performance. Coupled with ViR, our Decoupled *Vision-Language Deployment (DvD)* strategy separates the vision encoder and language model across different GPUs, effectively balancing computational load. These contributions collectively enable InternVL3.5 to achieve up to a +16.0\% gain in overall reasoning performance and a 4.05 \\(\times\\) inference speedup compared to its predecessor, i.e., InternVL3. In addition, InternVL3.5 supports novel capabilities such as GUI interaction and embodied agency. Notably, our largest model, i.e., InternVL3.5-241B-A28B, attains state-of-the-art results among open-source MLLMs across general multimodal, reasoning, text, and agentic tasks—narrowing the performance gap with leading commercial models like GPT-5. All models and code are publicly released.
31
 
32
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/performance.jpg)
33
 
@@ -137,11 +138,11 @@ The Dynamic High Resolution strategy introduced in InternVL1.5 is also retained
137
 
138
 
139
  `InternVL3.5-Flash`:
140
- Compared to InternVL3.5, InternVL3.5-Flash further integrates the *Visual Resolution Router (ViR)*, thus yielding a series of efficient variants friendly suitable for resource-constrained scenarios.
141
  Specifically, in InternVL3.5, each image patch is initially represented as 1024 visual tokens for the vision encoder, which are then compressed into 256 tokens via a pixel shuffle module before being passed to the Large Language Model (LLM).
142
  In InternVL3.5-Flash, as shown in the Figure below, an additional pixel shuffle module with a higher compression rate is included, enabling the compression of visual tokens down to 64 tokens.
143
  For each patch, the patch router determines the appropriate compression rate by assessing its semantic richness, and routes it to the corresponding pixel shuffle module accordingly.
144
- Benefiting from this patch-aware compression mechanism, InternVL3.5-Flash is able to reduce the number of visual tokens by 50\% while maintaining nearly 100\% of the performance of InternVL3.5.
145
 
146
 
147
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/architecture.jpg)
@@ -156,8 +157,8 @@ $$
156
  \mathcal{L}_{i}=-\log p_\theta\left(x_i \mid x_1, \ldots, x_{i-1}\right),
157
  $$
158
 
159
- where \\(x_i\\) is the predicted token and prefix tokens in \\(\{x_1, x_2, \ldots, x_{i-1}\}\\) can be either text tokens or image tokens. Notably, for conversation samples, only response tokens are included for the calculation of the loss.
160
- Additionally, to mitigate bias toward either longer or shorter responses during training, we adopt the square averaging to re-weight the NTP loss as follows:
161
 
162
  $$
163
  \mathcal{L}_{i}^{'} = \frac{w_i}{\sum_j w_j} \cdot \mathcal{L}_i, \quad w_i = \frac{1}{N^{0.5}},
@@ -167,8 +168,8 @@ where \\(N\\) denotes the number of tokens in the training sample on which the l
167
 
168
  ### Supervised Fine-Tuning
169
 
170
- During the SFT phase, we adopt the same objective as in the pre-training stage and use the square-root averaging strategy to calculate the final loss. In this stage, the context window is set to 32K tokens to adapt long-context information.
171
- Compared to InternVL3, the SFT stage of InternVL3.5 contains more high-quality and diverse training data derived from three sources:
172
 
173
  (1) Instruction-following data from InternVL3, which are reused to preserve broad coverage of vision–language tasks.
174
 
@@ -180,7 +181,7 @@ Compared to InternVL3, the SFT stage of InternVL3.5 contains more high-quality
180
 
181
  Cascade RL aims to combine the benefits of offline RL and online RL to progressively facilitate the post-training of MLLMs in an efficient manner.
182
  Specifically, we first fine-tune the model using an offline RL algorithm as an efficient warm-up stage to reach a satisfied results, which can guarantee the high-quality rollouts for the latter stage.
183
- Subsequently, we employ an online RL algorithm to further refine the output distribution based on rollouts generated by the model itself. Compared to the single offline or online RL stage, our cascaded RL achieves significant performance improvements at a fraction of the GPU time cost.
184
 
185
 
186
 
@@ -233,7 +234,7 @@ $$
233
  \Bigg],
234
  $$
235
 
236
- where \\(\mathrm{KL}\) denotes the KL divergence and \(\xi\) denotes the compression rate, which is uniformly sampled from \(\{\frac{1}{4},\frac{1}{16}\}\). The image \(I_\xi\) is represented as 256 tokens when \(\xi=\frac{1}{4}\) and 64 tokens when \(\xi=\frac{1}{16}\). Notably, the reference model always performs inference with \(\xi=\frac{1}{4}\).
237
 
238
 
239
  `Router training`:
@@ -257,7 +258,7 @@ y_i^\text{router} =
257
  \end{cases}
258
  $$
259
 
260
- where \(y_i^{\text{router}}=0\) and \(y_i^{\text{router}}=1\) indicate that the compression rate \(\xi\) is set to \(\tfrac{1}{16}\) and \(\tfrac{1}{4}\), respectively.
261
 
262
  > Please see [our paper](https://huggingface.co/papers/2508.18265) for more technical and experimental details.
263
 
@@ -278,7 +279,7 @@ This approach improves reasoning breadth.
278
 
279
  ### Decoupled Vision-Language Deployment
280
 
281
- In multimodal inference, the vision encoder and language model have distinct computational characteristics. The vision encoder that transforms images into semantic features is highly parallelizable and does not rely on long-term history state. In contrast, the language model adopts the inference in an autoregressive manner, which requires previous states to compute the next one. This sequential property makes the language part more sensitive to memory bandwidth and latency.
282
  When MLLMs are deployed online at scale, the vision and language models often block each other, thus incurring additional inference cost. This effect becomes more pronounced with larger vision models or higher-resolution images.
283
 
284
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/DvD.jpg)
@@ -529,40 +530,50 @@ generation_config = dict(max_new_tokens=1024, do_sample=True)
529
  # pure-text conversation (纯文本对话)
530
  question = 'Hello, who are you?'
531
  response, history = model.chat(tokenizer, None, question, generation_config, history=None, return_history=True)
532
- print(f'User: {question}\nAssistant: {response}')
 
533
 
534
  question = 'Can you tell me a story?'
535
  response, history = model.chat(tokenizer, None, question, generation_config, history=history, return_history=True)
536
- print(f'User: {question}\nAssistant: {response}')
 
537
 
538
  # single-image single-round conversation (单图单轮对话)
539
- question = '<image>\nPlease describe the image shortly.'
 
540
  response = model.chat(tokenizer, pixel_values, question, generation_config)
541
- print(f'User: {question}\nAssistant: {response}')
 
542
 
543
  # single-image multi-round conversation (单图多轮对话)
544
- question = '<image>\nPlease describe the image in detail.'
 
545
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
546
- print(f'User: {question}\nAssistant: {response}')
 
547
 
548
  question = 'Please write a poem according to the image.'
549
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
550
- print(f'User: {question}\nAssistant: {response}')
 
551
 
552
  # multi-image multi-round conversation, combined images (多图多轮对话,拼接图像)
553
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
554
  pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat16).cuda()
555
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
556
 
557
- question = '<image>\nDescribe the two images in detail.'
 
558
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
559
  history=None, return_history=True)
560
- print(f'User: {question}\nAssistant: {response}')
 
561
 
562
  question = 'What are the similarities and differences between these two images.'
563
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
564
  history=history, return_history=True)
565
- print(f'User: {question}\nAssistant: {response}')
 
566
 
567
  # multi-image multi-round conversation, separate images (多图多轮对话,独立图像)
568
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
@@ -570,17 +581,21 @@ pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat1
570
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
571
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
572
 
573
- question = 'Image-1: <image>\nImage-2: <image>\nDescribe the two images in detail.'
 
 
574
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
575
  num_patches_list=num_patches_list,
576
  history=None, return_history=True)
577
- print(f'User: {question}\nAssistant: {response}')
 
578
 
579
  question = 'What are the similarities and differences between these two images.'
580
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
581
  num_patches_list=num_patches_list,
582
  history=history, return_history=True)
583
- print(f'User: {question}\nAssistant: {response}')
 
584
 
585
  # batch inference, single image per sample (单图批处理)
586
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
@@ -588,13 +603,15 @@ pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat1
588
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
589
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
590
 
591
- questions = ['<image>\nDescribe the image in detail.'] * len(num_patches_list)
 
592
  responses = model.batch_chat(tokenizer, pixel_values,
593
  num_patches_list=num_patches_list,
594
  questions=questions,
595
  generation_config=generation_config)
596
  for question, response in zip(questions, responses):
597
- print(f'User: {question}\nAssistant: {response}')
 
598
 
599
  # video multi-round conversation (视频多轮对话)
600
  def get_index(bound, fps, max_frame, first_idx=0, num_segments=32):
@@ -632,17 +649,24 @@ def load_video(video_path, bound=None, input_size=448, max_num=1, num_segments=3
632
  video_path = './examples/red-panda.mp4'
633
  pixel_values, num_patches_list = load_video(video_path, num_segments=8, max_num=1)
634
  pixel_values = pixel_values.to(torch.bfloat16).cuda()
635
- video_prefix = ''.join([f'Frame{i+1}: <image>\n' for i in range(len(num_patches_list))])
 
636
  question = video_prefix + 'What is the red panda doing?'
637
- # Frame1: <image>\nFrame2: <image>\n...\nFrame8: <image>\n{question}
 
 
 
 
638
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
639
  num_patches_list=num_patches_list, history=None, return_history=True)
640
- print(f'User: {question}\nAssistant: {response}')
 
641
 
642
  question = 'Describe this video in detail.'
643
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
644
  num_patches_list=num_patches_list, history=history, return_history=True)
645
- print(f'User: {question}\nAssistant: {response}')
 
646
  ```
647
 
648
  #### Streaming Output
@@ -726,7 +750,9 @@ image_urls=[
726
 
727
  images = [load_image(img_url) for img_url in image_urls]
728
  # Numbering images improves multi-image conversations
729
- response = pipe((f'Image-1: {IMAGE_TOKEN}\nImage-2: {IMAGE_TOKEN}\ndescribe these two images', images))
 
 
730
  print(response.text)
731
  ```
732
 
@@ -828,4 +854,59 @@ If you find this project useful in your research, please consider citing:
828
  journal={arXiv preprint arXiv:2508.18265},
829
  year={2025}
830
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
831
  ```
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
 
 
2
  base_model:
3
+ - OpenGVLab/InternVL3_5-241B-A28B-MPO
 
4
  datasets:
5
+ - OpenGVLab/MMPR-v1.2
6
+ - OpenGVLab/MMPR-Tiny
7
  language:
8
+ - multilingual
9
+ library_name: transformers
10
+ license: apache-2.0
11
+ pipeline_tag: image-text-to-text
12
  tags:
13
+ - internvl
14
+ - custom_code
15
+ - multimodal
16
+ base_model_relation: finetune
17
  ---
18
 
19
  # InternVL3_5-241B-A28B
20
 
21
+ [\[📂 GitHub\]](https://github.com/OpenGVLab/InternVL) [\[🚀 Hugging Face Space\]](https://huggingface.co/spaces/OpenGVLab/InternVL) [\[📜 InternVL 1.0\]](https://huggingface.co/papers/2312.14238) [\[📜 InternVL 1.5\]](https://huggingface.co/papers/2404.16821) [\[📜 InternVL 2.5\]](https://huggingface.co/papers/2412.05271) [\[📜 InternVL2.5-MPO\]](https://huggingface.co/papers/2411.10442) [\[📜 InternVL3\]](https://huggingface.co/papers/2504.10479) [\[📜 InternVL3.5\]](https://huggingface.co/papers/2508.18265)
22
 
23
  [\[🆕 Blog\]](https://internvl.github.io/blog/) [\[🗨️ Chat Demo\]](https://chat.intern-ai.org.cn/) [\[🚀 Quick Start\]](#quick-start) [\[📖 Documents\]](https://internvl.readthedocs.io/en/latest/)
24
 
 
28
 
29
  ## Introduction
30
 
31
+ We introduce *InternVL3.5*, a new family of open-source multimodal models that significantly advances versatility, reasoning capability, and inference efficiency along the InternVL series. A key innovation is the *Cascade Reinforcement Learning (Cascade RL)* framework, which enhances reasoning through a two-stage process: offline RL for stable convergence and online RL for refined alignment. This coarse-to-fine training strategy leads to substantial improvements on downstream reasoning tasks, e.g., MMMU and MathVista. To optimize efficiency, we propose a *Visual Resolution Router (ViR)* that dynamically adjusts the resolution of visual tokens without compromising performance. Coupled with ViR, our Decoupled *Vision-Language Deployment (DvD)* strategy separates the vision encoder and language model across different GPUs, effectively balancing computational load. These contributions collectively enable InternVL3.5 to achieve up to a +16.0% gain in overall reasoning performance and a 4.05 \\(\times\\) inference speedup compared to its predecessor, i.e., InternVL3. In addition, InternVL3.5 supports novel capabilities such as GUI interaction and embodied agency. Notably, our largest model, i.e., InternVL3.5-241B-A28B, attains state-of-the-art results among open-source MLLMs across general multimodal, reasoning, text, and agentic tasks—narrowing the performance gap with leading commercial models like GPT-5. All models and code are publicly released.
32
 
33
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/performance.jpg)
34
 
 
138
 
139
 
140
  `InternVL3.5-Flash`:
141
+ Compared to InternVL3.5, InternVL3.5-Flash further integrates the *Visual Resolution Router (ViR)*, thus yielding a series of efficient variants friendly suitable for resource-constrained scenarios.
142
  Specifically, in InternVL3.5, each image patch is initially represented as 1024 visual tokens for the vision encoder, which are then compressed into 256 tokens via a pixel shuffle module before being passed to the Large Language Model (LLM).
143
  In InternVL3.5-Flash, as shown in the Figure below, an additional pixel shuffle module with a higher compression rate is included, enabling the compression of visual tokens down to 64 tokens.
144
  For each patch, the patch router determines the appropriate compression rate by assessing its semantic richness, and routes it to the corresponding pixel shuffle module accordingly.
145
+ Benefiting from this patch-aware compression mechanism, InternVL3.5-Flash is able to reduce the number of visual tokens by 50% while maintaining nearly 100% of the performance of InternVL3.5.
146
 
147
 
148
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/architecture.jpg)
 
157
  \mathcal{L}_{i}=-\log p_\theta\left(x_i \mid x_1, \ldots, x_{i-1}\right),
158
  $$
159
 
160
+ where \\(x_i\\) is the predicted token and prefix tokens in \\(\{x_1, x_2, \ldots, x_{i-1}\}\\) can be either text tokens or image tokens. Notably, for conversation samples, only response tokens are included for the calculation of the loss.
161
+ Additionally, to mitigate bias toward either longer or shorter responses during training, we adopt the square averaging to re-weight the NTP loss as follows:
162
 
163
  $$
164
  \mathcal{L}_{i}^{'} = \frac{w_i}{\sum_j w_j} \cdot \mathcal{L}_i, \quad w_i = \frac{1}{N^{0.5}},
 
168
 
169
  ### Supervised Fine-Tuning
170
 
171
+ During the SFT phase, we adopt the same objective as in the pre-training stage and use the square-root averaging strategy to calculate the final loss. In this stage, the context window is set to 32K tokens to adapt long-context information.
172
+ Compared to InternVL3, the SFT stage of InternVL3.5 contains more high-quality and diverse training data derived from three sources:
173
 
174
  (1) Instruction-following data from InternVL3, which are reused to preserve broad coverage of vision–language tasks.
175
 
 
181
 
182
  Cascade RL aims to combine the benefits of offline RL and online RL to progressively facilitate the post-training of MLLMs in an efficient manner.
183
  Specifically, we first fine-tune the model using an offline RL algorithm as an efficient warm-up stage to reach a satisfied results, which can guarantee the high-quality rollouts for the latter stage.
184
+ Subsequently, we employ an online RL algorithm to further refine the output distribution based on rollouts generated by the model itself. Compared to the single offline or online RL stage, our cascaded RL achieves significant performance improvements at a fraction of the GPU time cost.
185
 
186
 
187
 
 
234
  \Bigg],
235
  $$
236
 
237
+ where \\(\mathrm{KL}\\) denotes the KL divergence and \(\xi\) denotes the compression rate, which is uniformly sampled from \(\{\frac{1}{4},\frac{1}{16}\}\). The image \(I_\xi\) is represented as 256 tokens when \(\xi=\frac{1}{4}\) and 64 tokens when \(\xi=\frac{1}{16}\). Notably, the reference model always performs inference with \(\xi=\frac{1}{4}\).
238
 
239
 
240
  `Router training`:
 
258
  \end{cases}
259
  $$
260
 
261
+ where \(y_i^{\text{router}}=0\) and \(y_i^{\text{router}}=1\) indicate that the compression rate \(\xi\) is set to \(\tfrac{1}{16}\) and \(\tfrac{1}{4}\), respectively.
262
 
263
  > Please see [our paper](https://huggingface.co/papers/2508.18265) for more technical and experimental details.
264
 
 
279
 
280
  ### Decoupled Vision-Language Deployment
281
 
282
+ In multimodal inference, the vision encoder and language model have distinct computational characteristics. The vision encoder that transforms images into semantic features is highly parallelizable and does not rely on long-term history state. In contrast, the language model adopts the inference in an autoregressive manner, which requires previous states to compute the next one. This sequential property makes the language part more sensitive to memory bandwidth and latency.
283
  When MLLMs are deployed online at scale, the vision and language models often block each other, thus incurring additional inference cost. This effect becomes more pronounced with larger vision models or higher-resolution images.
284
 
285
  ![image/jpg](https://huggingface.co/OpenGVLab/InternVL3_5-241B-A28B/resolve/main/images/DvD.jpg)
 
530
  # pure-text conversation (纯文本对话)
531
  question = 'Hello, who are you?'
532
  response, history = model.chat(tokenizer, None, question, generation_config, history=None, return_history=True)
533
+ print(f'User: {question}
534
+ Assistant: {response}')
535
 
536
  question = 'Can you tell me a story?'
537
  response, history = model.chat(tokenizer, None, question, generation_config, history=history, return_history=True)
538
+ print(f'User: {question}
539
+ Assistant: {response}')
540
 
541
  # single-image single-round conversation (单图单轮对话)
542
+ question = '<image>
543
+ Please describe the image shortly.'
544
  response = model.chat(tokenizer, pixel_values, question, generation_config)
545
+ print(f'User: {question}
546
+ Assistant: {response}')
547
 
548
  # single-image multi-round conversation (单图多轮对话)
549
+ question = '<image>
550
+ Please describe the image in detail.'
551
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
552
+ print(f'User: {question}
553
+ Assistant: {response}')
554
 
555
  question = 'Please write a poem according to the image.'
556
  response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
557
+ print(f'User: {question}
558
+ Assistant: {response}')
559
 
560
  # multi-image multi-round conversation, combined images (多图多轮对话,拼接图像)
561
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
562
  pixel_values2 = load_image('./examples/image2.jpg', max_num=12).to(torch.bfloat16).cuda()
563
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
564
 
565
+ question = '<image>
566
+ Describe the two images in detail.'
567
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
568
  history=None, return_history=True)
569
+ print(f'User: {question}
570
+ Assistant: {response}')
571
 
572
  question = 'What are the similarities and differences between these two images.'
573
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
574
  history=history, return_history=True)
575
+ print(f'User: {question}
576
+ Assistant: {response}')
577
 
578
  # multi-image multi-round conversation, separate images (多图多轮对话,独立图像)
579
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
 
581
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
582
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
583
 
584
+ question = 'Image-1: <image>
585
+ Image-2: <image>
586
+ Describe the two images in detail.'
587
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
588
  num_patches_list=num_patches_list,
589
  history=None, return_history=True)
590
+ print(f'User: {question}
591
+ Assistant: {response}')
592
 
593
  question = 'What are the similarities and differences between these two images.'
594
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
595
  num_patches_list=num_patches_list,
596
  history=history, return_history=True)
597
+ print(f'User: {question}
598
+ Assistant: {response}')
599
 
600
  # batch inference, single image per sample (单图批处理)
601
  pixel_values1 = load_image('./examples/image1.jpg', max_num=12).to(torch.bfloat16).cuda()
 
603
  num_patches_list = [pixel_values1.size(0), pixel_values2.size(0)]
604
  pixel_values = torch.cat((pixel_values1, pixel_values2), dim=0)
605
 
606
+ questions = ['<image>
607
+ Describe the image in detail.'] * len(num_patches_list)
608
  responses = model.batch_chat(tokenizer, pixel_values,
609
  num_patches_list=num_patches_list,
610
  questions=questions,
611
  generation_config=generation_config)
612
  for question, response in zip(questions, responses):
613
+ print(f'User: {question}
614
+ Assistant: {response}')
615
 
616
  # video multi-round conversation (视频多轮对话)
617
  def get_index(bound, fps, max_frame, first_idx=0, num_segments=32):
 
649
  video_path = './examples/red-panda.mp4'
650
  pixel_values, num_patches_list = load_video(video_path, num_segments=8, max_num=1)
651
  pixel_values = pixel_values.to(torch.bfloat16).cuda()
652
+ video_prefix = ''.join([f'Frame{i+1}: <image>
653
+ ' for i in range(len(num_patches_list))])
654
  question = video_prefix + 'What is the red panda doing?'
655
+ # Frame1: <image>
656
+ Frame2: <image>
657
+ ...
658
+ Frame8: <image>
659
+ {question}
660
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
661
  num_patches_list=num_patches_list, history=None, return_history=True)
662
+ print(f'User: {question}
663
+ Assistant: {response}')
664
 
665
  question = 'Describe this video in detail.'
666
  response, history = model.chat(tokenizer, pixel_values, question, generation_config,
667
  num_patches_list=num_patches_list, history=history, return_history=True)
668
+ print(f'User: {question}
669
+ Assistant: {response}')
670
  ```
671
 
672
  #### Streaming Output
 
750
 
751
  images = [load_image(img_url) for img_url in image_urls]
752
  # Numbering images improves multi-image conversations
753
+ response = pipe((f'Image-1: {IMAGE_TOKEN}
754
+ Image-2: {IMAGE_TOKEN}
755
+ describe these two images', images))
756
  print(response.text)
757
  ```
758
 
 
854
  journal={arXiv preprint arXiv:2508.18265},
855
  year={2025}
856
  }
857
+ @article{zhu2025internvl3,
858
+ title={Internvl3: Exploring advanced training and test-time recipes for open-source multimodal models},
859
+ author={Zhu, Jinguo and Wang, Weiyun and Chen, Zhe and Liu, Zhaoyang and Ye, Shenglong and Gu, Lixin and Tian, Hao and Duan, Yuchen and Su, Weijie and Shao, Jie and others},
860
+ journal={arXiv preprint arXiv:2504.10479},
861
+ year={2025}
862
+ }
863
+ @article{chen2024expanding,
864
+ title={Expanding Performance Boundaries of Open-Source Multimodal Models with Model, Data, and Test-Time Scaling},
865
+ author={Chen, Zhe and Wang, Weiyun and Cao, Yue and Liu, Yangzhou and Gao, Zhangwei and Cui, Erfei and Zhu, Jinguo and Ye, Shenglong and Tian, Hao and Liu, Zhaoyang and others},
866
+ journal={arXiv preprint arXiv:2412.05271},
867
+ year={2024}
868
+ }
869
+ @article{wang2024mpo,
870
+ title={Enhancing the Reasoning Ability of Multimodal Large Language Models via Mixed Preference Optimization},
871
+ author={Wang, Weiyun and Chen, Zhe and Wang, Wenhai and Cao, Yue and Liu, Yangzhou and Gao, Zhangwei and Zhu, Jinguo and Zhu, Xizhou and Lu, Lewei and Qiao, Yu and Dai, Jifeng},
872
+ journal={arXiv preprint arXiv:2411.10442},
873
+ year={2024}
874
+ }
875
+ @article{gao2024mini,
876
+ title={Mini-InternVL: a flexible-transfer pocket multi-modal model with 5% parameters and 90% performance},
877
+ author={Gao, Zhangwei and Chen, Zhe and Cui, Erfei and Ren, Yiming and Wang, Weiyun and Zhu, Jinguo and Tian, Hao and Ye, Shenglong and He, Junjun and Zhu, Xizhou and others},
878
+ journal={Visual Intelligence},
879
+ volume={2},
880
+ number={1},
881
+ pages={1--17},
882
+ year={2024},
883
+ publisher={Springer}
884
+ }
885
+ @article{chen2024far,
886
+ title={How far are we to gpt-4v? closing the gap to commercial multimodal models with open-source suites},
887
+ author={Chen, Zhe and Wang, Weiyun and Tian, Hao and Ye, Shenglong and Gao, Zhangwei and Cui, Erfei and Tong, Wenwen and Hu, Kongzhi and Luo, Jiapeng and Ma, Zheng and others},
888
+ journal={Science China Information Sciences},
889
+ volume={67},
890
+ number={12},
891
+ pages={220101},
892
+ year={2024},
893
+ publisher={Springer}
894
+ }
895
+ @inproceedings{chen2024internvl,
896
+ title={Internvl: Scaling up vision foundation models and aligning for generic visual-linguistic tasks},
897
+ author={Chen, Zhe and Wu, Jiannan and Wang, Wenhai and Su, Weijie and Chen, Guo and Xing, Sen and Zhong, Muyan and Zhang, Qinglong and Zhu, Xinguo and Lu, Lewei and others},
898
+ booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
899
+ pages={24185--24198},
900
+ year={2024}
901
+ }
902
  ```
903
+
904
+ ## Acknowledgement
905
+
906
+ InternVL is built with reference to the code of the following projects: [OpenAI CLIP](https://github.com/openai/CLIP), [Open CLIP](https://github.com/mlfoundations/open_clip), [CLIP Benchmark](https://github.com/LAION-AI/CLIP_benchmark), [EVA](https://github.com/baaivision/EVA/tree/master), [InternImage](https://github.com/OpenGVLab/InternImage), [ViT-Adapter](https://github.com/czczup/ViT-Adapter), [MMSegmentation](https://github.com/open-mmlab/mmsegmentation), [Transformers](https://github.com/huggingface/transformers), [DINOv2](https://github.com/facebookresearch/dinov2), [BLIP-2](https://github.com/salesforce/LAVIS/tree/main/projects/blip2), [Qwen-VL](https://github.com/QwenLM/Qwen-VL/tree/master/eval_mm), and [LLaVA-1.5](https://github.com/haotian-liu/LLaVA). Thanks for their awesome work!
907
+
908
+ ______________________________________________________________________
909
+
910
+ Scan the following QR Code, join our WeChat group.
911
+
912
+ <p align="center"><img width="300" alt="image" src="https://github.com/user-attachments/assets/f776df09-ebba-4fd5-80c2-fec4ff1518be"></p>