danielhanchen commited on
Commit
d9ec034
·
verified ·
1 Parent(s): da12fe3

Add files using upload-large-folder tool

Browse files
README.md CHANGED
@@ -1,60 +1,21 @@
1
  ---
2
- base_model: Qwen/Qwen2.5-VL-3B-Instruct
 
 
 
3
  language:
4
  - en
5
- library_name: transformers
6
  pipeline_tag: image-text-to-text
7
- license: apache-2.0
8
  tags:
9
  - multimodal
10
- - qwen
11
- - qwen2
12
  - unsloth
13
- - transformers
14
- - vision
15
  ---
16
 
17
- <div>
18
- <p style="margin-bottom: 0;">
19
- <em>Unsloth's <a href="https://unsloth.ai/blog/dynamic-4bit">Dynamic 4-bit Quants</a> is selectively quantized, greatly improving accuracy over standard 4-bit.</em>
20
- </p>
21
- <div style="display: flex; gap: 5px; align-items: center; ">
22
- <a href="https://github.com/unslothai/unsloth/">
23
- <img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
24
- </a>
25
- <a href="https://discord.gg/unsloth">
26
- <img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
27
- </a>
28
- <a href="https://docs.unsloth.ai/">
29
- <img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
30
- </a>
31
- </div>
32
- <h1 style="margin-top: 0rem;">Finetune LLMs 2-5x faster with 70% less memory via Unsloth</h2>
33
- </div>
34
- We have a free Google Colab Tesla T4 notebook for Qwen2-VL (7B) here: https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen2_VL_(7B)-Vision.ipynb
35
-
36
- ## ✨ Finetune for Free
37
-
38
- All notebooks are **beginner friendly**! Add your dataset, click "Run All", and you'll get a 2x faster finetuned model which can be exported to GGUF, vLLM or uploaded to Hugging Face.
39
-
40
- | Unsloth supports | Free Notebooks | Performance | Memory use |
41
- |-----------------|--------------------------------------------------------------------------------------------------------------------------|-------------|----------|
42
- | **Llama-3.2 (3B)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.2_(1B_and_3B)-Conversational.ipynb) | 2.4x faster | 58% less |
43
- | **Llama-3.2 (11B vision)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.2_(11B)-Vision.ipynb) | 2x faster | 60% less |
44
- | **Qwen2 VL (7B)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen2_VL_(7B)-Vision.ipynb) | 1.8x faster | 60% less |
45
- | **Qwen2.5 (7B)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen2.5_(7B)-Alpaca.ipynb) | 2x faster | 60% less |
46
- | **Llama-3.1 (8B)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.1_(8B)-Alpaca.ipynb) | 2.4x faster | 58% less |
47
- | **Phi-3.5 (mini)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Phi_3.5_Mini-Conversational.ipynb) | 2x faster | 50% less |
48
- | **Gemma 2 (9B)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Gemma2_(9B)-Alpaca.ipynb) | 2.4x faster | 58% less |
49
- | **Mistral (7B)** | [▶️ Start on Colab](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Mistral_v0.3_(7B)-Conversational.ipynb) | 2.2x faster | 62% less |
50
-
51
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="200"/>](https://docs.unsloth.ai)
52
-
53
- - This [Llama 3.2 conversational notebook](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.2_(1B_and_3B)-Conversational.ipynb) is useful for ShareGPT ChatML / Vicuna templates.
54
- - This [text completion notebook](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Mistral_(7B)-Text_Completion.ipynb) is for raw text. This [DPO notebook](https://colab.research.google.com/drive/15vttTpzzVXv_tJwEk-hIcQ0S9FcEWvwP?usp=sharing) replicates Zephyr.
55
- - \* Kaggle has 2x T4s, but we use 1. Due to overhead, 1x T4 is 5x faster.
56
-
57
- # Qwen2.5-VL
58
 
59
  ## Introduction
60
 
@@ -88,7 +49,7 @@ We extend dynamic resolution to the temporal dimension by adopting dynamic FPS s
88
  We enhance both training and inference speeds by strategically implementing window attention into the ViT. The ViT architecture is further optimized with SwiGLU and RMSNorm, aligning it with the structure of the Qwen2.5 LLM.
89
 
90
 
91
- We have three models with 3, 7 and 72 billion parameters. This repo contains the instruction-tuned 7B Qwen2.5-VL model. For more information, visit our [Blog](https://qwenlm.github.io/blog/qwen2.5-vl/) and [GitHub](https://github.com/QwenLM/Qwen2.5-VL).
92
 
93
 
94
 
@@ -96,50 +57,45 @@ We have three models with 3, 7 and 72 billion parameters. This repo contains the
96
 
97
  ### Image benchmark
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
 
100
- | Benchmark | InternVL2.5-8B | MiniCPM-o 2.6 | GPT-4o-mini | Qwen2-VL-7B |**Qwen2.5-VL-7B** |
101
- | :--- | :---: | :---: | :---: | :---: | :---: |
102
- | MMMU<sub>val</sub> | 56 | 50.4 | **60**| 54.1 | 58.6|
103
- | MMMU-Pro<sub>val</sub> | 34.3 | - | 37.6| 30.5 | 41.0|
104
- | DocVQA<sub>test</sub> | 93 | 93 | - | 94.5 | **95.7** |
105
- | InfoVQA<sub>test</sub> | 77.6 | - | - |76.5 | **82.6** |
106
- | ChartQA<sub>test</sub> | 84.8 | - |- | 83.0 |**87.3** |
107
- | TextVQA<sub>val</sub> | 79.1 | 80.1 | -| 84.3 | **84.9**|
108
- | OCRBench | 822 | 852 | 785 | 845 | **864** |
109
- | CC_OCR | 57.7 | | | 61.6 | **77.8**|
110
- | MMStar | 62.8| | |60.7| **63.9**|
111
- | MMBench-V1.1-En<sub>test</sub> | 79.4 | 78.0 | 76.0| 80.7 | **82.6** |
112
- | MMT-Bench<sub>test</sub> | - | - | - |**63.7** |63.6 |
113
- | MMStar | **61.5** | 57.5 | 54.8 | 60.7 |63.9 |
114
- | MMVet<sub>GPT-4-Turbo</sub> | 54.2 | 60.0 | 66.9 | 62.0 | **67.1**|
115
- | HallBench<sub>avg</sub> | 45.2 | 48.1 | 46.1| 50.6 | **52.9**|
116
- | MathVista<sub>testmini</sub> | 58.3 | 60.6 | 52.4 | 58.2 | **68.2**|
117
- | MathVision | - | - | - | 16.3 | **25.07** |
118
-
119
- ### Video Benchmarks
120
-
121
- | Benchmark | Qwen2-VL-7B | **Qwen2.5-VL-7B** |
122
- | :--- | :---: | :---: |
123
- | MVBench | 67.0 | **69.6** |
124
- | PerceptionTest<sub>test</sub> | 66.9 | **70.5** |
125
- | Video-MME<sub>wo/w subs</sub> | 63.3/69.0 | **65.1**/**71.6** |
126
- | LVBench | | 45.3 |
127
- | LongVideoBench | | 54.7 |
128
- | MMBench-Video | 1.44 | 1.79 |
129
- | TempCompass | | 71.7 |
130
- | MLVU | | 70.2 |
131
- | CharadesSTA/mIoU | 43.6|
132
 
133
  ### Agent benchmark
134
- | Benchmarks | Qwen2.5-VL-7B |
135
  |-------------------------|---------------|
136
- | ScreenSpot | 84.7 |
137
- | ScreenSpot Pro | 29.0 |
138
- | AITZ_EM | 81.9 |
139
- | Android Control High_EM | 60.1 |
140
- | Android Control Low_EM | 93.7 |
141
- | AndroidWorld_SR | 25.5 |
142
- | MobileMiniWob++_SR | 91.4 |
143
 
144
  ## Requirements
145
  The code of Qwen2.5-VL has been in the latest Hugging face transformers and we advise you to build from source with command:
@@ -185,25 +141,25 @@ from qwen_vl_utils import process_vision_info
185
 
186
  # default: Load the model on the available device(s)
187
  model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
188
- "Qwen/Qwen2.5-VL-7B-Instruct", torch_dtype="auto", device_map="auto"
189
  )
190
 
191
  # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
192
  # model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
193
- # "Qwen/Qwen2.5-VL-7B-Instruct",
194
  # torch_dtype=torch.bfloat16,
195
  # attn_implementation="flash_attention_2",
196
  # device_map="auto",
197
  # )
198
 
199
  # default processer
200
- processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
201
 
202
  # The default range for the number of visual tokens per image in the model is 4-16384.
203
  # You can set min_pixels and max_pixels according to your needs, such as a token range of 256-1280, to balance performance and cost.
204
  # min_pixels = 256*28*28
205
  # max_pixels = 1280*28*28
206
- # processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct", min_pixels=min_pixels, max_pixels=max_pixels)
207
 
208
  messages = [
209
  {
@@ -472,7 +428,7 @@ The model supports a wide range of resolution inputs. By default, it uses the na
472
  min_pixels = 256 * 28 * 28
473
  max_pixels = 1280 * 28 * 28
474
  processor = AutoProcessor.from_pretrained(
475
- "Qwen/Qwen2.5-VL-7B-Instruct", min_pixels=min_pixels, max_pixels=max_pixels
476
  )
477
  ```
478
 
@@ -522,6 +478,7 @@ To handle extensive inputs exceeding 32,768 tokens, we utilize [YaRN](https://ar
522
 
523
  For supported frameworks, you could add the following to `config.json` to enable YaRN:
524
 
 
525
  {
526
  ...,
527
  "type": "yarn",
@@ -533,6 +490,7 @@ For supported frameworks, you could add the following to `config.json` to enable
533
  "factor": 4,
534
  "original_max_position_embeddings": 32768
535
  }
 
536
 
537
  However, it should be noted that this method has a significant impact on the performance of temporal and spatial localization tasks, and is therefore not recommended for use.
538
 
@@ -540,7 +498,6 @@ At the same time, for long video inputs, since MRoPE itself is more economical w
540
 
541
 
542
 
543
-
544
  ## Citation
545
 
546
  If you find our work helpful, feel free to give us a cite.
@@ -568,4 +525,3 @@ If you find our work helpful, feel free to give us a cite.
568
  year={2023}
569
  }
570
  ```
571
-
 
1
  ---
2
+ base_model:
3
+ - Qwen/Qwen2.5-VL-3B-Instruct
4
+ license_name: qwen-research
5
+ license_link: https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct/blob/main/LICENSE
6
  language:
7
  - en
 
8
  pipeline_tag: image-text-to-text
 
9
  tags:
10
  - multimodal
 
 
11
  - unsloth
12
+ library_name: transformers
 
13
  ---
14
 
15
+ # Qwen2.5-VL-3B-Instruct
16
+ <a href="https://chat.qwenlm.ai/" target="_blank" style="margin: 2px;">
17
+ <img alt="Chat" src="https://img.shields.io/badge/%F0%9F%92%9C%EF%B8%8F%20Qwen%20Chat%20-536af5" style="display: inline-block; vertical-align: middle;"/>
18
+ </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  ## Introduction
21
 
 
49
  We enhance both training and inference speeds by strategically implementing window attention into the ViT. The ViT architecture is further optimized with SwiGLU and RMSNorm, aligning it with the structure of the Qwen2.5 LLM.
50
 
51
 
52
+ We have three models with 3, 7 and 72 billion parameters. This repo contains the instruction-tuned 3B Qwen2.5-VL model. For more information, visit our [Blog](https://qwenlm.github.io/blog/qwen2.5-vl/) and [GitHub](https://github.com/QwenLM/Qwen2.5-VL).
53
 
54
 
55
 
 
57
 
58
  ### Image benchmark
59
 
60
+ | Benchmark | InternVL2.5-4B |Qwen2-VL-7B |Qwen2.5-VL-3B |
61
+ | :--- | :---: | :---: | :---: |
62
+ | MMMU<sub>val</sub> | 52.3 | 54.1 | 53.1|
63
+ | MMMU-Pro<sub>val</sub> | **32.7** | 30.5 | 31.6|
64
+ | AI2D<sub>test</sub> | 81.4 | **83.0** | 81.5 |
65
+ | DocVQA<sub>test</sub> | 91.6 | 94.5 | **93.9** |
66
+ | InfoVQA<sub>test</sub> | 72.1 | 76.5 | **77.1** |
67
+ | TextVQA<sub>val</sub> | 76.8 | **84.3** | 79.3|
68
+ | MMBench-V1.1<sub>test</sub> | 79.3 | **80.7** | 77.6 |
69
+ | MMStar | 58.3 | **60.7** | 55.9 |
70
+ | MathVista<sub>testmini</sub> | 60.5 | 58.2 | **62.3** |
71
+ | MathVision<sub>full</sub> | 20.9 | 16.3 | **21.2** |
72
+
73
+
74
+ ### Video benchmark
75
+ | Benchmark | InternVL2.5-4B | Qwen2-VL-7B | Qwen2.5-VL-3B |
76
+ | :--- | :---: | :---: | :---: |
77
+ | MVBench | 71.6 | 67.0 | 67.0 |
78
+ | VideoMME | 63.6/62.3 | 69.0/63.3 | 67.6/61.5 |
79
+ | MLVU | 48.3 | - | 68.2 |
80
+ | LVBench | - | - | 43.3 |
81
+ | MMBench-Video | 1.73 | 1.44 | 1.63 |
82
+ | EgoSchema | - | - | 64.8 |
83
+ | PerceptionTest | - | - | 66.9 |
84
+ | TempCompass | - | - | 64.4 |
85
+ | LongVideoBench | 55.2 | 55.6 | 54.2 |
86
+ | CharadesSTA/mIoU | - | - | 38.8 |
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  ### Agent benchmark
90
+ | Benchmarks | Qwen2.5-VL-3B |
91
  |-------------------------|---------------|
92
+ | ScreenSpot | 55.5 |
93
+ | ScreenSpot Pro | 23.9 |
94
+ | AITZ_EM | 76.9 |
95
+ | Android Control High_EM | 63.7 |
96
+ | Android Control Low_EM | 22.2 |
97
+ | AndroidWorld_SR | 90.8 |
98
+ | MobileMiniWob++_SR | 67.9 |
99
 
100
  ## Requirements
101
  The code of Qwen2.5-VL has been in the latest Hugging face transformers and we advise you to build from source with command:
 
141
 
142
  # default: Load the model on the available device(s)
143
  model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
144
+ "Qwen/Qwen2.5-VL-3B-Instruct", torch_dtype="auto", device_map="auto"
145
  )
146
 
147
  # We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
148
  # model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
149
+ # "Qwen/Qwen2.5-VL-3B-Instruct",
150
  # torch_dtype=torch.bfloat16,
151
  # attn_implementation="flash_attention_2",
152
  # device_map="auto",
153
  # )
154
 
155
  # default processer
156
+ processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
157
 
158
  # The default range for the number of visual tokens per image in the model is 4-16384.
159
  # You can set min_pixels and max_pixels according to your needs, such as a token range of 256-1280, to balance performance and cost.
160
  # min_pixels = 256*28*28
161
  # max_pixels = 1280*28*28
162
+ # processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct", min_pixels=min_pixels, max_pixels=max_pixels)
163
 
164
  messages = [
165
  {
 
428
  min_pixels = 256 * 28 * 28
429
  max_pixels = 1280 * 28 * 28
430
  processor = AutoProcessor.from_pretrained(
431
+ "Qwen/Qwen2.5-VL-3B-Instruct", min_pixels=min_pixels, max_pixels=max_pixels
432
  )
433
  ```
434
 
 
478
 
479
  For supported frameworks, you could add the following to `config.json` to enable YaRN:
480
 
481
+ ```
482
  {
483
  ...,
484
  "type": "yarn",
 
490
  "factor": 4,
491
  "original_max_position_embeddings": 32768
492
  }
493
+ ```
494
 
495
  However, it should be noted that this method has a significant impact on the performance of temporal and spatial localization tasks, and is therefore not recommended for use.
496
 
 
498
 
499
 
500
 
 
501
  ## Citation
502
 
503
  If you find our work helpful, feel free to give us a cite.
 
525
  year={2023}
526
  }
527
  ```
 
chat_template.jinja ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {% 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
2
+ You are a helpful assistant.<|im_end|>
3
+ {% endif %}<|im_start|>{{ message['role'] }}
4
+ {% if message['content'] is string %}{{ message['content'] }}<|im_end|>
5
+ {% 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|>
6
+ {% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant
7
+ {% endif %}
config.json CHANGED
@@ -1,5 +1,4 @@
1
  {
2
- "_name_or_path": "unsloth/Qwen2.5-VL-3B-Instruct",
3
  "architectures": [
4
  "Qwen2_5_VLForConditionalGeneration"
5
  ],
@@ -10,7 +9,7 @@
10
  "image_token_id": 151655,
11
  "initializer_range": 0.02,
12
  "intermediate_size": 11008,
13
- "max_position_embeddings": 32768,
14
  "max_window_layers": 70,
15
  "model_type": "qwen2_5_vl",
16
  "num_attention_heads": 16,
@@ -31,74 +30,76 @@
31
  "multi_modal_projector",
32
  "merger",
33
  "modality_projection",
34
- "visual.merger.mlp",
35
- "visual.blocks.28.attn",
36
  "model.layers.5.mlp",
37
  "visual.blocks.25.attn",
 
 
 
 
38
  "visual.blocks.26.attn",
39
- "visual.blocks.31.attn",
40
  "visual.blocks.22.attn",
 
41
  "visual.blocks.27.attn",
42
- "visual.blocks.24.attn",
43
- "visual.blocks.29.attn",
44
- "visual.blocks.21.attn",
45
  "visual.blocks.30.mlp",
46
- "visual.blocks.30.attn",
47
- "visual.blocks.25.mlp",
48
- "visual.blocks.27.mlp",
49
- "visual.blocks.23.attn",
50
- "visual.blocks.20.attn",
51
  "visual.blocks.29.mlp",
52
- "visual.blocks.24.mlp",
 
53
  "visual.blocks.18.attn",
54
- "visual.blocks.31.mlp",
55
- "visual.blocks.19.attn",
56
  "visual.blocks.26.mlp",
 
 
57
  "visual.blocks.28.mlp",
 
 
 
58
  "visual.blocks.23.mlp",
59
- "visual.blocks.21.mlp",
60
- "visual.blocks.13.attn",
61
  "visual.blocks.17.attn",
62
  "visual.blocks.20.mlp",
63
- "model.layers.2.mlp",
 
64
  "visual.blocks.22.mlp",
65
- "visual.blocks.18.mlp",
66
- "visual.blocks.16.attn",
67
- "visual.blocks.12.attn",
68
- "visual.blocks.19.mlp",
69
  "visual.blocks.9.mlp",
70
- "visual.blocks.6.mlp",
71
- "visual.blocks.16.mlp",
72
  "visual.blocks.10.mlp",
73
- "visual.blocks.9.attn",
 
 
 
 
74
  "model.layers.1.mlp",
75
- "visual.blocks.10.attn",
76
  "visual.blocks.14.attn",
77
- "visual.blocks.6.attn",
78
  "visual.blocks.11.mlp",
79
  "visual.blocks.11.attn",
 
 
80
  "visual.blocks.12.mlp",
81
- "visual.blocks.7.mlp",
82
- "visual.blocks.2.mlp",
83
  "visual.blocks.13.mlp",
84
- "visual.blocks.8.attn",
85
- "visual.blocks.5.mlp",
86
  "visual.blocks.8.mlp",
87
  "visual.blocks.14.mlp",
 
 
 
88
  "visual.blocks.15.mlp",
 
 
 
89
  "visual.blocks.4.mlp",
90
- "visual.blocks.5.attn",
 
 
91
  "visual.blocks.17.mlp",
92
- "visual.blocks.3.mlp",
93
  "visual.blocks.15.attn",
94
- "visual.blocks.1.attn",
95
- "visual.blocks.1.mlp",
96
- "visual.blocks.7.attn",
97
- "visual.blocks.2.attn",
98
  "visual.blocks.4.attn",
99
- "visual.blocks.0.mlp",
100
  "visual.blocks.0.attn",
101
- "visual.blocks.3.attn"
 
 
102
  ],
103
  "llm_int8_threshold": 6.0,
104
  "load_in_4bit": true,
@@ -117,21 +118,76 @@
117
  },
118
  "rope_theta": 1000000.0,
119
  "sliding_window": 32768,
120
- "tie_word_embeddings": true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  "torch_dtype": "bfloat16",
122
- "transformers_version": "4.49.0",
123
  "unsloth_fixed": true,
124
  "use_cache": true,
125
  "use_sliding_window": false,
126
  "video_token_id": 151656,
127
  "vision_config": {
 
 
 
 
 
 
 
 
128
  "hidden_size": 1280,
 
129
  "in_chans": 3,
 
 
130
  "model_type": "qwen2_5_vl",
 
131
  "out_hidden_size": 2048,
 
 
132
  "spatial_patch_size": 14,
 
133
  "tokens_per_second": 2,
134
- "torch_dtype": "bfloat16"
 
135
  },
136
  "vision_end_token_id": 151653,
137
  "vision_start_token_id": 151652,
 
1
  {
 
2
  "architectures": [
3
  "Qwen2_5_VLForConditionalGeneration"
4
  ],
 
9
  "image_token_id": 151655,
10
  "initializer_range": 0.02,
11
  "intermediate_size": 11008,
12
+ "max_position_embeddings": 128000,
13
  "max_window_layers": 70,
14
  "model_type": "qwen2_5_vl",
15
  "num_attention_heads": 16,
 
30
  "multi_modal_projector",
31
  "merger",
32
  "modality_projection",
 
 
33
  "model.layers.5.mlp",
34
  "visual.blocks.25.attn",
35
+ "visual.merger.mlp",
36
+ "visual.blocks.24.attn",
37
+ "visual.blocks.29.attn",
38
+ "visual.blocks.30.attn",
39
  "visual.blocks.26.attn",
 
40
  "visual.blocks.22.attn",
41
+ "visual.blocks.31.attn",
42
  "visual.blocks.27.attn",
43
+ "model.layers.30.mlp",
 
 
44
  "visual.blocks.30.mlp",
45
+ "visual.blocks.28.attn",
 
 
 
 
46
  "visual.blocks.29.mlp",
47
+ "visual.blocks.25.mlp",
48
+ "visual.blocks.21.attn",
49
  "visual.blocks.18.attn",
50
+ "visual.blocks.20.attn",
 
51
  "visual.blocks.26.mlp",
52
+ "visual.blocks.16.attn",
53
+ "visual.blocks.31.mlp",
54
  "visual.blocks.28.mlp",
55
+ "visual.blocks.27.mlp",
56
+ "visual.blocks.24.mlp",
57
+ "visual.blocks.19.attn",
58
  "visual.blocks.23.mlp",
59
+ "visual.blocks.19.mlp",
 
60
  "visual.blocks.17.attn",
61
  "visual.blocks.20.mlp",
62
+ "visual.blocks.23.attn",
63
+ "visual.blocks.13.attn",
64
  "visual.blocks.22.mlp",
 
 
 
 
65
  "visual.blocks.9.mlp",
 
 
66
  "visual.blocks.10.mlp",
67
+ "visual.blocks.16.mlp",
68
+ "visual.blocks.12.attn",
69
+ "visual.blocks.18.mlp",
70
+ "visual.blocks.21.mlp",
71
+ "visual.blocks.6.mlp",
72
  "model.layers.1.mlp",
 
73
  "visual.blocks.14.attn",
 
74
  "visual.blocks.11.mlp",
75
  "visual.blocks.11.attn",
76
+ "visual.blocks.9.attn",
77
+ "model.layers.2.mlp",
78
  "visual.blocks.12.mlp",
79
+ "visual.blocks.10.attn",
80
+ "visual.blocks.6.attn",
81
  "visual.blocks.13.mlp",
 
 
82
  "visual.blocks.8.mlp",
83
  "visual.blocks.14.mlp",
84
+ "visual.blocks.7.mlp",
85
+ "visual.blocks.5.attn",
86
+ "visual.blocks.8.attn",
87
  "visual.blocks.15.mlp",
88
+ "visual.blocks.5.mlp",
89
+ "visual.blocks.3.mlp",
90
+ "visual.blocks.2.mlp",
91
  "visual.blocks.4.mlp",
92
+ "visual.blocks.2.attn",
93
+ "visual.blocks.7.attn",
94
+ "visual.blocks.1.attn",
95
  "visual.blocks.17.mlp",
 
96
  "visual.blocks.15.attn",
 
 
 
 
97
  "visual.blocks.4.attn",
98
+ "visual.blocks.1.mlp",
99
  "visual.blocks.0.attn",
100
+ "visual.blocks.0.mlp",
101
+ "visual.blocks.3.attn",
102
+ "visual.blocks.31.mlp.down_proj"
103
  ],
104
  "llm_int8_threshold": 6.0,
105
  "load_in_4bit": true,
 
118
  },
119
  "rope_theta": 1000000.0,
120
  "sliding_window": 32768,
121
+ "text_config": {
122
+ "architectures": [
123
+ "Qwen2_5_VLForConditionalGeneration"
124
+ ],
125
+ "attention_dropout": 0.0,
126
+ "bos_token_id": 151643,
127
+ "eos_token_id": 151645,
128
+ "hidden_act": "silu",
129
+ "hidden_size": 2048,
130
+ "image_token_id": null,
131
+ "initializer_range": 0.02,
132
+ "intermediate_size": 11008,
133
+ "max_position_embeddings": 128000,
134
+ "max_window_layers": 70,
135
+ "model_type": "qwen2_5_vl_text",
136
+ "num_attention_heads": 16,
137
+ "num_hidden_layers": 36,
138
+ "num_key_value_heads": 2,
139
+ "rms_norm_eps": 1e-06,
140
+ "rope_scaling": {
141
+ "mrope_section": [
142
+ 16,
143
+ 24,
144
+ 24
145
+ ],
146
+ "rope_type": "default",
147
+ "type": "default"
148
+ },
149
+ "rope_theta": 1000000.0,
150
+ "sliding_window": 32768,
151
+ "tie_word_embeddings": true,
152
+ "torch_dtype": "bfloat16",
153
+ "use_cache": true,
154
+ "use_sliding_window": false,
155
+ "video_token_id": null,
156
+ "vision_end_token_id": 151653,
157
+ "vision_start_token_id": 151652,
158
+ "vision_token_id": 151654,
159
+ "vocab_size": 151936
160
+ },
161
  "torch_dtype": "bfloat16",
162
+ "transformers_version": "4.52.0.dev0",
163
  "unsloth_fixed": true,
164
  "use_cache": true,
165
  "use_sliding_window": false,
166
  "video_token_id": 151656,
167
  "vision_config": {
168
+ "depth": 32,
169
+ "fullatt_block_indexes": [
170
+ 7,
171
+ 15,
172
+ 23,
173
+ 31
174
+ ],
175
+ "hidden_act": "silu",
176
  "hidden_size": 1280,
177
+ "in_channels": 3,
178
  "in_chans": 3,
179
+ "initializer_range": 0.02,
180
+ "intermediate_size": 3420,
181
  "model_type": "qwen2_5_vl",
182
+ "num_heads": 16,
183
  "out_hidden_size": 2048,
184
+ "patch_size": 14,
185
+ "spatial_merge_size": 2,
186
  "spatial_patch_size": 14,
187
+ "temporal_patch_size": 2,
188
  "tokens_per_second": 2,
189
+ "torch_dtype": "bfloat16",
190
+ "window_size": 112
191
  },
192
  "vision_end_token_id": 151653,
193
  "vision_start_token_id": 151652,
generation_config.json CHANGED
@@ -5,11 +5,9 @@
5
  151645,
6
  151643
7
  ],
8
- "max_length": 32768,
9
  "pad_token_id": 151654,
10
  "repetition_penalty": 1.05,
11
- "temperature": 0.1,
12
- "top_k": 1,
13
- "top_p": 0.001,
14
- "transformers_version": "4.49.0"
15
  }
 
5
  151645,
6
  151643
7
  ],
8
+ "max_length": 128000,
9
  "pad_token_id": 151654,
10
  "repetition_penalty": 1.05,
11
+ "temperature": 1e-06,
12
+ "transformers_version": "4.52.0.dev0"
 
 
13
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e556b1118e6c6b9fdf3b37804ba4ec3d5ae37aa63013f9e92c4f2859ef481375
3
- size 3693149642
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b25dbfec33ee11b1efab94b2bd8142b962ad5670dda424a695e1450e60e7f44
3
+ size 3793520611
tokenizer_config.json CHANGED
@@ -195,16 +195,16 @@
195
  "<|video_pad|>"
196
  ],
197
  "bos_token": null,
198
- "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
199
  "clean_up_tokenization_spaces": false,
200
  "eos_token": "<|im_end|>",
201
  "errors": "replace",
202
  "extra_special_tokens": {},
203
- "model_max_length": 32768,
204
  "pad_token": "<|vision_pad|>",
205
  "padding_side": "left",
206
  "processor_class": "Qwen2_5_VLProcessor",
207
  "split_special_tokens": false,
208
  "tokenizer_class": "Qwen2Tokenizer",
209
- "unk_token": null
210
- }
 
 
195
  "<|video_pad|>"
196
  ],
197
  "bos_token": null,
 
198
  "clean_up_tokenization_spaces": false,
199
  "eos_token": "<|im_end|>",
200
  "errors": "replace",
201
  "extra_special_tokens": {},
202
+ "model_max_length": 128000,
203
  "pad_token": "<|vision_pad|>",
204
  "padding_side": "left",
205
  "processor_class": "Qwen2_5_VLProcessor",
206
  "split_special_tokens": false,
207
  "tokenizer_class": "Qwen2Tokenizer",
208
+ "unk_token": null,
209
+ "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 %}"
210
+ }