beaupi commited on
Commit
c6c78bd
·
verified ·
1 Parent(s): 9edbd84

Upload chandra-ocr-2-oQ4 via oMLX

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: openrail
4
+ license_link: LICENSE
5
+ tags:
6
+ - ocr
7
+ - pdf
8
+ - markdown
9
+ - layout
10
+ ---
11
+
12
+ <p align="center">
13
+ <img src="datalab-logo.png" alt="Datalab Logo" width="150"/>
14
+ </p>
15
+
16
+ # Chandra OCR 2
17
+
18
+ Chandra 2 is a state of the art OCR model from [Datalab](https://www.datalab.to) that outputs markdown, HTML, and JSON. It is highly accurate at extracting text from images and PDFs, while preserving layout information.
19
+
20
+ Try Chandra in the [free playground](https://www.datalab.to/playground), or use the [hosted API](https://www.datalab.to/) for higher accuracy and speed.
21
+
22
+ ## What's New in Chandra 2
23
+
24
+ - 85.9% olmocr bench score (sota), 77.8% multilingual bench score (12% improvement over Chandra 1)
25
+ - Significant improvements to math, tables, complex layouts
26
+ - Improved layout, especially on wider documents
27
+ - Significantly better image captioning
28
+ - 90+ language support with major accuracy gains
29
+
30
+ ## Features
31
+
32
+ - Convert documents to markdown, HTML, or JSON with detailed layout information
33
+ - Excellent handwriting support
34
+ - Reconstructs forms accurately, including checkboxes
35
+ - Strong performance with tables, math, and complex layouts
36
+ - Extracts images and diagrams, with captions and structured data
37
+ - Support for 90+ languages
38
+
39
+ <img src="handwritten_form.png" width="600px"/>
40
+
41
+ ## Quickstart
42
+
43
+ ```shell
44
+ pip install chandra-ocr
45
+
46
+ # With vLLM (recommended, easy install)
47
+ chandra_vllm
48
+ chandra input.pdf ./output
49
+
50
+ # With HuggingFace (requires torch)
51
+ pip install chandra-ocr[hf]
52
+ chandra input.pdf ./output --method hf
53
+ ```
54
+
55
+ ## Usage
56
+
57
+ ### With vLLM (recommended)
58
+
59
+ ```python
60
+ from chandra.model import InferenceManager
61
+ from chandra.model.schema import BatchInputItem
62
+ from PIL import Image
63
+
64
+ # Start vLLM server first with: chandra_vllm
65
+ manager = InferenceManager(method="vllm")
66
+ batch = [
67
+ BatchInputItem(
68
+ image=Image.open("document.png"),
69
+ prompt_type="ocr_layout"
70
+ )
71
+ ]
72
+ result = manager.generate(batch)[0]
73
+ print(result.markdown)
74
+ ```
75
+
76
+ ### With HuggingFace Transformers
77
+
78
+ ```python
79
+ from transformers import AutoModelForImageTextToText, AutoProcessor
80
+ from chandra.model.hf import generate_hf
81
+ from chandra.model.schema import BatchInputItem
82
+ from chandra.output import parse_markdown
83
+ from PIL import Image
84
+ import torch
85
+
86
+ model = AutoModelForImageTextToText.from_pretrained(
87
+ "datalab-to/chandra-ocr-2",
88
+ dtype=torch.bfloat16,
89
+ device_map="auto",
90
+ )
91
+ model.eval()
92
+ model.processor = AutoProcessor.from_pretrained("datalab-to/chandra-ocr-2")
93
+ model.processor.tokenizer.padding_side = "left"
94
+
95
+ batch = [
96
+ BatchInputItem(
97
+ image=Image.open("document.png"),
98
+ prompt_type="ocr_layout"
99
+ )
100
+ ]
101
+
102
+ result = generate_hf(batch, model)[0]
103
+ markdown = parse_markdown(result.raw)
104
+ print(markdown)
105
+ ```
106
+
107
+ ## Benchmarks
108
+
109
+ ### olmOCR Benchmark
110
+
111
+ <img src="bench.png" width="600px"/>
112
+
113
+ | **Model** | ArXiv | Old Scans Math | Tables | Old Scans | Headers and Footers | Multi column | Long tiny text | Base | Overall | Source |
114
+ |:----------|:--------:|:--------------:|:--------:|:---------:|:-------------------:|:------------:|:--------------:|:----:|:--------------:|:------:|
115
+ | Datalab API | **90.4** | **90.2** | **90.7** | **54.6** | 91.6 | 83.7 | **92.3** | **99.9** | **86.7 ± 0.8** | Own benchmarks |
116
+ | Chandra 2 | 90.2 | 89.3 | 89.9 | 49.8 | 92.5 | 83.5 | 92.1 | 99.6 | 85.9 ± 0.8 | Own benchmarks |
117
+ | dots.ocr 1.5 | 85.9 | 85.5 | **90.7** | 48.2 | 94.0 | **85.3** | 81.6 | 99.7 | 83.9 | dots.ocr repo |
118
+ | Chandra 1 | 82.2 | 80.3 | 88.0 | 50.4 | 90.8 | 81.2 | **92.3** | **99.9** | 83.1 ± 0.9 | Own benchmarks |
119
+ | olmOCR 2 | 83.0 | 82.3 | 84.9 | 47.7 | **96.1** | 83.7 | 81.9 | 99.6 | 82.4 | olmocr repo |
120
+ | dots.ocr | 82.1 | 64.2 | 88.3 | 40.9 | 94.1 | 82.4 | 81.2 | 99.5 | 79.1 ± 1.0 | dots.ocr repo |
121
+ | olmOCR v0.3.0 | 78.6 | 79.9 | 72.9 | 43.9 | 95.1 | 77.3 | 81.2 | 98.9 | 78.5 ± 1.1 | olmocr repo |
122
+ | Datalab Marker v1.10.0 | 83.8 | 69.7 | 74.8 | 32.3 | 86.6 | 79.4 | 85.7 | 99.6 | 76.5 ± 1.0 | Own benchmarks |
123
+ | Deepseek OCR | 75.2 | 72.3 | 79.7 | 33.3 | **96.1** | 66.7 | 80.1 | 99.7 | 75.4 ± 1.0 | Own benchmarks |
124
+ | Mistral OCR API | 77.2 | 67.5 | 60.6 | 29.3 | 93.6 | 71.3 | 77.1 | 99.4 | 72.0 ± 1.1 | olmocr repo |
125
+ | GPT-4o (Anchored) | 53.5 | 74.5 | 70.0 | 40.7 | 93.8 | 69.3 | 60.6 | 96.8 | 69.9 ± 1.1 | olmocr repo |
126
+ | Qwen 3 VL 8B | 70.2 | 75.1 | 45.6 | 37.5 | 89.1 | 62.1 | 43.0 | 94.3 | 64.6 ± 1.1 | Own benchmarks |
127
+ | Gemini Flash 2 (Anchored) | 54.5 | 56.1 | 72.1 | 34.2 | 64.7 | 61.5 | 71.5 | 95.6 | 63.8 ± 1.2 | olmocr repo |
128
+
129
+ ## Examples
130
+
131
+ | Type | Name | Link |
132
+ |------|------|------|
133
+ | Tables | Statistical Distribution | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/tables/complex_tables.png) |
134
+ | Tables | Financial Table | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/tables/financial_table.png) |
135
+ | Forms | Registration Form | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/forms/handwritten_form.png) |
136
+ | Forms | Lease Form | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/forms/lease_filled.png) |
137
+ | Math | CS229 Textbook | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/math/cs229.png) |
138
+ | Math | Handwritten Math | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/math/handwritten_math.png) |
139
+ | Math | Chinese Math | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/math/chinese_math.png) |
140
+ | Handwriting | Cursive Writing | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/handwriting/cursive_writing.png) |
141
+ | Handwriting | Handwritten Notes | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/handwriting/handwritten_notes.png) |
142
+ | Languages | Arabic | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/languages/arabic.png) |
143
+ | Languages | Japanese | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/languages/japanese.png) |
144
+ | Languages | Hindi | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/languages/hindi.png) |
145
+ | Languages | Russian | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/languages/russian.png) |
146
+ | Other | Charts | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/other/charts.png) |
147
+ | Other | Chemistry | [View](https://github.com/datalab-to/chandra/blob/master/assets/examples/other/chemistry.png) |
148
+
149
+
150
+ ### Multilingual Benchmark (43 Languages)
151
+
152
+ The table below covers the 43 most common languages, benchmarked across multiple models. For a comprehensive evaluation across 90 languages (Chandra 2 vs Gemini 2.5 Flash only), see the [full 90-language benchmark](#full-90-language-benchmark).
153
+
154
+ <img src="multilingual.png" width="600px"/>
155
+
156
+ | Language | Datalab API | Chandra 2 | Chandra 1 | Gemini 2.5 Flash | GPT-5 Mini |
157
+ |---|:---:|:---:|:---:|:---:|:---:|
158
+ | ar | 67.6% | 68.4% | 34.0% | 84.4% | 55.6% |
159
+ | bn | 85.1% | 72.8% | 45.6% | 55.3% | 23.3% |
160
+ | ca | 88.7% | 85.1% | 84.2% | 88.0% | 78.5% |
161
+ | cs | 88.2% | 85.3% | 84.7% | 79.1% | 78.8% |
162
+ | da | 90.1% | 91.1% | 88.4% | 86.0% | 87.7% |
163
+ | de | 93.8% | 94.8% | 83.0% | 88.3% | 93.8% |
164
+ | el | 89.9% | 85.6% | 85.5% | 83.5% | 82.4% |
165
+ | es | 91.8% | 89.3% | 88.7% | 86.8% | 97.1% |
166
+ | fa | 82.2% | 75.1% | 69.6% | 61.8% | 56.4% |
167
+ | fi | 85.7% | 83.4% | 78.4% | 86.0% | 84.7% |
168
+ | fr | 93.3% | 93.7% | 89.6% | 86.1% | 91.1% |
169
+ | gu | 73.8% | 70.8% | 44.6% | 47.6% | 11.5% |
170
+ | he | 76.4% | 70.4% | 38.9% | 50.9% | 22.3% |
171
+ | hi | 80.5% | 78.4% | 70.2% | 82.7% | 41.0% |
172
+ | hr | 93.4% | 90.1% | 85.9% | 88.2% | 81.3% |
173
+ | hu | 88.1% | 82.1% | 82.5% | 84.5% | 84.8% |
174
+ | id | 91.3% | 91.6% | 86.7% | 88.3% | 89.7% |
175
+ | it | 94.4% | 94.1% | 89.1% | 85.7% | 91.6% |
176
+ | ja | 87.3% | 86.9% | 85.4% | 80.0% | 76.1% |
177
+ | jv | 87.5% | 73.2% | 85.1% | 80.4% | 69.6% |
178
+ | kn | 70.0% | 63.2% | 20.6% | 24.5% | 10.1% |
179
+ | ko | 89.1% | 81.5% | 82.3% | 84.8% | 78.4% |
180
+ | la | 78.0% | 73.8% | 55.9% | 70.5% | 54.6% |
181
+ | ml | 72.4% | 64.3% | 18.1% | 23.8% | 11.9% |
182
+ | mr | 80.8% | 75.0% | 57.0% | 69.7% | 20.9% |
183
+ | nl | 90.0% | 88.6% | 85.3% | 87.5% | 83.8% |
184
+ | no | 89.2% | 90.3% | 85.5% | 87.8% | 87.4% |
185
+ | pl | 93.8% | 91.5% | 83.9% | 89.7% | 90.4% |
186
+ | pt | 97.0% | 95.2% | 84.3% | 89.4% | 90.8% |
187
+ | ro | 86.2% | 84.5% | 82.1% | 76.1% | 77.3% |
188
+ | ru | 88.8% | 85.5% | 88.7% | 82.8% | 72.2% |
189
+ | sa | 57.5% | 51.1% | 33.6% | 44.6% | 12.5% |
190
+ | sr | 95.3% | 90.3% | 82.3% | 89.7% | 83.0% |
191
+ | sv | 91.9% | 92.8% | 82.1% | 91.1% | 92.1% |
192
+ | ta | 82.9% | 77.7% | 50.8% | 53.9% | 8.1% |
193
+ | te | 69.4% | 58.6% | 19.5% | 33.3% | 9.9% |
194
+ | th | 71.6% | 62.6% | 47.0% | 66.7% | 53.8% |
195
+ | tr | 88.9% | 84.1% | 68.1% | 84.1% | 78.2% |
196
+ | uk | 93.1% | 91.0% | 88.5% | 87.9% | 81.9% |
197
+ | ur | 54.1% | 43.2% | 28.1% | 57.6% | 16.9% |
198
+ | vi | 85.0% | 80.4% | 81.6% | 89.5% | 83.6% |
199
+ | zh | 87.8% | 88.7% | 88.3% | 70.0% | 70.4% |
200
+ | **Average** | **80.4%** | **77.8%** | **69.4%** | **67.6%** | **60.5%** |
201
+
202
+ ### Full 90-Language Benchmark
203
+
204
+ We also have a more comprehensive evaluation covering 90 languages, comparing Chandra 2 against Gemini 2.5 Flash. The average scores are lower than the 43-language table above because this includes many lower-resource languages. Chandra 2 averages **72.7%** vs Gemini 2.5 Flash at **60.8%**.
205
+
206
+ See the [full 90-language results](https://github.com/datalab-to/chandra/blob/master/FULL_BENCHMARKS.md).
207
+
208
+ ## Throughput
209
+
210
+ Benchmarked with vLLM on a single NVIDIA H100 80GB GPU using a diverse mix of documents (math, tables, scans, multi-column layouts) from the olmOCR benchmark set. This set is significantly slower than real-world usage - we estimate 2 pages/s in real-world usage.
211
+
212
+ | Configuration | Pages/sec | Avg Latency | P95 Latency | Failure Rate |
213
+ |---|:---:|:---:|:---:|:---:|
214
+ | vLLM, 96 concurrent sequences | 1.44 | 60s | 156s | 0% |
215
+
216
+ ## Commercial Usage
217
+
218
+ Code is Apache 2.0. Model weights use a modified OpenRAIL-M license: free for research, personal use, and startups under $2M funding/revenue. Cannot be used competitively with our API. For broader commercial licensing, see [pricing](https://www.datalab.to/pricing?utm_source=gh-chandra).
219
+
220
+ ## Credits
221
+
222
+ - [Huggingface Transformers](https://github.com/huggingface/transformers)
223
+ - [vLLM](https://github.com/vllm-project/vllm)
224
+ - [olmocr](https://github.com/allenai/olmocr)
225
+ - [Qwen 3.5](https://github.com/QwenLM/Qwen3)
chat_template.jinja ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {{- '<think>\n\n</think>\n\n' }}
150
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,1238 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5ForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 248056,
6
+ "model_type": "qwen3_5",
7
+ "text_config": {
8
+ "attention_bias": false,
9
+ "attention_dropout": 0.0,
10
+ "attn_output_gate": true,
11
+ "bos_token_id": null,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 248044,
14
+ "full_attention_interval": 4,
15
+ "head_dim": 256,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 2560,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 9216,
20
+ "layer_types": [
21
+ "linear_attention",
22
+ "linear_attention",
23
+ "linear_attention",
24
+ "full_attention",
25
+ "linear_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "full_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "full_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "full_attention",
37
+ "linear_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "full_attention",
41
+ "linear_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "full_attention",
45
+ "linear_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "full_attention",
49
+ "linear_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "full_attention"
53
+ ],
54
+ "linear_conv_kernel_dim": 4,
55
+ "linear_key_head_dim": 128,
56
+ "linear_num_key_heads": 16,
57
+ "linear_num_value_heads": 32,
58
+ "linear_value_head_dim": 128,
59
+ "mamba_ssm_dtype": "float32",
60
+ "max_position_embeddings": 262144,
61
+ "mlp_only_layers": [],
62
+ "model_type": "qwen3_5_text",
63
+ "mtp_num_hidden_layers": 1,
64
+ "mtp_use_dedicated_embeddings": false,
65
+ "num_attention_heads": 16,
66
+ "num_hidden_layers": 32,
67
+ "num_key_value_heads": 4,
68
+ "pad_token_id": null,
69
+ "partial_rotary_factor": 0.25,
70
+ "rms_norm_eps": 1e-06,
71
+ "rope_parameters": {
72
+ "mrope_interleaved": true,
73
+ "mrope_section": [
74
+ 11,
75
+ 11,
76
+ 10
77
+ ],
78
+ "partial_rotary_factor": 0.25,
79
+ "rope_theta": 10000000,
80
+ "type": "default"
81
+ },
82
+ "tie_word_embeddings": true,
83
+ "use_cache": true,
84
+ "vocab_size": 248320
85
+ },
86
+ "tie_word_embeddings": true,
87
+ "transformers_version": "5.2.0",
88
+ "video_token_id": 248057,
89
+ "vision_config": {
90
+ "deepstack_visual_indexes": [],
91
+ "depth": 24,
92
+ "hidden_act": "gelu_pytorch_tanh",
93
+ "hidden_size": 1024,
94
+ "in_channels": 3,
95
+ "initializer_range": 0.02,
96
+ "intermediate_size": 4096,
97
+ "model_type": "qwen3_5",
98
+ "num_heads": 16,
99
+ "num_position_embeddings": 2304,
100
+ "out_hidden_size": 2560,
101
+ "patch_size": 16,
102
+ "spatial_merge_size": 2,
103
+ "temporal_patch_size": 2
104
+ },
105
+ "vision_end_token_id": 248054,
106
+ "vision_start_token_id": 248053,
107
+ "eos_token_id": 248044,
108
+ "quantization": {
109
+ "group_size": 64,
110
+ "bits": 4,
111
+ "mode": "affine",
112
+ "language_model.model.layers.0.linear_attn.in_proj_a": {
113
+ "bits": 6,
114
+ "group_size": 64,
115
+ "mode": "affine"
116
+ },
117
+ "language_model.model.layers.0.linear_attn.in_proj_b": {
118
+ "bits": 6,
119
+ "group_size": 64,
120
+ "mode": "affine"
121
+ },
122
+ "language_model.model.layers.0.linear_attn.in_proj_qkv": {
123
+ "bits": 5,
124
+ "group_size": 64,
125
+ "mode": "affine"
126
+ },
127
+ "language_model.model.layers.0.linear_attn.in_proj_z": {
128
+ "bits": 5,
129
+ "group_size": 64,
130
+ "mode": "affine"
131
+ },
132
+ "language_model.model.layers.0.linear_attn.out_proj": {
133
+ "bits": 5,
134
+ "group_size": 64,
135
+ "mode": "affine"
136
+ },
137
+ "language_model.model.layers.0.mlp.down_proj": {
138
+ "bits": 6,
139
+ "group_size": 64,
140
+ "mode": "affine"
141
+ },
142
+ "language_model.model.layers.1.linear_attn.in_proj_a": {
143
+ "bits": 6,
144
+ "group_size": 64,
145
+ "mode": "affine"
146
+ },
147
+ "language_model.model.layers.1.linear_attn.in_proj_b": {
148
+ "bits": 6,
149
+ "group_size": 64,
150
+ "mode": "affine"
151
+ },
152
+ "language_model.model.layers.1.linear_attn.in_proj_qkv": {
153
+ "bits": 5,
154
+ "group_size": 64,
155
+ "mode": "affine"
156
+ },
157
+ "language_model.model.layers.1.linear_attn.in_proj_z": {
158
+ "bits": 5,
159
+ "group_size": 64,
160
+ "mode": "affine"
161
+ },
162
+ "language_model.model.layers.1.linear_attn.out_proj": {
163
+ "bits": 5,
164
+ "group_size": 64,
165
+ "mode": "affine"
166
+ },
167
+ "language_model.model.layers.1.mlp.down_proj": {
168
+ "bits": 6,
169
+ "group_size": 64,
170
+ "mode": "affine"
171
+ },
172
+ "language_model.model.layers.10.linear_attn.in_proj_a": {
173
+ "bits": 6,
174
+ "group_size": 64,
175
+ "mode": "affine"
176
+ },
177
+ "language_model.model.layers.10.linear_attn.in_proj_b": {
178
+ "bits": 6,
179
+ "group_size": 64,
180
+ "mode": "affine"
181
+ },
182
+ "language_model.model.layers.10.linear_attn.in_proj_z": {
183
+ "bits": 5,
184
+ "group_size": 64,
185
+ "mode": "affine"
186
+ },
187
+ "language_model.model.layers.10.linear_attn.out_proj": {
188
+ "bits": 5,
189
+ "group_size": 64,
190
+ "mode": "affine"
191
+ },
192
+ "language_model.model.layers.10.mlp.down_proj": {
193
+ "bits": 5,
194
+ "group_size": 64,
195
+ "mode": "affine"
196
+ },
197
+ "language_model.model.layers.11.mlp.down_proj": {
198
+ "bits": 5,
199
+ "group_size": 64,
200
+ "mode": "affine"
201
+ },
202
+ "language_model.model.layers.11.self_attn.o_proj": {
203
+ "bits": 5,
204
+ "group_size": 64,
205
+ "mode": "affine"
206
+ },
207
+ "language_model.model.layers.12.linear_attn.in_proj_a": {
208
+ "bits": 6,
209
+ "group_size": 64,
210
+ "mode": "affine"
211
+ },
212
+ "language_model.model.layers.12.linear_attn.in_proj_b": {
213
+ "bits": 6,
214
+ "group_size": 64,
215
+ "mode": "affine"
216
+ },
217
+ "language_model.model.layers.12.linear_attn.in_proj_z": {
218
+ "bits": 5,
219
+ "group_size": 64,
220
+ "mode": "affine"
221
+ },
222
+ "language_model.model.layers.12.linear_attn.out_proj": {
223
+ "bits": 5,
224
+ "group_size": 64,
225
+ "mode": "affine"
226
+ },
227
+ "language_model.model.layers.12.mlp.down_proj": {
228
+ "bits": 5,
229
+ "group_size": 64,
230
+ "mode": "affine"
231
+ },
232
+ "language_model.model.layers.13.linear_attn.in_proj_a": {
233
+ "bits": 6,
234
+ "group_size": 64,
235
+ "mode": "affine"
236
+ },
237
+ "language_model.model.layers.13.linear_attn.in_proj_b": {
238
+ "bits": 6,
239
+ "group_size": 64,
240
+ "mode": "affine"
241
+ },
242
+ "language_model.model.layers.13.linear_attn.in_proj_z": {
243
+ "bits": 5,
244
+ "group_size": 64,
245
+ "mode": "affine"
246
+ },
247
+ "language_model.model.layers.13.linear_attn.out_proj": {
248
+ "bits": 5,
249
+ "group_size": 64,
250
+ "mode": "affine"
251
+ },
252
+ "language_model.model.layers.13.mlp.down_proj": {
253
+ "bits": 5,
254
+ "group_size": 64,
255
+ "mode": "affine"
256
+ },
257
+ "language_model.model.layers.14.linear_attn.in_proj_a": {
258
+ "bits": 6,
259
+ "group_size": 64,
260
+ "mode": "affine"
261
+ },
262
+ "language_model.model.layers.14.linear_attn.in_proj_b": {
263
+ "bits": 6,
264
+ "group_size": 64,
265
+ "mode": "affine"
266
+ },
267
+ "language_model.model.layers.14.linear_attn.in_proj_z": {
268
+ "bits": 5,
269
+ "group_size": 64,
270
+ "mode": "affine"
271
+ },
272
+ "language_model.model.layers.14.linear_attn.out_proj": {
273
+ "bits": 5,
274
+ "group_size": 64,
275
+ "mode": "affine"
276
+ },
277
+ "language_model.model.layers.14.mlp.down_proj": {
278
+ "bits": 5,
279
+ "group_size": 64,
280
+ "mode": "affine"
281
+ },
282
+ "language_model.model.layers.15.mlp.down_proj": {
283
+ "bits": 5,
284
+ "group_size": 64,
285
+ "mode": "affine"
286
+ },
287
+ "language_model.model.layers.15.self_attn.o_proj": {
288
+ "bits": 5,
289
+ "group_size": 64,
290
+ "mode": "affine"
291
+ },
292
+ "language_model.model.layers.16.linear_attn.in_proj_a": {
293
+ "bits": 6,
294
+ "group_size": 64,
295
+ "mode": "affine"
296
+ },
297
+ "language_model.model.layers.16.linear_attn.in_proj_b": {
298
+ "bits": 5,
299
+ "group_size": 64,
300
+ "mode": "affine"
301
+ },
302
+ "language_model.model.layers.16.linear_attn.in_proj_z": {
303
+ "bits": 5,
304
+ "group_size": 64,
305
+ "mode": "affine"
306
+ },
307
+ "language_model.model.layers.16.linear_attn.out_proj": {
308
+ "bits": 5,
309
+ "group_size": 64,
310
+ "mode": "affine"
311
+ },
312
+ "language_model.model.layers.16.mlp.down_proj": {
313
+ "bits": 5,
314
+ "group_size": 64,
315
+ "mode": "affine"
316
+ },
317
+ "language_model.model.layers.17.linear_attn.in_proj_a": {
318
+ "bits": 5,
319
+ "group_size": 64,
320
+ "mode": "affine"
321
+ },
322
+ "language_model.model.layers.17.linear_attn.in_proj_b": {
323
+ "bits": 5,
324
+ "group_size": 64,
325
+ "mode": "affine"
326
+ },
327
+ "language_model.model.layers.17.linear_attn.in_proj_z": {
328
+ "bits": 5,
329
+ "group_size": 64,
330
+ "mode": "affine"
331
+ },
332
+ "language_model.model.layers.17.linear_attn.out_proj": {
333
+ "bits": 5,
334
+ "group_size": 64,
335
+ "mode": "affine"
336
+ },
337
+ "language_model.model.layers.17.mlp.down_proj": {
338
+ "bits": 5,
339
+ "group_size": 64,
340
+ "mode": "affine"
341
+ },
342
+ "language_model.model.layers.18.linear_attn.in_proj_a": {
343
+ "bits": 5,
344
+ "group_size": 64,
345
+ "mode": "affine"
346
+ },
347
+ "language_model.model.layers.18.linear_attn.in_proj_b": {
348
+ "bits": 5,
349
+ "group_size": 64,
350
+ "mode": "affine"
351
+ },
352
+ "language_model.model.layers.18.linear_attn.in_proj_z": {
353
+ "bits": 5,
354
+ "group_size": 64,
355
+ "mode": "affine"
356
+ },
357
+ "language_model.model.layers.18.linear_attn.out_proj": {
358
+ "bits": 5,
359
+ "group_size": 64,
360
+ "mode": "affine"
361
+ },
362
+ "language_model.model.layers.18.mlp.down_proj": {
363
+ "bits": 5,
364
+ "group_size": 64,
365
+ "mode": "affine"
366
+ },
367
+ "language_model.model.layers.19.mlp.down_proj": {
368
+ "bits": 5,
369
+ "group_size": 64,
370
+ "mode": "affine"
371
+ },
372
+ "language_model.model.layers.19.self_attn.o_proj": {
373
+ "bits": 5,
374
+ "group_size": 64,
375
+ "mode": "affine"
376
+ },
377
+ "language_model.model.layers.2.linear_attn.in_proj_a": {
378
+ "bits": 5,
379
+ "group_size": 64,
380
+ "mode": "affine"
381
+ },
382
+ "language_model.model.layers.2.linear_attn.in_proj_b": {
383
+ "bits": 5,
384
+ "group_size": 64,
385
+ "mode": "affine"
386
+ },
387
+ "language_model.model.layers.2.linear_attn.in_proj_qkv": {
388
+ "bits": 5,
389
+ "group_size": 64,
390
+ "mode": "affine"
391
+ },
392
+ "language_model.model.layers.2.linear_attn.in_proj_z": {
393
+ "bits": 5,
394
+ "group_size": 64,
395
+ "mode": "affine"
396
+ },
397
+ "language_model.model.layers.2.linear_attn.out_proj": {
398
+ "bits": 5,
399
+ "group_size": 64,
400
+ "mode": "affine"
401
+ },
402
+ "language_model.model.layers.2.mlp.down_proj": {
403
+ "bits": 6,
404
+ "group_size": 64,
405
+ "mode": "affine"
406
+ },
407
+ "language_model.model.layers.20.linear_attn.in_proj_a": {
408
+ "bits": 5,
409
+ "group_size": 64,
410
+ "mode": "affine"
411
+ },
412
+ "language_model.model.layers.20.linear_attn.in_proj_b": {
413
+ "bits": 5,
414
+ "group_size": 64,
415
+ "mode": "affine"
416
+ },
417
+ "language_model.model.layers.20.linear_attn.in_proj_z": {
418
+ "bits": 5,
419
+ "group_size": 64,
420
+ "mode": "affine"
421
+ },
422
+ "language_model.model.layers.20.linear_attn.out_proj": {
423
+ "bits": 5,
424
+ "group_size": 64,
425
+ "mode": "affine"
426
+ },
427
+ "language_model.model.layers.20.mlp.down_proj": {
428
+ "bits": 5,
429
+ "group_size": 64,
430
+ "mode": "affine"
431
+ },
432
+ "language_model.model.layers.21.linear_attn.in_proj_a": {
433
+ "bits": 5,
434
+ "group_size": 64,
435
+ "mode": "affine"
436
+ },
437
+ "language_model.model.layers.21.linear_attn.in_proj_b": {
438
+ "bits": 5,
439
+ "group_size": 64,
440
+ "mode": "affine"
441
+ },
442
+ "language_model.model.layers.21.linear_attn.in_proj_z": {
443
+ "bits": 5,
444
+ "group_size": 64,
445
+ "mode": "affine"
446
+ },
447
+ "language_model.model.layers.21.linear_attn.out_proj": {
448
+ "bits": 5,
449
+ "group_size": 64,
450
+ "mode": "affine"
451
+ },
452
+ "language_model.model.layers.21.mlp.down_proj": {
453
+ "bits": 5,
454
+ "group_size": 64,
455
+ "mode": "affine"
456
+ },
457
+ "language_model.model.layers.22.linear_attn.in_proj_a": {
458
+ "bits": 5,
459
+ "group_size": 64,
460
+ "mode": "affine"
461
+ },
462
+ "language_model.model.layers.22.linear_attn.in_proj_b": {
463
+ "bits": 5,
464
+ "group_size": 64,
465
+ "mode": "affine"
466
+ },
467
+ "language_model.model.layers.22.linear_attn.in_proj_z": {
468
+ "bits": 5,
469
+ "group_size": 64,
470
+ "mode": "affine"
471
+ },
472
+ "language_model.model.layers.22.linear_attn.out_proj": {
473
+ "bits": 5,
474
+ "group_size": 64,
475
+ "mode": "affine"
476
+ },
477
+ "language_model.model.layers.22.mlp.down_proj": {
478
+ "bits": 5,
479
+ "group_size": 64,
480
+ "mode": "affine"
481
+ },
482
+ "language_model.model.layers.23.mlp.down_proj": {
483
+ "bits": 5,
484
+ "group_size": 64,
485
+ "mode": "affine"
486
+ },
487
+ "language_model.model.layers.23.self_attn.o_proj": {
488
+ "bits": 5,
489
+ "group_size": 64,
490
+ "mode": "affine"
491
+ },
492
+ "language_model.model.layers.24.linear_attn.in_proj_a": {
493
+ "bits": 5,
494
+ "group_size": 64,
495
+ "mode": "affine"
496
+ },
497
+ "language_model.model.layers.24.linear_attn.in_proj_b": {
498
+ "bits": 5,
499
+ "group_size": 64,
500
+ "mode": "affine"
501
+ },
502
+ "language_model.model.layers.24.linear_attn.in_proj_z": {
503
+ "bits": 5,
504
+ "group_size": 64,
505
+ "mode": "affine"
506
+ },
507
+ "language_model.model.layers.24.linear_attn.out_proj": {
508
+ "bits": 5,
509
+ "group_size": 64,
510
+ "mode": "affine"
511
+ },
512
+ "language_model.model.layers.25.linear_attn.in_proj_a": {
513
+ "bits": 5,
514
+ "group_size": 64,
515
+ "mode": "affine"
516
+ },
517
+ "language_model.model.layers.25.linear_attn.in_proj_b": {
518
+ "bits": 5,
519
+ "group_size": 64,
520
+ "mode": "affine"
521
+ },
522
+ "language_model.model.layers.25.linear_attn.out_proj": {
523
+ "bits": 5,
524
+ "group_size": 64,
525
+ "mode": "affine"
526
+ },
527
+ "language_model.model.layers.26.linear_attn.in_proj_a": {
528
+ "bits": 5,
529
+ "group_size": 64,
530
+ "mode": "affine"
531
+ },
532
+ "language_model.model.layers.26.linear_attn.in_proj_b": {
533
+ "bits": 5,
534
+ "group_size": 64,
535
+ "mode": "affine"
536
+ },
537
+ "language_model.model.layers.26.linear_attn.out_proj": {
538
+ "bits": 5,
539
+ "group_size": 64,
540
+ "mode": "affine"
541
+ },
542
+ "language_model.model.layers.28.linear_attn.in_proj_a": {
543
+ "bits": 5,
544
+ "group_size": 64,
545
+ "mode": "affine"
546
+ },
547
+ "language_model.model.layers.28.linear_attn.in_proj_b": {
548
+ "bits": 5,
549
+ "group_size": 64,
550
+ "mode": "affine"
551
+ },
552
+ "language_model.model.layers.28.linear_attn.out_proj": {
553
+ "bits": 5,
554
+ "group_size": 64,
555
+ "mode": "affine"
556
+ },
557
+ "language_model.model.layers.29.linear_attn.in_proj_a": {
558
+ "bits": 5,
559
+ "group_size": 64,
560
+ "mode": "affine"
561
+ },
562
+ "language_model.model.layers.29.linear_attn.in_proj_b": {
563
+ "bits": 5,
564
+ "group_size": 64,
565
+ "mode": "affine"
566
+ },
567
+ "language_model.model.layers.29.linear_attn.out_proj": {
568
+ "bits": 5,
569
+ "group_size": 64,
570
+ "mode": "affine"
571
+ },
572
+ "language_model.model.layers.3.self_attn.k_proj": {
573
+ "bits": 5,
574
+ "group_size": 64,
575
+ "mode": "affine"
576
+ },
577
+ "language_model.model.layers.30.linear_attn.in_proj_a": {
578
+ "bits": 5,
579
+ "group_size": 64,
580
+ "mode": "affine"
581
+ },
582
+ "language_model.model.layers.30.linear_attn.in_proj_b": {
583
+ "bits": 5,
584
+ "group_size": 64,
585
+ "mode": "affine"
586
+ },
587
+ "language_model.model.layers.30.linear_attn.out_proj": {
588
+ "bits": 5,
589
+ "group_size": 64,
590
+ "mode": "affine"
591
+ },
592
+ "language_model.model.layers.31.self_attn.k_proj": {
593
+ "bits": 5,
594
+ "group_size": 64,
595
+ "mode": "affine"
596
+ },
597
+ "language_model.model.layers.4.linear_attn.in_proj_a": {
598
+ "bits": 5,
599
+ "group_size": 64,
600
+ "mode": "affine"
601
+ },
602
+ "language_model.model.layers.4.linear_attn.in_proj_b": {
603
+ "bits": 5,
604
+ "group_size": 64,
605
+ "mode": "affine"
606
+ },
607
+ "language_model.model.layers.4.linear_attn.out_proj": {
608
+ "bits": 5,
609
+ "group_size": 64,
610
+ "mode": "affine"
611
+ },
612
+ "language_model.model.layers.5.linear_attn.in_proj_a": {
613
+ "bits": 5,
614
+ "group_size": 64,
615
+ "mode": "affine"
616
+ },
617
+ "language_model.model.layers.5.linear_attn.in_proj_b": {
618
+ "bits": 5,
619
+ "group_size": 64,
620
+ "mode": "affine"
621
+ },
622
+ "language_model.model.layers.5.linear_attn.out_proj": {
623
+ "bits": 5,
624
+ "group_size": 64,
625
+ "mode": "affine"
626
+ },
627
+ "language_model.model.layers.6.linear_attn.in_proj_a": {
628
+ "bits": 5,
629
+ "group_size": 64,
630
+ "mode": "affine"
631
+ },
632
+ "language_model.model.layers.6.linear_attn.in_proj_b": {
633
+ "bits": 5,
634
+ "group_size": 64,
635
+ "mode": "affine"
636
+ },
637
+ "language_model.model.layers.6.linear_attn.out_proj": {
638
+ "bits": 5,
639
+ "group_size": 64,
640
+ "mode": "affine"
641
+ },
642
+ "language_model.model.layers.8.linear_attn.in_proj_a": {
643
+ "bits": 5,
644
+ "group_size": 64,
645
+ "mode": "affine"
646
+ },
647
+ "language_model.model.layers.8.linear_attn.in_proj_b": {
648
+ "bits": 5,
649
+ "group_size": 64,
650
+ "mode": "affine"
651
+ },
652
+ "language_model.model.layers.8.linear_attn.out_proj": {
653
+ "bits": 5,
654
+ "group_size": 64,
655
+ "mode": "affine"
656
+ },
657
+ "language_model.model.layers.9.linear_attn.in_proj_a": {
658
+ "bits": 5,
659
+ "group_size": 64,
660
+ "mode": "affine"
661
+ },
662
+ "language_model.model.layers.9.linear_attn.in_proj_b": {
663
+ "bits": 5,
664
+ "group_size": 64,
665
+ "mode": "affine"
666
+ },
667
+ "language_model.model.layers.9.linear_attn.out_proj": {
668
+ "bits": 5,
669
+ "group_size": 64,
670
+ "mode": "affine"
671
+ }
672
+ },
673
+ "quantization_config": {
674
+ "group_size": 64,
675
+ "bits": 4,
676
+ "mode": "affine",
677
+ "language_model.model.layers.0.linear_attn.in_proj_a": {
678
+ "bits": 6,
679
+ "group_size": 64,
680
+ "mode": "affine"
681
+ },
682
+ "language_model.model.layers.0.linear_attn.in_proj_b": {
683
+ "bits": 6,
684
+ "group_size": 64,
685
+ "mode": "affine"
686
+ },
687
+ "language_model.model.layers.0.linear_attn.in_proj_qkv": {
688
+ "bits": 5,
689
+ "group_size": 64,
690
+ "mode": "affine"
691
+ },
692
+ "language_model.model.layers.0.linear_attn.in_proj_z": {
693
+ "bits": 5,
694
+ "group_size": 64,
695
+ "mode": "affine"
696
+ },
697
+ "language_model.model.layers.0.linear_attn.out_proj": {
698
+ "bits": 5,
699
+ "group_size": 64,
700
+ "mode": "affine"
701
+ },
702
+ "language_model.model.layers.0.mlp.down_proj": {
703
+ "bits": 6,
704
+ "group_size": 64,
705
+ "mode": "affine"
706
+ },
707
+ "language_model.model.layers.1.linear_attn.in_proj_a": {
708
+ "bits": 6,
709
+ "group_size": 64,
710
+ "mode": "affine"
711
+ },
712
+ "language_model.model.layers.1.linear_attn.in_proj_b": {
713
+ "bits": 6,
714
+ "group_size": 64,
715
+ "mode": "affine"
716
+ },
717
+ "language_model.model.layers.1.linear_attn.in_proj_qkv": {
718
+ "bits": 5,
719
+ "group_size": 64,
720
+ "mode": "affine"
721
+ },
722
+ "language_model.model.layers.1.linear_attn.in_proj_z": {
723
+ "bits": 5,
724
+ "group_size": 64,
725
+ "mode": "affine"
726
+ },
727
+ "language_model.model.layers.1.linear_attn.out_proj": {
728
+ "bits": 5,
729
+ "group_size": 64,
730
+ "mode": "affine"
731
+ },
732
+ "language_model.model.layers.1.mlp.down_proj": {
733
+ "bits": 6,
734
+ "group_size": 64,
735
+ "mode": "affine"
736
+ },
737
+ "language_model.model.layers.10.linear_attn.in_proj_a": {
738
+ "bits": 6,
739
+ "group_size": 64,
740
+ "mode": "affine"
741
+ },
742
+ "language_model.model.layers.10.linear_attn.in_proj_b": {
743
+ "bits": 6,
744
+ "group_size": 64,
745
+ "mode": "affine"
746
+ },
747
+ "language_model.model.layers.10.linear_attn.in_proj_z": {
748
+ "bits": 5,
749
+ "group_size": 64,
750
+ "mode": "affine"
751
+ },
752
+ "language_model.model.layers.10.linear_attn.out_proj": {
753
+ "bits": 5,
754
+ "group_size": 64,
755
+ "mode": "affine"
756
+ },
757
+ "language_model.model.layers.10.mlp.down_proj": {
758
+ "bits": 5,
759
+ "group_size": 64,
760
+ "mode": "affine"
761
+ },
762
+ "language_model.model.layers.11.mlp.down_proj": {
763
+ "bits": 5,
764
+ "group_size": 64,
765
+ "mode": "affine"
766
+ },
767
+ "language_model.model.layers.11.self_attn.o_proj": {
768
+ "bits": 5,
769
+ "group_size": 64,
770
+ "mode": "affine"
771
+ },
772
+ "language_model.model.layers.12.linear_attn.in_proj_a": {
773
+ "bits": 6,
774
+ "group_size": 64,
775
+ "mode": "affine"
776
+ },
777
+ "language_model.model.layers.12.linear_attn.in_proj_b": {
778
+ "bits": 6,
779
+ "group_size": 64,
780
+ "mode": "affine"
781
+ },
782
+ "language_model.model.layers.12.linear_attn.in_proj_z": {
783
+ "bits": 5,
784
+ "group_size": 64,
785
+ "mode": "affine"
786
+ },
787
+ "language_model.model.layers.12.linear_attn.out_proj": {
788
+ "bits": 5,
789
+ "group_size": 64,
790
+ "mode": "affine"
791
+ },
792
+ "language_model.model.layers.12.mlp.down_proj": {
793
+ "bits": 5,
794
+ "group_size": 64,
795
+ "mode": "affine"
796
+ },
797
+ "language_model.model.layers.13.linear_attn.in_proj_a": {
798
+ "bits": 6,
799
+ "group_size": 64,
800
+ "mode": "affine"
801
+ },
802
+ "language_model.model.layers.13.linear_attn.in_proj_b": {
803
+ "bits": 6,
804
+ "group_size": 64,
805
+ "mode": "affine"
806
+ },
807
+ "language_model.model.layers.13.linear_attn.in_proj_z": {
808
+ "bits": 5,
809
+ "group_size": 64,
810
+ "mode": "affine"
811
+ },
812
+ "language_model.model.layers.13.linear_attn.out_proj": {
813
+ "bits": 5,
814
+ "group_size": 64,
815
+ "mode": "affine"
816
+ },
817
+ "language_model.model.layers.13.mlp.down_proj": {
818
+ "bits": 5,
819
+ "group_size": 64,
820
+ "mode": "affine"
821
+ },
822
+ "language_model.model.layers.14.linear_attn.in_proj_a": {
823
+ "bits": 6,
824
+ "group_size": 64,
825
+ "mode": "affine"
826
+ },
827
+ "language_model.model.layers.14.linear_attn.in_proj_b": {
828
+ "bits": 6,
829
+ "group_size": 64,
830
+ "mode": "affine"
831
+ },
832
+ "language_model.model.layers.14.linear_attn.in_proj_z": {
833
+ "bits": 5,
834
+ "group_size": 64,
835
+ "mode": "affine"
836
+ },
837
+ "language_model.model.layers.14.linear_attn.out_proj": {
838
+ "bits": 5,
839
+ "group_size": 64,
840
+ "mode": "affine"
841
+ },
842
+ "language_model.model.layers.14.mlp.down_proj": {
843
+ "bits": 5,
844
+ "group_size": 64,
845
+ "mode": "affine"
846
+ },
847
+ "language_model.model.layers.15.mlp.down_proj": {
848
+ "bits": 5,
849
+ "group_size": 64,
850
+ "mode": "affine"
851
+ },
852
+ "language_model.model.layers.15.self_attn.o_proj": {
853
+ "bits": 5,
854
+ "group_size": 64,
855
+ "mode": "affine"
856
+ },
857
+ "language_model.model.layers.16.linear_attn.in_proj_a": {
858
+ "bits": 6,
859
+ "group_size": 64,
860
+ "mode": "affine"
861
+ },
862
+ "language_model.model.layers.16.linear_attn.in_proj_b": {
863
+ "bits": 5,
864
+ "group_size": 64,
865
+ "mode": "affine"
866
+ },
867
+ "language_model.model.layers.16.linear_attn.in_proj_z": {
868
+ "bits": 5,
869
+ "group_size": 64,
870
+ "mode": "affine"
871
+ },
872
+ "language_model.model.layers.16.linear_attn.out_proj": {
873
+ "bits": 5,
874
+ "group_size": 64,
875
+ "mode": "affine"
876
+ },
877
+ "language_model.model.layers.16.mlp.down_proj": {
878
+ "bits": 5,
879
+ "group_size": 64,
880
+ "mode": "affine"
881
+ },
882
+ "language_model.model.layers.17.linear_attn.in_proj_a": {
883
+ "bits": 5,
884
+ "group_size": 64,
885
+ "mode": "affine"
886
+ },
887
+ "language_model.model.layers.17.linear_attn.in_proj_b": {
888
+ "bits": 5,
889
+ "group_size": 64,
890
+ "mode": "affine"
891
+ },
892
+ "language_model.model.layers.17.linear_attn.in_proj_z": {
893
+ "bits": 5,
894
+ "group_size": 64,
895
+ "mode": "affine"
896
+ },
897
+ "language_model.model.layers.17.linear_attn.out_proj": {
898
+ "bits": 5,
899
+ "group_size": 64,
900
+ "mode": "affine"
901
+ },
902
+ "language_model.model.layers.17.mlp.down_proj": {
903
+ "bits": 5,
904
+ "group_size": 64,
905
+ "mode": "affine"
906
+ },
907
+ "language_model.model.layers.18.linear_attn.in_proj_a": {
908
+ "bits": 5,
909
+ "group_size": 64,
910
+ "mode": "affine"
911
+ },
912
+ "language_model.model.layers.18.linear_attn.in_proj_b": {
913
+ "bits": 5,
914
+ "group_size": 64,
915
+ "mode": "affine"
916
+ },
917
+ "language_model.model.layers.18.linear_attn.in_proj_z": {
918
+ "bits": 5,
919
+ "group_size": 64,
920
+ "mode": "affine"
921
+ },
922
+ "language_model.model.layers.18.linear_attn.out_proj": {
923
+ "bits": 5,
924
+ "group_size": 64,
925
+ "mode": "affine"
926
+ },
927
+ "language_model.model.layers.18.mlp.down_proj": {
928
+ "bits": 5,
929
+ "group_size": 64,
930
+ "mode": "affine"
931
+ },
932
+ "language_model.model.layers.19.mlp.down_proj": {
933
+ "bits": 5,
934
+ "group_size": 64,
935
+ "mode": "affine"
936
+ },
937
+ "language_model.model.layers.19.self_attn.o_proj": {
938
+ "bits": 5,
939
+ "group_size": 64,
940
+ "mode": "affine"
941
+ },
942
+ "language_model.model.layers.2.linear_attn.in_proj_a": {
943
+ "bits": 5,
944
+ "group_size": 64,
945
+ "mode": "affine"
946
+ },
947
+ "language_model.model.layers.2.linear_attn.in_proj_b": {
948
+ "bits": 5,
949
+ "group_size": 64,
950
+ "mode": "affine"
951
+ },
952
+ "language_model.model.layers.2.linear_attn.in_proj_qkv": {
953
+ "bits": 5,
954
+ "group_size": 64,
955
+ "mode": "affine"
956
+ },
957
+ "language_model.model.layers.2.linear_attn.in_proj_z": {
958
+ "bits": 5,
959
+ "group_size": 64,
960
+ "mode": "affine"
961
+ },
962
+ "language_model.model.layers.2.linear_attn.out_proj": {
963
+ "bits": 5,
964
+ "group_size": 64,
965
+ "mode": "affine"
966
+ },
967
+ "language_model.model.layers.2.mlp.down_proj": {
968
+ "bits": 6,
969
+ "group_size": 64,
970
+ "mode": "affine"
971
+ },
972
+ "language_model.model.layers.20.linear_attn.in_proj_a": {
973
+ "bits": 5,
974
+ "group_size": 64,
975
+ "mode": "affine"
976
+ },
977
+ "language_model.model.layers.20.linear_attn.in_proj_b": {
978
+ "bits": 5,
979
+ "group_size": 64,
980
+ "mode": "affine"
981
+ },
982
+ "language_model.model.layers.20.linear_attn.in_proj_z": {
983
+ "bits": 5,
984
+ "group_size": 64,
985
+ "mode": "affine"
986
+ },
987
+ "language_model.model.layers.20.linear_attn.out_proj": {
988
+ "bits": 5,
989
+ "group_size": 64,
990
+ "mode": "affine"
991
+ },
992
+ "language_model.model.layers.20.mlp.down_proj": {
993
+ "bits": 5,
994
+ "group_size": 64,
995
+ "mode": "affine"
996
+ },
997
+ "language_model.model.layers.21.linear_attn.in_proj_a": {
998
+ "bits": 5,
999
+ "group_size": 64,
1000
+ "mode": "affine"
1001
+ },
1002
+ "language_model.model.layers.21.linear_attn.in_proj_b": {
1003
+ "bits": 5,
1004
+ "group_size": 64,
1005
+ "mode": "affine"
1006
+ },
1007
+ "language_model.model.layers.21.linear_attn.in_proj_z": {
1008
+ "bits": 5,
1009
+ "group_size": 64,
1010
+ "mode": "affine"
1011
+ },
1012
+ "language_model.model.layers.21.linear_attn.out_proj": {
1013
+ "bits": 5,
1014
+ "group_size": 64,
1015
+ "mode": "affine"
1016
+ },
1017
+ "language_model.model.layers.21.mlp.down_proj": {
1018
+ "bits": 5,
1019
+ "group_size": 64,
1020
+ "mode": "affine"
1021
+ },
1022
+ "language_model.model.layers.22.linear_attn.in_proj_a": {
1023
+ "bits": 5,
1024
+ "group_size": 64,
1025
+ "mode": "affine"
1026
+ },
1027
+ "language_model.model.layers.22.linear_attn.in_proj_b": {
1028
+ "bits": 5,
1029
+ "group_size": 64,
1030
+ "mode": "affine"
1031
+ },
1032
+ "language_model.model.layers.22.linear_attn.in_proj_z": {
1033
+ "bits": 5,
1034
+ "group_size": 64,
1035
+ "mode": "affine"
1036
+ },
1037
+ "language_model.model.layers.22.linear_attn.out_proj": {
1038
+ "bits": 5,
1039
+ "group_size": 64,
1040
+ "mode": "affine"
1041
+ },
1042
+ "language_model.model.layers.22.mlp.down_proj": {
1043
+ "bits": 5,
1044
+ "group_size": 64,
1045
+ "mode": "affine"
1046
+ },
1047
+ "language_model.model.layers.23.mlp.down_proj": {
1048
+ "bits": 5,
1049
+ "group_size": 64,
1050
+ "mode": "affine"
1051
+ },
1052
+ "language_model.model.layers.23.self_attn.o_proj": {
1053
+ "bits": 5,
1054
+ "group_size": 64,
1055
+ "mode": "affine"
1056
+ },
1057
+ "language_model.model.layers.24.linear_attn.in_proj_a": {
1058
+ "bits": 5,
1059
+ "group_size": 64,
1060
+ "mode": "affine"
1061
+ },
1062
+ "language_model.model.layers.24.linear_attn.in_proj_b": {
1063
+ "bits": 5,
1064
+ "group_size": 64,
1065
+ "mode": "affine"
1066
+ },
1067
+ "language_model.model.layers.24.linear_attn.in_proj_z": {
1068
+ "bits": 5,
1069
+ "group_size": 64,
1070
+ "mode": "affine"
1071
+ },
1072
+ "language_model.model.layers.24.linear_attn.out_proj": {
1073
+ "bits": 5,
1074
+ "group_size": 64,
1075
+ "mode": "affine"
1076
+ },
1077
+ "language_model.model.layers.25.linear_attn.in_proj_a": {
1078
+ "bits": 5,
1079
+ "group_size": 64,
1080
+ "mode": "affine"
1081
+ },
1082
+ "language_model.model.layers.25.linear_attn.in_proj_b": {
1083
+ "bits": 5,
1084
+ "group_size": 64,
1085
+ "mode": "affine"
1086
+ },
1087
+ "language_model.model.layers.25.linear_attn.out_proj": {
1088
+ "bits": 5,
1089
+ "group_size": 64,
1090
+ "mode": "affine"
1091
+ },
1092
+ "language_model.model.layers.26.linear_attn.in_proj_a": {
1093
+ "bits": 5,
1094
+ "group_size": 64,
1095
+ "mode": "affine"
1096
+ },
1097
+ "language_model.model.layers.26.linear_attn.in_proj_b": {
1098
+ "bits": 5,
1099
+ "group_size": 64,
1100
+ "mode": "affine"
1101
+ },
1102
+ "language_model.model.layers.26.linear_attn.out_proj": {
1103
+ "bits": 5,
1104
+ "group_size": 64,
1105
+ "mode": "affine"
1106
+ },
1107
+ "language_model.model.layers.28.linear_attn.in_proj_a": {
1108
+ "bits": 5,
1109
+ "group_size": 64,
1110
+ "mode": "affine"
1111
+ },
1112
+ "language_model.model.layers.28.linear_attn.in_proj_b": {
1113
+ "bits": 5,
1114
+ "group_size": 64,
1115
+ "mode": "affine"
1116
+ },
1117
+ "language_model.model.layers.28.linear_attn.out_proj": {
1118
+ "bits": 5,
1119
+ "group_size": 64,
1120
+ "mode": "affine"
1121
+ },
1122
+ "language_model.model.layers.29.linear_attn.in_proj_a": {
1123
+ "bits": 5,
1124
+ "group_size": 64,
1125
+ "mode": "affine"
1126
+ },
1127
+ "language_model.model.layers.29.linear_attn.in_proj_b": {
1128
+ "bits": 5,
1129
+ "group_size": 64,
1130
+ "mode": "affine"
1131
+ },
1132
+ "language_model.model.layers.29.linear_attn.out_proj": {
1133
+ "bits": 5,
1134
+ "group_size": 64,
1135
+ "mode": "affine"
1136
+ },
1137
+ "language_model.model.layers.3.self_attn.k_proj": {
1138
+ "bits": 5,
1139
+ "group_size": 64,
1140
+ "mode": "affine"
1141
+ },
1142
+ "language_model.model.layers.30.linear_attn.in_proj_a": {
1143
+ "bits": 5,
1144
+ "group_size": 64,
1145
+ "mode": "affine"
1146
+ },
1147
+ "language_model.model.layers.30.linear_attn.in_proj_b": {
1148
+ "bits": 5,
1149
+ "group_size": 64,
1150
+ "mode": "affine"
1151
+ },
1152
+ "language_model.model.layers.30.linear_attn.out_proj": {
1153
+ "bits": 5,
1154
+ "group_size": 64,
1155
+ "mode": "affine"
1156
+ },
1157
+ "language_model.model.layers.31.self_attn.k_proj": {
1158
+ "bits": 5,
1159
+ "group_size": 64,
1160
+ "mode": "affine"
1161
+ },
1162
+ "language_model.model.layers.4.linear_attn.in_proj_a": {
1163
+ "bits": 5,
1164
+ "group_size": 64,
1165
+ "mode": "affine"
1166
+ },
1167
+ "language_model.model.layers.4.linear_attn.in_proj_b": {
1168
+ "bits": 5,
1169
+ "group_size": 64,
1170
+ "mode": "affine"
1171
+ },
1172
+ "language_model.model.layers.4.linear_attn.out_proj": {
1173
+ "bits": 5,
1174
+ "group_size": 64,
1175
+ "mode": "affine"
1176
+ },
1177
+ "language_model.model.layers.5.linear_attn.in_proj_a": {
1178
+ "bits": 5,
1179
+ "group_size": 64,
1180
+ "mode": "affine"
1181
+ },
1182
+ "language_model.model.layers.5.linear_attn.in_proj_b": {
1183
+ "bits": 5,
1184
+ "group_size": 64,
1185
+ "mode": "affine"
1186
+ },
1187
+ "language_model.model.layers.5.linear_attn.out_proj": {
1188
+ "bits": 5,
1189
+ "group_size": 64,
1190
+ "mode": "affine"
1191
+ },
1192
+ "language_model.model.layers.6.linear_attn.in_proj_a": {
1193
+ "bits": 5,
1194
+ "group_size": 64,
1195
+ "mode": "affine"
1196
+ },
1197
+ "language_model.model.layers.6.linear_attn.in_proj_b": {
1198
+ "bits": 5,
1199
+ "group_size": 64,
1200
+ "mode": "affine"
1201
+ },
1202
+ "language_model.model.layers.6.linear_attn.out_proj": {
1203
+ "bits": 5,
1204
+ "group_size": 64,
1205
+ "mode": "affine"
1206
+ },
1207
+ "language_model.model.layers.8.linear_attn.in_proj_a": {
1208
+ "bits": 5,
1209
+ "group_size": 64,
1210
+ "mode": "affine"
1211
+ },
1212
+ "language_model.model.layers.8.linear_attn.in_proj_b": {
1213
+ "bits": 5,
1214
+ "group_size": 64,
1215
+ "mode": "affine"
1216
+ },
1217
+ "language_model.model.layers.8.linear_attn.out_proj": {
1218
+ "bits": 5,
1219
+ "group_size": 64,
1220
+ "mode": "affine"
1221
+ },
1222
+ "language_model.model.layers.9.linear_attn.in_proj_a": {
1223
+ "bits": 5,
1224
+ "group_size": 64,
1225
+ "mode": "affine"
1226
+ },
1227
+ "language_model.model.layers.9.linear_attn.in_proj_b": {
1228
+ "bits": 5,
1229
+ "group_size": 64,
1230
+ "mode": "affine"
1231
+ },
1232
+ "language_model.model.layers.9.linear_attn.out_proj": {
1233
+ "bits": 5,
1234
+ "group_size": 64,
1235
+ "mode": "affine"
1236
+ }
1237
+ }
1238
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 248044,
4
+ "transformers_version": "5.2.0",
5
+ "use_cache": true
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41da94d049f723cccf4dd0b6f4780b1dcd6c3eedcd3643b876908326649bd80a
3
+ size 3157476265
preprocessor_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_format": "channels_first",
3
+ "do_convert_rgb": true,
4
+ "do_normalize": true,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_processor_type": "Qwen2VLImageProcessorFast",
13
+ "image_std": [
14
+ 0.5,
15
+ 0.5,
16
+ 0.5
17
+ ],
18
+ "merge_size": 2,
19
+ "patch_size": 16,
20
+ "resample": 3,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "size": {
23
+ "longest_edge": 16777216,
24
+ "shortest_edge": 65536
25
+ },
26
+ "temporal_patch_size": 2
27
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
tokenizer_config.json ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "248044": {
5
+ "content": "<|endoftext|>",
6
+ "lstrip": false,
7
+ "normalized": false,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "248045": {
13
+ "content": "<|im_start|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "248046": {
21
+ "content": "<|im_end|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "248047": {
29
+ "content": "<|object_ref_start|>",
30
+ "lstrip": false,
31
+ "normalized": false,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "248048": {
37
+ "content": "<|object_ref_end|>",
38
+ "lstrip": false,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ },
44
+ "248049": {
45
+ "content": "<|box_start|>",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false,
50
+ "special": true
51
+ },
52
+ "248050": {
53
+ "content": "<|box_end|>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false,
58
+ "special": true
59
+ },
60
+ "248051": {
61
+ "content": "<|quad_start|>",
62
+ "lstrip": false,
63
+ "normalized": false,
64
+ "rstrip": false,
65
+ "single_word": false,
66
+ "special": true
67
+ },
68
+ "248052": {
69
+ "content": "<|quad_end|>",
70
+ "lstrip": false,
71
+ "normalized": false,
72
+ "rstrip": false,
73
+ "single_word": false,
74
+ "special": true
75
+ },
76
+ "248053": {
77
+ "content": "<|vision_start|>",
78
+ "lstrip": false,
79
+ "normalized": false,
80
+ "rstrip": false,
81
+ "single_word": false,
82
+ "special": true
83
+ },
84
+ "248054": {
85
+ "content": "<|vision_end|>",
86
+ "lstrip": false,
87
+ "normalized": false,
88
+ "rstrip": false,
89
+ "single_word": false,
90
+ "special": true
91
+ },
92
+ "248055": {
93
+ "content": "<|vision_pad|>",
94
+ "lstrip": false,
95
+ "normalized": false,
96
+ "rstrip": false,
97
+ "single_word": false,
98
+ "special": true
99
+ },
100
+ "248056": {
101
+ "content": "<|image_pad|>",
102
+ "lstrip": false,
103
+ "normalized": false,
104
+ "rstrip": false,
105
+ "single_word": false,
106
+ "special": true
107
+ },
108
+ "248057": {
109
+ "content": "<|video_pad|>",
110
+ "lstrip": false,
111
+ "normalized": false,
112
+ "rstrip": false,
113
+ "single_word": false,
114
+ "special": true
115
+ },
116
+ "248058": {
117
+ "content": "<tool_call>",
118
+ "lstrip": false,
119
+ "normalized": false,
120
+ "rstrip": false,
121
+ "single_word": false,
122
+ "special": false
123
+ },
124
+ "248059": {
125
+ "content": "</tool_call>",
126
+ "lstrip": false,
127
+ "normalized": false,
128
+ "rstrip": false,
129
+ "single_word": false,
130
+ "special": false
131
+ },
132
+ "248060": {
133
+ "content": "<|fim_prefix|>",
134
+ "lstrip": false,
135
+ "normalized": false,
136
+ "rstrip": false,
137
+ "single_word": false,
138
+ "special": false
139
+ },
140
+ "248061": {
141
+ "content": "<|fim_middle|>",
142
+ "lstrip": false,
143
+ "normalized": false,
144
+ "rstrip": false,
145
+ "single_word": false,
146
+ "special": false
147
+ },
148
+ "248062": {
149
+ "content": "<|fim_suffix|>",
150
+ "lstrip": false,
151
+ "normalized": false,
152
+ "rstrip": false,
153
+ "single_word": false,
154
+ "special": false
155
+ },
156
+ "248063": {
157
+ "content": "<|fim_pad|>",
158
+ "lstrip": false,
159
+ "normalized": false,
160
+ "rstrip": false,
161
+ "single_word": false,
162
+ "special": false
163
+ },
164
+ "248064": {
165
+ "content": "<|repo_name|>",
166
+ "lstrip": false,
167
+ "normalized": false,
168
+ "rstrip": false,
169
+ "single_word": false,
170
+ "special": false
171
+ },
172
+ "248065": {
173
+ "content": "<|file_sep|>",
174
+ "lstrip": false,
175
+ "normalized": false,
176
+ "rstrip": false,
177
+ "single_word": false,
178
+ "special": false
179
+ },
180
+ "248066": {
181
+ "content": "<tool_response>",
182
+ "lstrip": false,
183
+ "normalized": false,
184
+ "rstrip": false,
185
+ "single_word": false,
186
+ "special": false
187
+ },
188
+ "248067": {
189
+ "content": "</tool_response>",
190
+ "lstrip": false,
191
+ "normalized": false,
192
+ "rstrip": false,
193
+ "single_word": false,
194
+ "special": false
195
+ },
196
+ "248068": {
197
+ "content": "<think>",
198
+ "lstrip": false,
199
+ "normalized": false,
200
+ "rstrip": false,
201
+ "single_word": false,
202
+ "special": false
203
+ },
204
+ "248069": {
205
+ "content": "</think>",
206
+ "lstrip": false,
207
+ "normalized": false,
208
+ "rstrip": false,
209
+ "single_word": false,
210
+ "special": false
211
+ },
212
+ "248070": {
213
+ "content": "<|audio_start|>",
214
+ "lstrip": false,
215
+ "normalized": false,
216
+ "rstrip": false,
217
+ "single_word": false,
218
+ "special": true
219
+ },
220
+ "248071": {
221
+ "content": "<|audio_end|>",
222
+ "lstrip": false,
223
+ "normalized": false,
224
+ "rstrip": false,
225
+ "single_word": false,
226
+ "special": true
227
+ },
228
+ "248072": {
229
+ "content": "<tts_pad>",
230
+ "lstrip": false,
231
+ "normalized": false,
232
+ "rstrip": false,
233
+ "single_word": false,
234
+ "special": true
235
+ },
236
+ "248073": {
237
+ "content": "<tts_text_bos>",
238
+ "lstrip": false,
239
+ "normalized": false,
240
+ "rstrip": false,
241
+ "single_word": false,
242
+ "special": true
243
+ },
244
+ "248074": {
245
+ "content": "<tts_text_eod>",
246
+ "lstrip": false,
247
+ "normalized": false,
248
+ "rstrip": false,
249
+ "single_word": false,
250
+ "special": true
251
+ },
252
+ "248075": {
253
+ "content": "<tts_text_bos_single>",
254
+ "lstrip": false,
255
+ "normalized": false,
256
+ "rstrip": false,
257
+ "single_word": false,
258
+ "special": true
259
+ },
260
+ "248076": {
261
+ "content": "<|audio_pad|>",
262
+ "lstrip": false,
263
+ "normalized": false,
264
+ "rstrip": false,
265
+ "single_word": false,
266
+ "special": true
267
+ }
268
+ },
269
+ "additional_special_tokens": [
270
+ "<|im_start|>",
271
+ "<|im_end|>",
272
+ "<|object_ref_start|>",
273
+ "<|object_ref_end|>",
274
+ "<|box_start|>",
275
+ "<|box_end|>",
276
+ "<|quad_start|>",
277
+ "<|quad_end|>",
278
+ "<|vision_start|>",
279
+ "<|vision_end|>",
280
+ "<|vision_pad|>",
281
+ "<|image_pad|>",
282
+ "<|video_pad|>"
283
+ ],
284
+ "bos_token": null,
285
+ "chat_template": "{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '\\n\\n' + content }}\n {%- endif %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {{- '<|im_start|>system\\n' + content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" %}\n {%- set content = render_content(message.content, false)|trim %}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if ns.multi_step_tool %}\n {{- raise_exception('No user query found in messages.') }}\n{%- endif %}\n{%- for message in messages %}\n {%- set content = render_content(message.content, true)|trim %}\n {%- if message.role == \"system\" %}\n {%- if not loop.first %}\n {{- raise_exception('System message must be at the beginning.') }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if loop.index0 > ns.last_query_index %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\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 {%- if loop.first %}\n {%- if content|trim %}\n {{- '\\n\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- else %}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- endif %}\n {%- if tool_call.arguments is defined %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {%- endif %}\n {{- '</function>\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unexpected message role.') }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- else %}\n {{- '<think>\\n' }}\n {%- endif %}\n{%- endif %}",
286
+ "clean_up_tokenization_spaces": false,
287
+ "eos_token": "<|im_end|>",
288
+ "errors": "replace",
289
+ "model_max_length": 262144,
290
+ "pad_token": "<|endoftext|>",
291
+ "split_special_tokens": false,
292
+ "tokenizer_class": "Qwen2Tokenizer",
293
+ "unk_token": null,
294
+ "add_bos_token": false,
295
+ "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
296
+ "extra_special_tokens": {
297
+ "audio_bos_token": "<|audio_start|>",
298
+ "audio_eos_token": "<|audio_end|>",
299
+ "audio_token": "<|audio_pad|>",
300
+ "image_token": "<|image_pad|>",
301
+ "video_token": "<|video_pad|>",
302
+ "vision_bos_token": "<|vision_start|>",
303
+ "vision_eos_token": "<|vision_end|>"
304
+ }
305
+ }