CalamitousFelicitousness commited on
Commit
8749c5d
·
verified ·
1 Parent(s): 532f403

Upload folder using huggingface_hub

Browse files
Files changed (50) hide show
  1. .ipynb_checkpoints/config-checkpoint.json +52 -0
  2. LICENSE +51 -0
  3. README.md +593 -0
  4. chat_template.json +3 -0
  5. config.json +52 -0
  6. generation_config.json +14 -0
  7. merges.txt +0 -0
  8. model-00001-of-00038.safetensors +3 -0
  9. model-00002-of-00038.safetensors +3 -0
  10. model-00003-of-00038.safetensors +3 -0
  11. model-00004-of-00038.safetensors +3 -0
  12. model-00005-of-00038.safetensors +3 -0
  13. model-00006-of-00038.safetensors +3 -0
  14. model-00007-of-00038.safetensors +3 -0
  15. model-00008-of-00038.safetensors +3 -0
  16. model-00009-of-00038.safetensors +3 -0
  17. model-00010-of-00038.safetensors +3 -0
  18. model-00011-of-00038.safetensors +3 -0
  19. model-00012-of-00038.safetensors +3 -0
  20. model-00013-of-00038.safetensors +3 -0
  21. model-00014-of-00038.safetensors +3 -0
  22. model-00015-of-00038.safetensors +3 -0
  23. model-00016-of-00038.safetensors +3 -0
  24. model-00017-of-00038.safetensors +3 -0
  25. model-00018-of-00038.safetensors +3 -0
  26. model-00019-of-00038.safetensors +3 -0
  27. model-00020-of-00038.safetensors +3 -0
  28. model-00021-of-00038.safetensors +3 -0
  29. model-00022-of-00038.safetensors +3 -0
  30. model-00023-of-00038.safetensors +3 -0
  31. model-00024-of-00038.safetensors +3 -0
  32. model-00025-of-00038.safetensors +3 -0
  33. model-00026-of-00038.safetensors +3 -0
  34. model-00027-of-00038.safetensors +3 -0
  35. model-00028-of-00038.safetensors +3 -0
  36. model-00029-of-00038.safetensors +3 -0
  37. model-00030-of-00038.safetensors +3 -0
  38. model-00031-of-00038.safetensors +3 -0
  39. model-00032-of-00038.safetensors +3 -0
  40. model-00033-of-00038.safetensors +3 -0
  41. model-00034-of-00038.safetensors +3 -0
  42. model-00035-of-00038.safetensors +3 -0
  43. model-00036-of-00038.safetensors +3 -0
  44. model-00037-of-00038.safetensors +3 -0
  45. model-00038-of-00038.safetensors +3 -0
  46. model.safetensors.index.json +0 -0
  47. preprocessor_config.json +19 -0
  48. tokenizer.json +0 -0
  49. tokenizer_config.json +129 -0
  50. vocab.json +0 -0
.ipynb_checkpoints/config-checkpoint.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2VLForConditionalGeneration"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151645,
8
+ "vision_start_token_id": 151652,
9
+ "vision_end_token_id": 151653,
10
+ "vision_token_id": 151654,
11
+ "image_token_id": 151655,
12
+ "video_token_id": 151656,
13
+ "hidden_act": "silu",
14
+ "hidden_size": 8192,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 29568,
17
+ "max_position_embeddings": 32768,
18
+ "max_window_layers": 80,
19
+ "model_type": "qwen2_vl",
20
+ "num_attention_heads": 64,
21
+ "num_hidden_layers": 80,
22
+ "num_key_value_heads": 8,
23
+ "rms_norm_eps": 1e-06,
24
+ "rope_theta": 1000000.0,
25
+ "sliding_window": 32768,
26
+ "tie_word_embeddings": false,
27
+ "torch_dtype": "bfloat16",
28
+ "transformers_version": "4.41.2",
29
+ "use_cache": true,
30
+ "use_sliding_window": false,
31
+ "vision_config": {
32
+ "depth": 32,
33
+ "embed_dim": 1280,
34
+ "mlp_ratio": 4,
35
+ "num_heads": 16,
36
+ "in_chans": 3,
37
+ "hidden_size": 8192,
38
+ "patch_size": 14,
39
+ "spatial_merge_size": 2,
40
+ "spatial_patch_size": 14,
41
+ "temporal_patch_size": 2
42
+ },
43
+ "rope_scaling": {
44
+ "type": "mrope",
45
+ "mrope_section": [
46
+ 16,
47
+ 24,
48
+ 24
49
+ ]
50
+ },
51
+ "vocab_size": 152064
52
+ }
LICENSE ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Qwen LICENSE AGREEMENT
2
+
3
+ Qwen LICENSE AGREEMENT Release Date: September 19, 2024
4
+
5
+ By clicking to agree or by using or distributing any portion or element of the Qwen Materials, you will be deemed to have recognized and accepted the content of this Agreement, which is effective immediately.
6
+
7
+ 1. Definitions
8
+ a. This Qwen LICENSE AGREEMENT (this "Agreement") shall mean the terms and conditions for use, reproduction, distribution and modification of the Materials as defined by this Agreement.
9
+ b. "We" (or "Us") shall mean Alibaba Cloud.
10
+ c. "You" (or "Your") shall mean a natural person or legal entity exercising the rights granted by this Agreement and/or using the Materials for any purpose and in any field of use.
11
+ d. "Third Parties" shall mean individuals or legal entities that are not under common control with us or you.
12
+ e. "Qwen" shall mean the large language models, and software and algorithms, consisting of trained model weights, parameters (including optimizer states), machine-learning model code, inference-enabling code, training-enabling code, fine-tuning enabling code and other elements of the foregoing distributed by us.
13
+ f. "Materials" shall mean, collectively, Alibaba Cloud's proprietary Qwen and Documentation (and any portion thereof) made available under this Agreement.
14
+ g. "Source" form shall mean the preferred form for making modifications, including but not limited to model source code, documentation source, and configuration files.
15
+ h. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
16
+
17
+ 2. Grant of Rights
18
+ You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Alibaba Cloud's intellectual property or other rights owned by us embodied in the Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Materials.
19
+
20
+ 3. Redistribution
21
+ You may distribute copies or make the Materials, or derivative works thereof, available as part of a product or service that contains any of them, with or without modifications, and in Source or Object form, provided that you meet the following conditions:
22
+ a. You shall give any other recipients of the Materials or derivative works a copy of this Agreement;
23
+ b. You shall cause any modified files to carry prominent notices stating that you changed the files;
24
+ c. You shall retain in all copies of the Materials that you distribute the following attribution notices within a "Notice" text file distributed as a part of such copies: "Qwen is licensed under the Qwen LICENSE AGREEMENT, Copyright (c) Alibaba Cloud. All Rights Reserved."; and
25
+ d. You may add your own copyright statement to your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of your modifications, or for any such derivative works as a whole, provided your use, reproduction, and distribution of the work otherwise complies with the terms and conditions of this Agreement.
26
+
27
+ 4. Restrictions
28
+ If you are commercially using the Materials, and your product or service has more than 100 million monthly active users, you shall request a license from us. You cannot exercise your rights under this Agreement without our express authorization.
29
+
30
+ 5. Rules of use
31
+ a. The Materials may be subject to export controls or restrictions in China, the United States or other countries or regions. You shall comply with applicable laws and regulations in your use of the Materials.
32
+ b. If you use the Materials or any outputs or results therefrom to create, train, fine-tune, or improve an AI model that is distributed or made available, you shall prominently display “Built with Qwen” or “Improved using Qwen” in the related product documentation.
33
+
34
+ 6. Intellectual Property
35
+ a. We retain ownership of all intellectual property rights in and to the Materials and derivatives made by or for us. Conditioned upon compliance with the terms and conditions of this Agreement, with respect to any derivative works and modifications of the Materials that are made by you, you are and will be the owner of such derivative works and modifications.
36
+ b. No trademark license is granted to use the trade names, trademarks, service marks, or product names of us, except as required to fulfill notice requirements under this Agreement or as required for reasonable and customary use in describing and redistributing the Materials.
37
+ c. If you commence a lawsuit or other proceedings (including a cross-claim or counterclaim in a lawsuit) against us or any entity alleging that the Materials or any output therefrom, or any part of the foregoing, infringe any intellectual property or other right owned or licensable by you, then all licenses granted to you under this Agreement shall terminate as of the date such lawsuit or other proceeding is commenced or brought.
38
+
39
+ 7. Disclaimer of Warranty and Limitation of Liability
40
+ a. We are not obligated to support, update, provide training for, or develop any further version of the Qwen Materials or to grant any license thereto.
41
+ b. THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. WE MAKE NO WARRANTY AND ASSUME NO RESPONSIBILITY FOR THE SAFETY OR STABILITY OF THE MATERIALS AND ANY OUTPUT THEREFROM.
42
+ c. IN NO EVENT SHALL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE MATERIALS OR ANY OUTPUT OF IT, NO MATTER HOW IT’S CAUSED.
43
+ d. You will defend, indemnify and hold harmless us from and against any claim by any third party arising out of or related to your use or distribution of the Materials.
44
+
45
+ 8. Survival and Termination.
46
+ a. The term of this Agreement shall commence upon your acceptance of this Agreement or access to the Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein.
47
+ b. We may terminate this Agreement if you breach any of the terms or conditions of this Agreement. Upon termination of this Agreement, you must delete and cease use of the Materials. Sections 7 and 9 shall survive the termination of this Agreement.
48
+
49
+ 9. Governing Law and Jurisdiction.
50
+ a. This Agreement and any dispute arising out of or relating to it will be governed by the laws of China, without regard to conflict of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
51
+ b. The People's Courts in Hangzhou City shall have exclusive jurisdiction over any dispute arising out of this Agreement.
README.md ADDED
@@ -0,0 +1,593 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: tongyi-qianwen
4
+ license_link: https://huggingface.co/Qwen/Qwen2-VL-72B-Instruct/blob/main/LICENSE
5
+ language:
6
+ - en
7
+ pipeline_tag: image-text-to-text
8
+ tags:
9
+ - multimodal
10
+ library_name: transformers
11
+ ---
12
+
13
+ # Qwen2-VL-72B-Instruct
14
+
15
+ ## Introduction
16
+
17
+ We're excited to unveil **Qwen2-VL**, the latest iteration of our Qwen-VL model, representing nearly a year of innovation.
18
+
19
+ ### What’s New in Qwen2-VL?
20
+
21
+ #### Key Enhancements:
22
+
23
+
24
+ * **SoTA understanding of images of various resolution & ratio**: Qwen2-VL achieves state-of-the-art performance on visual understanding benchmarks, including MathVista, DocVQA, RealWorldQA, MTVQA, etc.
25
+
26
+ * **Understanding videos of 20min+**: Qwen2-VL can understand videos over 20 minutes for high-quality video-based question answering, dialog, content creation, etc.
27
+
28
+ * **Agent that can operate your mobiles, robots, etc.**: with the abilities of complex reasoning and decision making, Qwen2-VL can be integrated with devices like mobile phones, robots, etc., for automatic operation based on visual environment and text instructions.
29
+
30
+ * **Multilingual Support**: to serve global users, besides English and Chinese, Qwen2-VL now supports the understanding of texts in different languages inside images, including most European languages, Japanese, Korean, Arabic, Vietnamese, etc.
31
+
32
+
33
+ #### Model Architecture Updates:
34
+
35
+ * **Naive Dynamic Resolution**: Unlike before, Qwen2-VL can handle arbitrary image resolutions, mapping them into a dynamic number of visual tokens, offering a more human-like visual processing experience.
36
+
37
+ <p align="center">
38
+ <img src="https://qianwen-res.oss-accelerate-overseas.aliyuncs.com/Qwen2-VL/qwen2_vl.jpg" width="80%"/>
39
+ <p>
40
+
41
+ * **Multimodal Rotary Position Embedding (M-ROPE)**: Decomposes positional embedding into parts to capture 1D textual, 2D visual, and 3D video positional information, enhancing its multimodal processing capabilities.
42
+
43
+ <p align="center">
44
+ <img src="http://qianwen-res.oss-accelerate-overseas.aliyuncs.com/Qwen2-VL/mrope.png" width="80%"/>
45
+ <p>
46
+
47
+ We have three models with 2, 8 and 72 billion parameters. This repo contains the instruction-tuned 72B Qwen2-VL model. For more information, visit our [Blog](https://qwenlm.github.io/blog/qwen2-vl/) and [GitHub](https://github.com/QwenLM/Qwen2-VL).
48
+
49
+
50
+
51
+ ## Evaluation
52
+
53
+ ### Image Benchmarks
54
+
55
+ | Benchmark | Previous SoTA<br><sup>(Open-source LVLM)<sup> | Claude-3.5 Sonnet | GPT-4o | **Qwen2-VL-72B**
56
+ | :--- | :---: | :---: | :---: | :---: |
57
+ | MMMU<sub>val</sub> | 58.3 | 68.3 | **69.1** | 64.5
58
+ | DocVQA<sub>test</sub> | 94.1 | 95.2 | 92.8 | **96.5**
59
+ | InfoVQA<sub>test</sub> | 82.0 | - | - | **84.5**
60
+ | ChartQA<sub>test</sub> | 88.4 | **90.8** | 85.7 | 88.3
61
+ | TextVQA<sub>val</sub> | 84.4 | - | - | **85.5**
62
+ | OCRBench | 852 | 788 | 736 | **877**
63
+ | MTVQA | 17.3 | 25.7 | 27.8 | **30.9**
64
+ | VCR<sub>en easy</sub> | 84.67 | 63.85 | 91.55 | **91.93**
65
+ | VCR<sub>zh easy</sub> | 22.09 | 1.0| 14.87 | **65.37**
66
+ | RealWorldQA | 72.2 | 60.1 | 75.4 | **77.8**
67
+ | MME<sub>sum</sub> | 2414.7 | 1920.0 | 2328.7 | **2482.7**
68
+ | MMBench-EN<sub>test</sub> | **86.5** | 79.7 | 83.4 | **86.5**
69
+ | MMBench-CN<sub>test</sub> | 86.3 | 80.7 | 82.1 | **86.6**
70
+ | MMBench-V1.1<sub>test</sub> | 85.5 | 78.5 | 82.2 | **85.9**
71
+ | MMT-Bench<sub>test</sub> | 63.4 | - | 65.5 | **71.7**
72
+ | MMStar | 67.1 | 62.2 | 63.9 | **68.3**
73
+ | MMVet<sub>GPT-4-Turbo</sub> | 65.7 | 66.0 | 69.1 | **74.0**
74
+ | HallBench<sub>avg</sub> | 55.2 | 49.9 | 55.0 | **58.1**
75
+ | MathVista<sub>testmini</sub> | 67.5 | 67.7 | 63.8 | **70.5**
76
+ | MathVision | 16.97 | - | **30.4** | 25.9
77
+
78
+ ### Video Benchmarks
79
+
80
+ | Benchmark | Previous SoTA<br><sup>(Open-source LVLM)<sup> | Gemini 1.5-Pro | GPT-4o | **Qwen2-VL-72B**
81
+ | :--- | :---: | :---: | :---: | :---: |
82
+ | MVBench | 69.6 | - | - | **73.6**
83
+ | PerceptionTest<sub>test</sub> | 66.9 | - | - | **68.0**
84
+ | EgoSchema<sub>test</sub> | 62.0 | 63.2 | 72.2 | **77.9**
85
+ | Video-MME<br><sub>(wo/w subs)</sub> | 66.3/69.6 | **75.0**/**81.3** | 71.9/77.2 | 71.2/77.8
86
+
87
+ ### Agent Benchmarks
88
+ | |Benchmark | Metric | Previous SoTA | GPT-4o | **Qwen2-VL-72B** |
89
+ | :-- | :-- | :--: | :--: | :--: | :--: |
90
+ | General | FnCall<sup>[1]</sup> | TM | - | 90.2 | **93.1** |
91
+ | | | EM | - | 50.0 | **53.2** |
92
+ | Game | Number Line | SR | 89.4<sup>[2]</sup> | 91.5 | **100.0** |
93
+ | | BlackJack | SR | 40.2<sup>[2]</sup> | 34.5 | **42.6** |
94
+ | | EZPoint | SR | 50.0<sup>[2]</sup> | 85.5 | **100.0** |
95
+ | | Point24 | SR | 2.6<sup>[2]</sup> | 3.0 | **4.5** |
96
+ | Android | AITZ | TM | 83.0<sup>[3]</sup> | 70.0 | **89.6** |
97
+ | | | EM | 47.7<sup>[3]</sup> | 35.3 | **72.1** |
98
+ | AI2THOR | ALFRED<sub>valid-unseen</sub> | SR | 67.7<sup>[4]</sup> | - | **67.8** |
99
+ | | | GC | 75.3<sup>[4]</sup> | - | **75.8** |
100
+ | VLN | R2R<sub>valid-unseen</sub> | SR | **79.0** | 43.7<sup>[5]</sup> | 51.7 |
101
+ | | REVERIE<sub>valid-unseen</sub> | SR | **61.0** | 31.6<sup>[5]</sup> | 31.0 |
102
+
103
+ SR, GC, TM and EM are short for success rate, goal-condition success, type match and exact match. ALFRED is supported by SAM<sup>[6]</sup>.
104
+ 1. Self-Curated Function Call Benchmark by Qwen Team
105
+ 2. Fine-Tuning Large Vision-Language Models as Decision-Making Agents via Reinforcement Learning
106
+ 3. Android in the Zoo: Chain-of-Action-Thought for GUI Agents
107
+ 4. ThinkBot: Embodied Instruction Following with Thought Chain Reasoning
108
+ 5. MapGPT: Map-Guided Prompting with Adaptive Path Planning for Vision-and-Language Navigation
109
+ 6. Segment Anything.
110
+
111
+
112
+ ### Multilingual Benchmarks
113
+
114
+ <table style="width:75%; text-align:center;">
115
+ <tr>
116
+ <th>Models</th>
117
+ <td>AR </td>
118
+ <td>DE </td>
119
+ <td>FR </td>
120
+ <td>IT </td>
121
+ <td>JA </td>
122
+ <td>KO </td>
123
+ <td>RU </td>
124
+ <td>TH </td>
125
+ <td>VI </td>
126
+ <td>AVG</td>
127
+ </tr>
128
+ <tr>
129
+ <th align="left">Qwen2-VL-72B</th>
130
+ <td>20.7 </td>
131
+ <td>36.5 </td>
132
+ <td>44.1 </td>
133
+ <td>42.8 </td>
134
+ <td>21.6 </td>
135
+ <td>37.4 </td>
136
+ <td>15.6 </td>
137
+ <td>17.7 </td>
138
+ <td>41.6 </td>
139
+ <td><b>30.9</b></td>
140
+ </tr>
141
+ <tr>
142
+ <th align="left">GPT-4o</th>
143
+ <td>20.2 </td>
144
+ <td>34.2 </td>
145
+ <td>41.2 </td>
146
+ <td>32.7 </td>
147
+ <td>20.0 </td>
148
+ <td>33.9 </td>
149
+ <td>11.5 </td>
150
+ <td>22.5 </td>
151
+ <td>34.2 </td>
152
+ <td>27.8</td>
153
+ </tr>
154
+ <tr>
155
+ <th align="left">Claude3 Opus</th>
156
+ <td>15.1 </td>
157
+ <td>33.4 </td>
158
+ <td>40.6 </td>
159
+ <td>34.4 </td>
160
+ <td>19.4 </td>
161
+ <td>27.2 </td>
162
+ <td>13.0 </td>
163
+ <td>19.5 </td>
164
+ <td>29.1 </td>
165
+ <td>25.7 </td>
166
+ </tr>
167
+ <tr>
168
+ <th align="left">Gemini Ultra</th>
169
+ <td>14.7 </td>
170
+ <td>32.3 </td>
171
+ <td>40.0 </td>
172
+ <td>31.8 </td>
173
+ <td>12.3 </td>
174
+ <td>17.2 </td>
175
+ <td>11.8 </td>
176
+ <td>20.3 </td>
177
+ <td>28.6 </td>
178
+ <td>23.2</td>
179
+ </tr>
180
+ </table>
181
+
182
+
183
+
184
+
185
+ ## Requirements
186
+ The code of Qwen2-VL has been in the latest Hugging face transformers and we advise you to build from source with command `pip install git+https://github.com/huggingface/transformers`, or you might encounter the following error:
187
+ ```
188
+ KeyError: 'qwen2_vl'
189
+ ```
190
+
191
+ ## Quickstart
192
+ We offer a toolkit to help you handle various types of visual input more conveniently. This includes base64, URLs, and interleaved images and videos. You can install it using the following command:
193
+
194
+ ```bash
195
+ pip install qwen-vl-utils
196
+ ```
197
+
198
+ Here we show a code snippet to show you how to use the chat model with `transformers` and `qwen_vl_utils`:
199
+
200
+ ```python
201
+ from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
202
+ from qwen_vl_utils import process_vision_info
203
+
204
+ # default: Load the model on the available device(s)
205
+ model = Qwen2VLForConditionalGeneration.from_pretrained(
206
+ "Qwen/Qwen2-VL-72B-Instruct", torch_dtype="auto", device_map="auto"
207
+ )
208
+
209
+ # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
210
+ # model = Qwen2VLForConditionalGeneration.from_pretrained(
211
+ # "Qwen/Qwen2-VL-72B-Instruct",
212
+ # torch_dtype=torch.bfloat16,
213
+ # attn_implementation="flash_attention_2",
214
+ # device_map="auto",
215
+ # )
216
+
217
+ # default processer
218
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-72B-Instruct")
219
+
220
+ # The default range for the number of visual tokens per image in the model is 4-16384. You can set min_pixels and max_pixels according to your needs, such as a token count range of 256-1280, to balance speed and memory usage.
221
+ # min_pixels = 256*28*28
222
+ # max_pixels = 1280*28*28
223
+ # processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-72B-Instruct", min_pixels=min_pixels, max_pixels=max_pixels)
224
+
225
+ messages = [
226
+ {
227
+ "role": "user",
228
+ "content": [
229
+ {
230
+ "type": "image",
231
+ "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
232
+ },
233
+ {"type": "text", "text": "Describe this image."},
234
+ ],
235
+ }
236
+ ]
237
+
238
+ # Preparation for inference
239
+ text = processor.apply_chat_template(
240
+ messages, tokenize=False, add_generation_prompt=True
241
+ )
242
+ image_inputs, video_inputs = process_vision_info(messages)
243
+ inputs = processor(
244
+ text=[text],
245
+ images=image_inputs,
246
+ videos=video_inputs,
247
+ padding=True,
248
+ return_tensors="pt",
249
+ )
250
+ inputs = inputs.to("cuda")
251
+
252
+ # Inference: Generation of the output
253
+ generated_ids = model.generate(**inputs, max_new_tokens=128)
254
+ generated_ids_trimmed = [
255
+ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
256
+ ]
257
+ output_text = processor.batch_decode(
258
+ generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
259
+ )
260
+ print(output_text)
261
+ ```
262
+ <details>
263
+ <summary>Without qwen_vl_utils</summary>
264
+
265
+ ```python
266
+ from PIL import Image
267
+ import requests
268
+ import torch
269
+ from torchvision import io
270
+ from typing import Dict
271
+ from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
272
+
273
+ # Load the model in half-precision on the available device(s)
274
+ model = Qwen2VLForConditionalGeneration.from_pretrained(
275
+ "Qwen/Qwen2-VL-72B-Instruct", torch_dtype="auto", device_map="auto"
276
+ )
277
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen2-VL-72B-Instruct")
278
+
279
+ # Image
280
+ url = "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg"
281
+ image = Image.open(requests.get(url, stream=True).raw)
282
+
283
+ conversation = [
284
+ {
285
+ "role": "user",
286
+ "content": [
287
+ {
288
+ "type": "image",
289
+ },
290
+ {"type": "text", "text": "Describe this image."},
291
+ ],
292
+ }
293
+ ]
294
+
295
+
296
+ # Preprocess the inputs
297
+ text_prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
298
+ # Excepted output: '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n<|im_start|>user\n<|vision_start|><|image_pad|><|vision_end|>Describe this image.<|im_end|>\n<|im_start|>assistant\n'
299
+
300
+ inputs = processor(
301
+ text=[text_prompt], images=[image], padding=True, return_tensors="pt"
302
+ )
303
+ inputs = inputs.to("cuda")
304
+
305
+ # Inference: Generation of the output
306
+ output_ids = model.generate(**inputs, max_new_tokens=128)
307
+ generated_ids = [
308
+ output_ids[len(input_ids) :]
309
+ for input_ids, output_ids in zip(inputs.input_ids, output_ids)
310
+ ]
311
+ output_text = processor.batch_decode(
312
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True
313
+ )
314
+ print(output_text)
315
+ ```
316
+ </details>
317
+ <details>
318
+ <summary>Multi image inference</summary>
319
+
320
+ ```python
321
+ # Messages containing multiple images and a text query
322
+ messages = [
323
+ {
324
+ "role": "user",
325
+ "content": [
326
+ {"type": "image", "image": "file:///path/to/image1.jpg"},
327
+ {"type": "image", "image": "file:///path/to/image2.jpg"},
328
+ {"type": "text", "text": "Identify the similarities between these images."},
329
+ ],
330
+ }
331
+ ]
332
+
333
+ # Preparation for inference
334
+ text = processor.apply_chat_template(
335
+ messages, tokenize=False, add_generation_prompt=True
336
+ )
337
+ image_inputs, video_inputs = process_vision_info(messages)
338
+ inputs = processor(
339
+ text=[text],
340
+ images=image_inputs,
341
+ videos=video_inputs,
342
+ padding=True,
343
+ return_tensors="pt",
344
+ )
345
+ inputs = inputs.to("cuda")
346
+
347
+ # Inference
348
+ generated_ids = model.generate(**inputs, max_new_tokens=128)
349
+ generated_ids_trimmed = [
350
+ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
351
+ ]
352
+ output_text = processor.batch_decode(
353
+ generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
354
+ )
355
+ print(output_text)
356
+ ```
357
+ </details>
358
+
359
+ <details>
360
+ <summary>Video inference</summary>
361
+
362
+ ```python
363
+ # Messages containing a images list as a video and a text query
364
+ messages = [
365
+ {
366
+ "role": "user",
367
+ "content": [
368
+ {
369
+ "type": "video",
370
+ "video": [
371
+ "file:///path/to/frame1.jpg",
372
+ "file:///path/to/frame2.jpg",
373
+ "file:///path/to/frame3.jpg",
374
+ "file:///path/to/frame4.jpg",
375
+ ],
376
+ "fps": 1.0,
377
+ },
378
+ {"type": "text", "text": "Describe this video."},
379
+ ],
380
+ }
381
+ ]
382
+ # Messages containing a video and a text query
383
+ messages = [
384
+ {
385
+ "role": "user",
386
+ "content": [
387
+ {
388
+ "type": "video",
389
+ "video": "file:///path/to/video1.mp4",
390
+ "max_pixels": 360 * 420,
391
+ "fps": 1.0,
392
+ },
393
+ {"type": "text", "text": "Describe this video."},
394
+ ],
395
+ }
396
+ ]
397
+
398
+ # Preparation for inference
399
+ text = processor.apply_chat_template(
400
+ messages, tokenize=False, add_generation_prompt=True
401
+ )
402
+ image_inputs, video_inputs = process_vision_info(messages)
403
+ inputs = processor(
404
+ text=[text],
405
+ images=image_inputs,
406
+ videos=video_inputs,
407
+ padding=True,
408
+ return_tensors="pt",
409
+ )
410
+ inputs = inputs.to("cuda")
411
+
412
+ # Inference
413
+ generated_ids = model.generate(**inputs, max_new_tokens=128)
414
+ generated_ids_trimmed = [
415
+ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
416
+ ]
417
+ output_text = processor.batch_decode(
418
+ generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
419
+ )
420
+ print(output_text)
421
+ ```
422
+ </details>
423
+
424
+ <details>
425
+ <summary>Batch inference</summary>
426
+
427
+ ```python
428
+ # Sample messages for batch inference
429
+ messages1 = [
430
+ {
431
+ "role": "user",
432
+ "content": [
433
+ {"type": "image", "image": "file:///path/to/image1.jpg"},
434
+ {"type": "image", "image": "file:///path/to/image2.jpg"},
435
+ {"type": "text", "text": "What are the common elements in these pictures?"},
436
+ ],
437
+ }
438
+ ]
439
+ messages2 = [
440
+ {"role": "system", "content": "You are a helpful assistant."},
441
+ {"role": "user", "content": "Who are you?"},
442
+ ]
443
+ # Combine messages for batch processing
444
+ messages = [messages1, messages1]
445
+
446
+ # Preparation for batch inference
447
+ texts = [
448
+ processor.apply_chat_template(msg, tokenize=False, add_generation_prompt=True)
449
+ for msg in messages
450
+ ]
451
+ image_inputs, video_inputs = process_vision_info(messages)
452
+ inputs = processor(
453
+ text=texts,
454
+ images=image_inputs,
455
+ videos=video_inputs,
456
+ padding=True,
457
+ return_tensors="pt",
458
+ )
459
+ inputs = inputs.to("cuda")
460
+
461
+ # Batch Inference
462
+ generated_ids = model.generate(**inputs, max_new_tokens=128)
463
+ generated_ids_trimmed = [
464
+ out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
465
+ ]
466
+ output_texts = processor.batch_decode(
467
+ generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
468
+ )
469
+ print(output_texts)
470
+ ```
471
+ </details>
472
+
473
+ ### More Usage Tips
474
+
475
+ For input images, we support local files, base64, and URLs. For videos, we currently only support local files.
476
+
477
+ ```python
478
+ # You can directly insert a local file path, a URL, or a base64-encoded image into the position where you want in the text.
479
+ ## Local file path
480
+ messages = [
481
+ {
482
+ "role": "user",
483
+ "content": [
484
+ {"type": "image", "image": "file:///path/to/your/image.jpg"},
485
+ {"type": "text", "text": "Describe this image."},
486
+ ],
487
+ }
488
+ ]
489
+ ## Image URL
490
+ messages = [
491
+ {
492
+ "role": "user",
493
+ "content": [
494
+ {"type": "image", "image": "http://path/to/your/image.jpg"},
495
+ {"type": "text", "text": "Describe this image."},
496
+ ],
497
+ }
498
+ ]
499
+ ## Base64 encoded image
500
+ messages = [
501
+ {
502
+ "role": "user",
503
+ "content": [
504
+ {"type": "image", "image": "data:image;base64,/9j/..."},
505
+ {"type": "text", "text": "Describe this image."},
506
+ ],
507
+ }
508
+ ]
509
+ ```
510
+ #### Image Resolution for performance boost
511
+
512
+ The model supports a wide range of resolution inputs. By default, it uses the native resolution for input, but higher resolutions can enhance performance at the cost of more computation. Users can set the minimum and maximum number of pixels to achieve an optimal configuration for their needs, such as a token count range of 256-1280, to balance speed and memory usage.
513
+
514
+ ```python
515
+ min_pixels = 256 * 28 * 28
516
+ max_pixels = 1280 * 28 * 28
517
+ processor = AutoProcessor.from_pretrained(
518
+ "Qwen/Qwen2-VL-72B-Instruct", min_pixels=min_pixels, max_pixels=max_pixels
519
+ )
520
+ ```
521
+
522
+ Besides, We provide two methods for fine-grained control over the image size input to the model:
523
+
524
+ 1. Define min_pixels and max_pixels: Images will be resized to maintain their aspect ratio within the range of min_pixels and max_pixels.
525
+
526
+ 2. Specify exact dimensions: Directly set `resized_height` and `resized_width`. These values will be rounded to the nearest multiple of 28.
527
+
528
+ ```python
529
+ # min_pixels and max_pixels
530
+ messages = [
531
+ {
532
+ "role": "user",
533
+ "content": [
534
+ {
535
+ "type": "image",
536
+ "image": "file:///path/to/your/image.jpg",
537
+ "resized_height": 280,
538
+ "resized_width": 420,
539
+ },
540
+ {"type": "text", "text": "Describe this image."},
541
+ ],
542
+ }
543
+ ]
544
+ # resized_height and resized_width
545
+ messages = [
546
+ {
547
+ "role": "user",
548
+ "content": [
549
+ {
550
+ "type": "image",
551
+ "image": "file:///path/to/your/image.jpg",
552
+ "min_pixels": 50176,
553
+ "max_pixels": 50176,
554
+ },
555
+ {"type": "text", "text": "Describe this image."},
556
+ ],
557
+ }
558
+ ]
559
+ ```
560
+
561
+ ## Limitations
562
+
563
+ While Qwen2-VL are applicable to a wide range of visual tasks, it is equally important to understand its limitations. Here are some known restrictions:
564
+
565
+ 1. Lack of Audio Support: The current model does **not comprehend audio information** within videos.
566
+ 2. Data timeliness: Our image dataset is **updated until June 2023**, and information subsequent to this date may not be covered.
567
+ 3. Constraints in Individuals and Intellectual Property (IP): The model's capacity to recognize specific individuals or IPs is limited, potentially failing to comprehensively cover all well-known personalities or brands.
568
+ 4. Limited Capacity for Complex Instruction: When faced with intricate multi-step instructions, the model's understanding and execution capabilities require enhancement.
569
+ 5. Insufficient Counting Accuracy: Particularly in complex scenes, the accuracy of object counting is not high, necessitating further improvements.
570
+ 6. Weak Spatial Reasoning Skills: Especially in 3D spaces, the model's inference of object positional relationships is inadequate, making it difficult to precisely judge the relative positions of objects.
571
+
572
+ These limitations serve as ongoing directions for model optimization and improvement, and we are committed to continually enhancing the model's performance and scope of application.
573
+
574
+
575
+ ## Citation
576
+
577
+ If you find our work helpful, feel free to give us a cite.
578
+
579
+ ```
580
+ @article{Qwen2VL,
581
+ title={Qwen2-VL: Enhancing Vision-Language Model's Perception of the World at Any Resolution},
582
+ author={Wang, Peng and Bai, Shuai and Tan, Sinan and Wang, Shijie and Fan, Zhihao and Bai, Jinze and Chen, Keqin and Liu, Xuejing and Wang, Jialin and Ge, Wenbin and Fan, Yang and Dang, Kai and Du, Mengfei and Ren, Xuancheng and Men, Rui and Liu, Dayiheng and Zhou, Chang and Zhou, Jingren and Lin, Junyang},
583
+ journal={arXiv preprint arXiv:2409.12191},
584
+ year={2024}
585
+ }
586
+
587
+ @article{Qwen-VL,
588
+ title={Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond},
589
+ author={Bai, Jinze and Bai, Shuai and Yang, Shusheng and Wang, Shijie and Tan, Sinan and Wang, Peng and Lin, Junyang and Zhou, Chang and Zhou, Jingren},
590
+ journal={arXiv preprint arXiv:2308.12966},
591
+ year={2023}
592
+ }
593
+ ```
chat_template.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "chat_template": "{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n{% endif %}<|im_start|>{{ message['role'] }}\n{% if message['content'] is string %}{{ message['content'] }}<|im_end|>\n{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>\n{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant\n{% endif %}"
3
+ }
config.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen2VLForConditionalGeneration"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 151643,
7
+ "eos_token_id": 151645,
8
+ "vision_start_token_id": 151652,
9
+ "vision_end_token_id": 151653,
10
+ "vision_token_id": 151654,
11
+ "image_token_id": 151655,
12
+ "video_token_id": 151656,
13
+ "hidden_act": "silu",
14
+ "hidden_size": 8192,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 29440,
17
+ "max_position_embeddings": 32768,
18
+ "max_window_layers": 80,
19
+ "model_type": "qwen2_vl",
20
+ "num_attention_heads": 64,
21
+ "num_hidden_layers": 80,
22
+ "num_key_value_heads": 8,
23
+ "rms_norm_eps": 1e-06,
24
+ "rope_theta": 1000000.0,
25
+ "sliding_window": 32768,
26
+ "tie_word_embeddings": false,
27
+ "torch_dtype": "bfloat16",
28
+ "transformers_version": "4.41.2",
29
+ "use_cache": true,
30
+ "use_sliding_window": false,
31
+ "vision_config": {
32
+ "depth": 32,
33
+ "embed_dim": 1280,
34
+ "mlp_ratio": 4,
35
+ "num_heads": 16,
36
+ "in_chans": 3,
37
+ "hidden_size": 8192,
38
+ "patch_size": 14,
39
+ "spatial_merge_size": 2,
40
+ "spatial_patch_size": 14,
41
+ "temporal_patch_size": 2
42
+ },
43
+ "rope_scaling": {
44
+ "type": "mrope",
45
+ "mrope_section": [
46
+ 16,
47
+ 24,
48
+ 24
49
+ ]
50
+ },
51
+ "vocab_size": 152064
52
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "pad_token_id": 151643,
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 151645,
7
+ 151643
8
+ ],
9
+ "repetition_penalty": 1.05,
10
+ "temperature": 1,
11
+ "top_p": 0.001,
12
+ "top_k": 1,
13
+ "transformers_version": "4.37.0"
14
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3289c07a0b402a877fee1622c7e4992790b630b13389e1faadb43d28a261977
3
+ size 3890187664
model-00002-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f25c1cf72100109cbe660f5b5508aae49bc90ce9ab2dabba20967d6edb1fde59
3
+ size 3812769392
model-00003-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5994dd02d1a2f9543bbb216687f1c7341cf6efb3c18d96536836f17c149317bf
3
+ size 3995183944
model-00004-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2af985d056433efc392110c8d55f34ead92284d615b4dc3c8b7fb0787303b11f
3
+ size 3995183944
model-00005-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fcd509e4732231dc3012952276943dada5c7924698c9d1657070fa982720d07
3
+ size 3995200440
model-00006-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e65b602d77d0cf8d79e5ce60952db542b206ec61f7ca971be37863fbb95f35c3
3
+ size 3812769400
model-00007-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50081dfba7879c900dbf7627f63d86c71f9aecff7992a5061072a3982013488b
3
+ size 3995183968
model-00008-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8fca9bbf3608c5b3b4fe1b169511c71628e1a68615f2231484ddc41b0b7022df
3
+ size 3995183968
model-00009-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94b562b5ee115567641bfff0564a70ef3a9d22520a623a1ab267f4b6ac4c893d
3
+ size 3995200464
model-00010-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e595dfacbf9067f04765e13de404ec45f7d6e3f889d42e1eb1616ce490283b4
3
+ size 3812769424
model-00011-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acd49a8dc58a05439c9f24148b7953e908b3a304c63f60a10b7fffb21ae5cc01
3
+ size 3995183968
model-00012-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24ab38aa19e70089f2300d2ce5ba33a420e06cde9fd2924f8359f8d80808bc66
3
+ size 3995183968
model-00013-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8aa174c881ca9a050f27de4ebb335e9aad863ef79d92d97e601ec96b6997de82
3
+ size 3995200464
model-00014-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c2c9914644ab529e811a20f564c4e6c61d014d7bff8c71a0dd5c78cb7e2e5a55
3
+ size 3812769424
model-00015-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d355d95439dbb9d9d8a45d4fad02e0d05d0cab74ecb5331e3f76d662e0803e67
3
+ size 3995183968
model-00016-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79e7a8eb2959a6aa4d6c2eabe8a15dbac565962456e192a1e529cd6e93175f3e
3
+ size 3995183968
model-00017-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5672421d36d29bd7a4b4229c01d88f3df64afe740fe4949e8f766adf8d69406
3
+ size 3995200464
model-00018-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83348a378dd07722c272bee139ddf74a28ed6c286a3ae8fc09958b6d01a7faa2
3
+ size 3812769424
model-00019-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d970b54bbe860392d8bd558324ec9d814bacbaa4439aadee64bf3982ee9c7b69
3
+ size 3995183968
model-00020-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9708940270dedb7ac1121aef43e532f86882194b42267ecd1b271114af0491c5
3
+ size 3995183968
model-00021-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a006968b287e7b4df0264b325a5f96a94293cb7e28897d5dc630cc70e1003de2
3
+ size 3995200464
model-00022-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13818d4041952cae16798a890af22bcb16f4ff2fe9521f306bf85aa62c117469
3
+ size 3812769424
model-00023-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6ba4d30dbb68b3eaf26beacad4d8bf63f38c1a66909b1fea94bf99cc50d1a2ea
3
+ size 3995183968
model-00024-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa3d4f33b896eb0f8c96a3cfa7de77ccf781f4e9e430fdcbd6045f0d0a7f98f8
3
+ size 3995183968
model-00025-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff2a9eeca05b2e228fea0354ca658b11da72dfe686195e03c1e75a145207f080
3
+ size 3995200464
model-00026-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef8d71543562401806123bc7025476f0ec33e5a3b36de3a09755f9d90cd8df3f
3
+ size 3812769424
model-00027-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26df7a6131e612d5f32d5f498cc7709568d5c72754365ae2f8c6fc55f5b1f132
3
+ size 3995183968
model-00028-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36692c0137011babc209947df814ec91edabee6b41559ead7f07548a1103b704
3
+ size 3995183968
model-00029-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4359a3ba1f8a6469f9564cb3e3b7f383522d6f76ba2c6f3a988d539e73d52f9
3
+ size 3995200464
model-00030-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc538fd54f918c0930b8f125ab4c2ad3448057350a42254a2c956968988bc9af
3
+ size 3812769424
model-00031-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:773ac711c999b5507cec9972d3676f8ef42db421eaef07d92b8c395ce7084c7d
3
+ size 3995183968
model-00032-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:83c80ee97446f9be21145144142313550d0bdd5be04fe9f2e1b8bc73faa94740
3
+ size 3995183968
model-00033-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a0a9a527b01c1999d42ad224ab2fc7cb17e1f24db08e7a2b471fae4412023e2
3
+ size 3995200464
model-00034-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ae83e177c0a4924cfba5674b446c2b5e2d6aac19509f5eb5cf4cb7db10cf4e7
3
+ size 3812769424
model-00035-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f495878959e031f0269dd8648abe38692c0addd7ef77e2f3d5c74b59fb9354b5
3
+ size 3995183968
model-00036-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0992e3fcae770470b3d5ab9eadd3fdc273d23f347b826b6f054e1c1da1ce652
3
+ size 3995183968
model-00037-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52a49e7d70bb6bc09479c9d0d205a806681b7f8bbce6dad594de14ebb6fe889a
3
+ size 2239829584
model-00038-of-00038.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36d920f0d57b93710d21313e9562929bc9f39ce4eda6134232b65bf01039c6c6
3
+ size 2491416704
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "min_pixels": 3136,
3
+ "max_pixels": 12845056,
4
+ "patch_size": 14,
5
+ "temporal_patch_size": 2,
6
+ "merge_size": 2,
7
+ "image_mean": [
8
+ 0.48145466,
9
+ 0.4578275,
10
+ 0.40821073
11
+ ],
12
+ "image_std": [
13
+ 0.26862954,
14
+ 0.26130258,
15
+ 0.27577711
16
+ ],
17
+ "image_processor_type": "Qwen2VLImageProcessor",
18
+ "processor_class": "Qwen2VLProcessor"
19
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "151643": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "151644": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "151645": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "151646": {
29
+ "content": "<|object_ref_start|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "151647": {
37
+ "content": "<|object_ref_end|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "151648": {
45
+ "content": "<|box_start|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "151649": {
53
+ "content": "<|box_end|>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "151650": {
61
+ "content": "<|quad_start|>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "151651": {
69
+ "content": "<|quad_end|>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "151652": {
77
+ "content": "<|vision_start|>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "151653": {
85
+ "content": "<|vision_end|>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "151654": {
93
+ "content": "<|vision_pad|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "151655": {
101
+ "content": "<|image_pad|>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "151656": {
109
+ "content": "<|video_pad|>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ }
116
+ },
117
+ "additional_special_tokens": ["<|im_start|>", "<|im_end|>", "<|object_ref_start|>","<|object_ref_end|>","<|box_start|>","<|box_end|>","<|quad_start|>","<|quad_end|>","<|vision_start|>","<|vision_end|>","<|vision_pad|>","<|image_pad|>","<|video_pad|>"],
118
+ "bos_token": null,
119
+ "chat_template": "{% set image_count = namespace(value=0) %}{% set video_count = namespace(value=0) %}{% for message in messages %}{% if loop.first and message['role'] != 'system' %}<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n{% endif %}<|im_start|>{{ message['role'] }}\n{% if message['content'] is string %}{{ message['content'] }}<|im_end|>\n{% else %}{% for content in message['content'] %}{% if content['type'] == 'image' or 'image' in content or 'image_url' in content %}{% set image_count.value = image_count.value + 1 %}{% if add_vision_id %}Picture {{ image_count.value }}: {% endif %}<|vision_start|><|image_pad|><|vision_end|>{% elif content['type'] == 'video' or 'video' in content %}{% set video_count.value = video_count.value + 1 %}{% if add_vision_id %}Video {{ video_count.value }}: {% endif %}<|vision_start|><|video_pad|><|vision_end|>{% elif 'text' in content %}{{ content['text'] }}{% endif %}{% endfor %}<|im_end|>\n{% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant\n{% endif %}",
120
+ "clean_up_tokenization_spaces": false,
121
+ "eos_token": "<|im_end|>",
122
+ "padding_side": "left",
123
+ "errors": "replace",
124
+ "model_max_length": 32768,
125
+ "pad_token": "<|endoftext|>",
126
+ "split_special_tokens": false,
127
+ "tokenizer_class": "Qwen2Tokenizer",
128
+ "unk_token": null
129
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff