yujiepan commited on
Commit
833f534
·
verified ·
1 Parent(s): ab9b8d9

Add GPU-validated Qwen3.8 Flash-Next tiny random model

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
.meta.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "Pillow": "12.2.0",
3
+ "accelerate": "1.15.0",
4
+ "av": "19.0.2",
5
+ "flashinfer-python": "0.7.2",
6
+ "huggingface_hub": "1.33.0",
7
+ "kernels": "0.17.0",
8
+ "numpy": "2.3.5",
9
+ "safetensors": "0.8.0",
10
+ "sglang": "0.5.23.dev384+g9ab74b851",
11
+ "tiny-random": "0.2.0",
12
+ "torch": "2.14.1",
13
+ "torchcodec": "0.17.0",
14
+ "transformers": "5.19.0",
15
+ "Python": "3.12.13",
16
+ "CUDA": "13.0",
17
+ "libstdc++": "13.4.0"
18
+ }
README.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ base_model:
4
+ - Qwen/Qwen3.8-Flash-Next-FP8
5
+ ---
6
+
7
+ This tiny model is intended for debugging. It is randomly initialized using the configuration adapted from [Qwen/Qwen3.8-Flash-Next-FP8](https://huggingface.co/Qwen/Qwen3.8-Flash-Next-FP8).
8
+
9
+ Structural comparison with `Qwen/Qwen3.8-Flash-Next-FP8`:
10
+
11
+ | Feature | Source | Tiny |
12
+ |---|---|---|
13
+ | Architecture / modalities | Qwen4Exp; text, image, video | Same |
14
+ | Vocabulary / tied embeddings | 248,320 / false | Same |
15
+ | Backbone layers / hidden size | 48 / 2,560 | 8 / 32 |
16
+ | Attention Q/KV heads; head dim | 24/2; 256 | 12/1; 32 |
17
+ | Attention cycle | 3 linear + 1 QSA | Same; two cycles |
18
+ | Linear key/value heads; head dim | 16/48; 128 | 4/12; 32 |
19
+ | Routed experts / top-k | 512 / 10 | 32 / 10 |
20
+ | Expert/shared intermediate size | 640 / 640 | 128 / 128 |
21
+ | Hyper-Connections / mixing rank | 4 / 320 | 4 / 4 |
22
+ | QSA heads / dimension / token budget / compression | 4 / 128 / 2,048 / 4 | Same |
23
+ | PLE layer / n-gram orders / heads per order | 2 / 2,3 / 8 | Same |
24
+ | PLE rows / embedding columns / dtype | 320,001,536 / 160 / FP8 | 9,216 / 1 / FP8 |
25
+ | PLE hash bucket base | 20,000,000 | 512; official prime layout |
26
+ | PLE convolution / serialized table shards | 4 / 128 | Same |
27
+ | MTP | 1 QSA layer; HC fusion; shared token embeddings | Same |
28
+ | Vision depth / hidden size / output size | 27 / 1,152 / 2,560 | 2 / 64 / 32 |
29
+ | Vision patch / temporal patch / merge | 16 / 2 / 2 | Same |
30
+
31
+ PLE retains the source n-gram orders, head count, hash/prime-layout algorithm,
32
+ projections and convolution with reduced auxiliary hash capacity. The main token
33
+ vocabulary and IDs are unchanged.
34
+ The two untied BF16 token embedding/head matrices at width 32 alone occupy
35
+ 31,784,960 bytes, exceeding the 30 MB target. This native block-FP8 backend
36
+ requires width 32; the complete checkpoint is 37,655,018 bytes. Routed experts
37
+ retain FP8 with 32x32 blocks and BF16 scales; PLE retains FP8 and one BF16 scale.
38
+ Tokenizer and processor assets are copied unchanged from the pinned source.
39
+
40
+ | File path | Size |
41
+ |------|------|
42
+ | model.safetensors | 37.7MB |
43
+
44
+
45
+ ### Example usage:
46
+
47
+ - SGLang
48
+
49
+ - Run on both two-GPU nodes with NODE_RANK set to 0 or 1, the same
50
+ DIST_INIT_ADDR, and an available local NCCL_PORT. Enables TP=4, NEXTN/MTP
51
+ and CUDA Graph.
52
+ - Verified on four NVIDIA H20 GPUs across two nodes for text, QSA long
53
+ prompts, image-plus-text and video-plus-text; see Test environment.
54
+
55
+ ```bash
56
+ model_id=tiny-random/qwen3.8-flash-next-fp8
57
+ node_rank=${NODE_RANK:-0}
58
+ dist_init_addr=${DIST_INIT_ADDR}
59
+ nccl_port=${NCCL_PORT}
60
+ sglang serve \
61
+ --model-path $model_id \
62
+ --tp-size 4 \
63
+ --nnodes 2 \
64
+ --node-rank $node_rank \
65
+ --dist-init-addr $dist_init_addr \
66
+ --nccl-port $nccl_port \
67
+ --fp8-gemm-backend triton \
68
+ --moe-runner-backend triton \
69
+ --speculative-algorithm NEXTN \
70
+ --speculative-num-steps 3 \
71
+ --speculative-eagle-topk 1 \
72
+ --speculative-num-draft-tokens 4 \
73
+ --context-length 4096 \
74
+ --max-total-tokens 4096 \
75
+ --chunked-prefill-size 512 \
76
+ --mem-fraction-static 0.4 \
77
+ --cuda-graph-config '{"decode": {"bs": [1, 2, 4, 8]}}' \
78
+ --disable-custom-all-reduce
79
+ ```
80
+
81
+ - Transformers
82
+
83
+ ```python
84
+ import torch
85
+ from PIL import Image
86
+ from transformers import AutoProcessor, Qwen4ExpForConditionalGeneration
87
+
88
+ model_id = "tiny-random/qwen3.8-flash-next-fp8"
89
+ model = Qwen4ExpForConditionalGeneration.from_pretrained(
90
+ model_id, dtype=torch.bfloat16, device_map="cuda", attn_implementation="sdpa",
91
+ )
92
+ processor = AutoProcessor.from_pretrained(model_id)
93
+ messages = [{"role": "user", "content": [
94
+ {"type": "image", "image": Image.new("RGB", (64, 64), (220, 30, 30))},
95
+ {"type": "text", "text": "Describe this image."},
96
+ ]}]
97
+ inputs = processor.apply_chat_template(
98
+ messages, tokenize=True, add_generation_prompt=True, return_dict=True, return_tensors="pt",
99
+ ).to(model.device)
100
+ output = model.generate(**inputs, do_sample=False, max_new_tokens=10)
101
+ print(processor.decode(output[0, inputs['input_ids'].shape[1]:], skip_special_tokens=True))
102
+ ```
103
+
104
+ ### Codes to create this repo:
105
+
106
+ <details><summary>Click to expand</summary>
107
+
108
+ ```python
109
+ import json
110
+ from pathlib import Path
111
+
112
+ import torch
113
+ from huggingface_hub import hf_hub_download
114
+ from transformers import AutoConfig, AutoModelForImageTextToText, set_seed
115
+ # Creation helpers: pip install git+https://github.com/yujiepan/tiny-random.git
116
+ from tiny_random.qwen_utils import add_qwen4_mtp, copy_qwen_source_assets, save_random_qwen_checkpoint
117
+
118
+ source_model_id = "Qwen/Qwen3.8-Flash-Next-FP8"
119
+ save_folder = "/tmp/tiny-random/qwen38-flash-next-fp8"
120
+ source_revision = '236dfdf285828023ca3bcd3f37366c58a3469b13'
121
+ set_seed(42)
122
+ folder = Path(save_folder)
123
+ folder.mkdir(parents=True, exist_ok=True)
124
+ raw = json.loads(Path(hf_hub_download(source_model_id, 'config.json', revision=source_revision)).read_text())
125
+ quantization = raw.pop('quantization_config')
126
+ quantization['weight_block_size'] = [32, 32]
127
+ raw['text_config'].update(
128
+ hidden_size=32, ple_embed_dim=16, ngram_vocab_size_base=512, hc_lowrank=4, num_hidden_layers=8,
129
+ layer_types=(["linear_attention"] * 3 + ["full_attention"]) * 2,
130
+ num_attention_heads=12, num_key_value_heads=1, head_dim=32,
131
+ linear_num_key_heads=4, linear_num_value_heads=12,
132
+ linear_key_head_dim=32, linear_value_head_dim=32,
133
+ num_experts=32, moe_intermediate_size=128, shared_expert_intermediate_size=128,
134
+ )
135
+ raw['text_config']['rope_parameters']['mrope_section'] = [2, 1, 1]
136
+ raw['vision_config'].update(depth=2, hidden_size=64, intermediate_size=128, num_heads=4, out_hidden_size=32)
137
+ (folder / 'config.json').write_text(json.dumps(raw, indent=2))
138
+ config = AutoConfig.from_pretrained(folder)
139
+ model = AutoModelForImageTextToText.from_config(config, dtype=torch.bfloat16)
140
+ add_qwen4_mtp(model, model.model.language_model)
141
+ save_random_qwen_checkpoint(model, folder, quantization)
142
+ raw['quantization_config'] = quantization
143
+ (folder / 'config.json').write_text(json.dumps(raw, indent=2))
144
+ copy_qwen_source_assets(source_model_id, source_revision, folder)
145
+ ```
146
+
147
+ </details>
148
+
149
+ ### Printing the model:
150
+
151
+ <details><summary>Click to expand</summary>
152
+
153
+ ```text
154
+ Qwen3.8 Flash-Next: 8 backbone layers + 1 HC-aware MTP layer; hidden_size=32
155
+ ```
156
+
157
+ </details>
158
+
159
+ ### Test environment:
160
+
161
+ - Pillow: 12.2.0
162
+ - accelerate: 1.15.0
163
+ - av: 19.0.2
164
+ - flashinfer-python: 0.7.2
165
+ - huggingface_hub: 1.33.0
166
+ - kernels: 0.17.0
167
+ - numpy: 2.3.5
168
+ - safetensors: 0.8.0
169
+ - sglang: 0.5.23.dev384+g9ab74b851
170
+ - tiny-random: 0.2.0
171
+ - torch: 2.14.1
172
+ - torchcodec: 0.17.0
173
+ - transformers: 5.19.0
174
+ - Python: 3.12.13
175
+ - CUDA: 13.0
176
+ - libstdc++: 13.4.0
177
+
178
+ ### Change log:
179
+
180
+ - 2026-10-23: Initial version.
181
+
182
+ This repo is generated by GPT-6.1-Sol
chat_template.jinja ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ {%- set reasoning_instructions = '' %}
46
+ {%- if enable_thinking is undefined or enable_thinking is true %}
47
+ {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}
48
+ {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}
49
+ {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}
50
+ {%- endif %}
51
+ {%- if resolved_reasoning_effort == 'xhigh' %}
52
+ {%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
53
+ {%- elif resolved_reasoning_effort == 'low' %}
54
+ {%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
55
+ {%- endif %}
56
+ {%- endif %}
57
+ {%- if tools and tools is iterable and tools is not mapping %}
58
+ {{- '<|im_start|>system\n' }}
59
+ {%- if reasoning_instructions %}
60
+ {{- reasoning_instructions + '\n\n' }}
61
+ {%- endif %}
62
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
63
+ {%- for tool in tools %}
64
+ {{- "\n" }}
65
+ {{- tool | tojson }}
66
+ {%- endfor %}
67
+ {{- "\n</tools>" }}
68
+ {{- '\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>' }}
69
+ {%- if messages[0].role == 'system' %}
70
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
71
+ {%- if content %}
72
+ {{- '\n\n' + content }}
73
+ {%- endif %}
74
+ {%- endif %}
75
+ {{- '<|im_end|>\n' }}
76
+ {%- else %}
77
+ {%- if messages[0].role == 'system' %}
78
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
79
+ {%- if content %}
80
+ {{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' }}
81
+ {%- elif reasoning_instructions %}
82
+ {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
83
+ {%- endif %}
84
+ {%- elif reasoning_instructions %}
85
+ {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
86
+ {%- endif %}
87
+ {%- endif %}
88
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
89
+ {%- for message in messages[::-1] %}
90
+ {%- set index = (messages|length - 1) - loop.index0 %}
91
+ {%- if ns.multi_step_tool and message.role == "user" %}
92
+ {%- set content = render_content(message.content, false)|trim %}
93
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
94
+ {%- set ns.multi_step_tool = false %}
95
+ {%- set ns.last_query_index = index %}
96
+ {%- endif %}
97
+ {%- endif %}
98
+ {%- endfor %}
99
+ {%- if ns.multi_step_tool %}
100
+ {{- raise_exception('No user query found in messages.') }}
101
+ {%- endif %}
102
+ {%- for message in messages %}
103
+ {%- set content = render_content(message.content, true)|trim %}
104
+ {%- if message.role == "system" %}
105
+ {%- if not loop.first %}
106
+ {{- raise_exception('System message must be at the beginning.') }}
107
+ {%- endif %}
108
+ {%- elif message.role == "user" %}
109
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
110
+ {%- elif message.role == "assistant" %}
111
+ {%- set reasoning_content = '' %}
112
+ {%- if message.reasoning_content is string %}
113
+ {%- set reasoning_content = message.reasoning_content %}
114
+ {%- endif %}
115
+ {%- set reasoning_content = reasoning_content|trim %}
116
+ {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index %}
117
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
118
+ {%- else %}
119
+ {{- '<|im_start|>' + message.role + '\n' + content }}
120
+ {%- endif %}
121
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
122
+ {%- for tool_call in message.tool_calls %}
123
+ {%- if tool_call.function is defined %}
124
+ {%- set tool_call = tool_call.function %}
125
+ {%- endif %}
126
+ {%- if loop.first %}
127
+ {%- if content|trim %}
128
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
129
+ {%- else %}
130
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
131
+ {%- endif %}
132
+ {%- else %}
133
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
134
+ {%- endif %}
135
+ {%- if tool_call.arguments is defined and tool_call.arguments != '' %}
136
+ {%- for args_name, args_value in tool_call.arguments|items %}
137
+ {{- '<parameter=' + args_name + '>\n' }}
138
+ {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
139
+ {{- args_value }}
140
+ {{- '\n</parameter>\n' }}
141
+ {%- endfor %}
142
+ {%- endif %}
143
+ {{- '</function>\n</tool_call>' }}
144
+ {%- endfor %}
145
+ {%- endif %}
146
+ {{- '<|im_end|>\n' }}
147
+ {%- elif message.role == "tool" %}
148
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
149
+ {{- '<|im_start|>user' }}
150
+ {%- endif %}
151
+ {{- '\n<tool_response>\n' }}
152
+ {{- content }}
153
+ {{- '\n</tool_response>' }}
154
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
155
+ {{- '<|im_end|>\n' }}
156
+ {%- elif loop.last %}
157
+ {{- '<|im_end|>\n' }}
158
+ {%- endif %}
159
+ {%- else %}
160
+ {{- raise_exception('Unexpected message role.') }}
161
+ {%- endif %}
162
+ {%- endfor %}
163
+ {%- if add_generation_prompt %}
164
+ {{- '<|im_start|>assistant\n' }}
165
+ {%- if enable_thinking is defined and enable_thinking is false %}
166
+ {{- '<think>\n\n</think>\n\n' }}
167
+ {%- else %}
168
+ {{- '<think>\n' }}
169
+ {%- endif %}
170
+ {%- endif %}
config.json ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen4ExpForConditionalGeneration"
4
+ ],
5
+ "image_token_id": 248056,
6
+ "language_model_only": false,
7
+ "model_type": "qwen4_exp",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "bos_token_id": 248044,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 248044,
14
+ "full_attention_interval": 4,
15
+ "hc_count": 4,
16
+ "hc_lowrank": 4,
17
+ "head_dim": 32,
18
+ "heads_per_ngram": 8,
19
+ "hidden_act": "silu",
20
+ "hidden_size": 32,
21
+ "indexer_budget": 2048,
22
+ "indexer_compress_ratio": 4,
23
+ "indexer_head_dim": 128,
24
+ "indexer_kv_heads": 1,
25
+ "indexer_n_heads": 4,
26
+ "initializer_range": 0.02,
27
+ "layer_types": [
28
+ "linear_attention",
29
+ "linear_attention",
30
+ "linear_attention",
31
+ "full_attention",
32
+ "linear_attention",
33
+ "linear_attention",
34
+ "linear_attention",
35
+ "full_attention"
36
+ ],
37
+ "linear_conv_kernel_dim": 4,
38
+ "linear_key_head_dim": 32,
39
+ "linear_num_key_heads": 4,
40
+ "linear_num_value_heads": 12,
41
+ "linear_value_head_dim": 32,
42
+ "make_ngram_vocab_size_divisible_by": 128,
43
+ "mamba_ssm_dtype": "float32",
44
+ "max_position_embeddings": 262144,
45
+ "model_type": "qwen4_exp_text",
46
+ "moe_intermediate_size": 128,
47
+ "mtp": {
48
+ "hybrid": true,
49
+ "layer_types": [
50
+ "full_attention"
51
+ ],
52
+ "mtp_use_hidden_state_from_layer": null,
53
+ "num_hidden_layers": 1,
54
+ "rope_theta": 10000000
55
+ },
56
+ "mtp_num_hidden_layers": 1,
57
+ "mtp_use_dedicated_embeddings": false,
58
+ "ngram_size": 3,
59
+ "ngram_vocab_size_base": 512,
60
+ "num_attention_heads": 12,
61
+ "num_experts": 32,
62
+ "num_experts_per_tok": 10,
63
+ "num_hidden_layers": 8,
64
+ "num_key_value_heads": 1,
65
+ "output_gate_type": "sigmoid",
66
+ "output_router_logits": false,
67
+ "pad_token_id": null,
68
+ "partial_rotary_factor": 0.25,
69
+ "ple_conv_kernel_size": 4,
70
+ "ple_embed_dim": 16,
71
+ "ple_layer_ids": [
72
+ 2
73
+ ],
74
+ "rms_norm_eps": 1e-06,
75
+ "rope_parameters": {
76
+ "mrope_interleaved": true,
77
+ "mrope_section": [
78
+ 2,
79
+ 1,
80
+ 1
81
+ ],
82
+ "partial_rotary_factor": 0.25,
83
+ "rope_theta": 10000000,
84
+ "rope_type": "default"
85
+ },
86
+ "router_aux_loss_coef": 0.001,
87
+ "shared_expert_intermediate_size": 128,
88
+ "split_ngram_parts": 128,
89
+ "tie_word_embeddings": false,
90
+ "use_cache": true,
91
+ "vocab_size": 248320
92
+ },
93
+ "tie_word_embeddings": false,
94
+ "transformers_version": "5.8.0.dev0",
95
+ "video_token_id": 248057,
96
+ "vision_config": {
97
+ "deepstack_visual_indexes": [],
98
+ "depth": 2,
99
+ "hidden_act": "gelu_pytorch_tanh",
100
+ "hidden_size": 64,
101
+ "in_channels": 3,
102
+ "initializer_range": 0.02,
103
+ "intermediate_size": 128,
104
+ "model_type": "qwen4_exp",
105
+ "num_heads": 4,
106
+ "num_position_embeddings": 2304,
107
+ "out_hidden_size": 32,
108
+ "patch_size": 16,
109
+ "spatial_merge_size": 2,
110
+ "temporal_patch_size": 2
111
+ },
112
+ "vision_end_token_id": 248054,
113
+ "vision_start_token_id": 248053,
114
+ "quantization_config": {
115
+ "quant_method": "fp8",
116
+ "activation_scheme": "dynamic",
117
+ "weight_per_tensor": false,
118
+ "act_per_tensor": false,
119
+ "weight_block_size": [
120
+ 32,
121
+ 32
122
+ ],
123
+ "modules_to_not_convert": [
124
+ "lm_head",
125
+ "model.language_model.embed_tokens",
126
+ "model.language_model.hyper_connection_mixer.input_mix_weight_down",
127
+ "model.language_model.hyper_connection_mixer.input_mix_weight_up",
128
+ "model.language_model.layers.0.attn_hyper_connection.block_inject_weight",
129
+ "model.language_model.layers.0.attn_hyper_connection.input_mix_weight_down",
130
+ "model.language_model.layers.0.attn_hyper_connection.input_mix_weight_up",
131
+ "model.language_model.layers.0.linear_attn.conv1d",
132
+ "model.language_model.layers.0.linear_attn.in_proj_a",
133
+ "model.language_model.layers.0.linear_attn.in_proj_b",
134
+ "model.language_model.layers.0.linear_attn.in_proj_qkv",
135
+ "model.language_model.layers.0.linear_attn.in_proj_z",
136
+ "model.language_model.layers.0.linear_attn.out_proj",
137
+ "model.language_model.layers.0.mlp.gate",
138
+ "model.language_model.layers.0.mlp.shared_expert.down_proj",
139
+ "model.language_model.layers.0.mlp.shared_expert.gate_proj",
140
+ "model.language_model.layers.0.mlp.shared_expert.up_proj",
141
+ "model.language_model.layers.0.mlp.shared_expert_gate",
142
+ "model.language_model.layers.0.mlp_hyper_connection.block_inject_weight",
143
+ "model.language_model.layers.0.mlp_hyper_connection.input_mix_weight_down",
144
+ "model.language_model.layers.0.mlp_hyper_connection.input_mix_weight_up",
145
+ "model.language_model.layers.1.attn_hyper_connection.block_inject_weight",
146
+ "model.language_model.layers.1.attn_hyper_connection.input_mix_weight_down",
147
+ "model.language_model.layers.1.attn_hyper_connection.input_mix_weight_up",
148
+ "model.language_model.layers.1.linear_attn.conv1d",
149
+ "model.language_model.layers.1.linear_attn.in_proj_a",
150
+ "model.language_model.layers.1.linear_attn.in_proj_b",
151
+ "model.language_model.layers.1.linear_attn.in_proj_qkv",
152
+ "model.language_model.layers.1.linear_attn.in_proj_z",
153
+ "model.language_model.layers.1.linear_attn.out_proj",
154
+ "model.language_model.layers.1.mlp.gate",
155
+ "model.language_model.layers.1.mlp.shared_expert.down_proj",
156
+ "model.language_model.layers.1.mlp.shared_expert.gate_proj",
157
+ "model.language_model.layers.1.mlp.shared_expert.up_proj",
158
+ "model.language_model.layers.1.mlp.shared_expert_gate",
159
+ "model.language_model.layers.1.mlp_hyper_connection.block_inject_weight",
160
+ "model.language_model.layers.1.mlp_hyper_connection.input_mix_weight_down",
161
+ "model.language_model.layers.1.mlp_hyper_connection.input_mix_weight_up",
162
+ "model.language_model.layers.1.ple.conv1d",
163
+ "model.language_model.layers.1.ple.key_proj",
164
+ "model.language_model.layers.1.ple.value_proj",
165
+ "model.language_model.layers.2.attn_hyper_connection.block_inject_weight",
166
+ "model.language_model.layers.2.attn_hyper_connection.input_mix_weight_down",
167
+ "model.language_model.layers.2.attn_hyper_connection.input_mix_weight_up",
168
+ "model.language_model.layers.2.linear_attn.conv1d",
169
+ "model.language_model.layers.2.linear_attn.in_proj_a",
170
+ "model.language_model.layers.2.linear_attn.in_proj_b",
171
+ "model.language_model.layers.2.linear_attn.in_proj_qkv",
172
+ "model.language_model.layers.2.linear_attn.in_proj_z",
173
+ "model.language_model.layers.2.linear_attn.out_proj",
174
+ "model.language_model.layers.2.mlp.gate",
175
+ "model.language_model.layers.2.mlp.shared_expert.down_proj",
176
+ "model.language_model.layers.2.mlp.shared_expert.gate_proj",
177
+ "model.language_model.layers.2.mlp.shared_expert.up_proj",
178
+ "model.language_model.layers.2.mlp.shared_expert_gate",
179
+ "model.language_model.layers.2.mlp_hyper_connection.block_inject_weight",
180
+ "model.language_model.layers.2.mlp_hyper_connection.input_mix_weight_down",
181
+ "model.language_model.layers.2.mlp_hyper_connection.input_mix_weight_up",
182
+ "model.language_model.layers.3.attn_hyper_connection.block_inject_weight",
183
+ "model.language_model.layers.3.attn_hyper_connection.input_mix_weight_down",
184
+ "model.language_model.layers.3.attn_hyper_connection.input_mix_weight_up",
185
+ "model.language_model.layers.3.mlp.gate",
186
+ "model.language_model.layers.3.mlp.shared_expert.down_proj",
187
+ "model.language_model.layers.3.mlp.shared_expert.gate_proj",
188
+ "model.language_model.layers.3.mlp.shared_expert.up_proj",
189
+ "model.language_model.layers.3.mlp.shared_expert_gate",
190
+ "model.language_model.layers.3.mlp_hyper_connection.block_inject_weight",
191
+ "model.language_model.layers.3.mlp_hyper_connection.input_mix_weight_down",
192
+ "model.language_model.layers.3.mlp_hyper_connection.input_mix_weight_up",
193
+ "model.language_model.layers.3.self_attn.indexer.index_qk_proj",
194
+ "model.language_model.layers.3.self_attn.k_proj",
195
+ "model.language_model.layers.3.self_attn.o_proj",
196
+ "model.language_model.layers.3.self_attn.q_proj",
197
+ "model.language_model.layers.3.self_attn.v_proj",
198
+ "model.language_model.layers.4.attn_hyper_connection.block_inject_weight",
199
+ "model.language_model.layers.4.attn_hyper_connection.input_mix_weight_down",
200
+ "model.language_model.layers.4.attn_hyper_connection.input_mix_weight_up",
201
+ "model.language_model.layers.4.linear_attn.conv1d",
202
+ "model.language_model.layers.4.linear_attn.in_proj_a",
203
+ "model.language_model.layers.4.linear_attn.in_proj_b",
204
+ "model.language_model.layers.4.linear_attn.in_proj_qkv",
205
+ "model.language_model.layers.4.linear_attn.in_proj_z",
206
+ "model.language_model.layers.4.linear_attn.out_proj",
207
+ "model.language_model.layers.4.mlp.gate",
208
+ "model.language_model.layers.4.mlp.shared_expert.down_proj",
209
+ "model.language_model.layers.4.mlp.shared_expert.gate_proj",
210
+ "model.language_model.layers.4.mlp.shared_expert.up_proj",
211
+ "model.language_model.layers.4.mlp.shared_expert_gate",
212
+ "model.language_model.layers.4.mlp_hyper_connection.block_inject_weight",
213
+ "model.language_model.layers.4.mlp_hyper_connection.input_mix_weight_down",
214
+ "model.language_model.layers.4.mlp_hyper_connection.input_mix_weight_up",
215
+ "model.language_model.layers.5.attn_hyper_connection.block_inject_weight",
216
+ "model.language_model.layers.5.attn_hyper_connection.input_mix_weight_down",
217
+ "model.language_model.layers.5.attn_hyper_connection.input_mix_weight_up",
218
+ "model.language_model.layers.5.linear_attn.conv1d",
219
+ "model.language_model.layers.5.linear_attn.in_proj_a",
220
+ "model.language_model.layers.5.linear_attn.in_proj_b",
221
+ "model.language_model.layers.5.linear_attn.in_proj_qkv",
222
+ "model.language_model.layers.5.linear_attn.in_proj_z",
223
+ "model.language_model.layers.5.linear_attn.out_proj",
224
+ "model.language_model.layers.5.mlp.gate",
225
+ "model.language_model.layers.5.mlp.shared_expert.down_proj",
226
+ "model.language_model.layers.5.mlp.shared_expert.gate_proj",
227
+ "model.language_model.layers.5.mlp.shared_expert.up_proj",
228
+ "model.language_model.layers.5.mlp.shared_expert_gate",
229
+ "model.language_model.layers.5.mlp_hyper_connection.block_inject_weight",
230
+ "model.language_model.layers.5.mlp_hyper_connection.input_mix_weight_down",
231
+ "model.language_model.layers.5.mlp_hyper_connection.input_mix_weight_up",
232
+ "model.language_model.layers.6.attn_hyper_connection.block_inject_weight",
233
+ "model.language_model.layers.6.attn_hyper_connection.input_mix_weight_down",
234
+ "model.language_model.layers.6.attn_hyper_connection.input_mix_weight_up",
235
+ "model.language_model.layers.6.linear_attn.conv1d",
236
+ "model.language_model.layers.6.linear_attn.in_proj_a",
237
+ "model.language_model.layers.6.linear_attn.in_proj_b",
238
+ "model.language_model.layers.6.linear_attn.in_proj_qkv",
239
+ "model.language_model.layers.6.linear_attn.in_proj_z",
240
+ "model.language_model.layers.6.linear_attn.out_proj",
241
+ "model.language_model.layers.6.mlp.gate",
242
+ "model.language_model.layers.6.mlp.shared_expert.down_proj",
243
+ "model.language_model.layers.6.mlp.shared_expert.gate_proj",
244
+ "model.language_model.layers.6.mlp.shared_expert.up_proj",
245
+ "model.language_model.layers.6.mlp.shared_expert_gate",
246
+ "model.language_model.layers.6.mlp_hyper_connection.block_inject_weight",
247
+ "model.language_model.layers.6.mlp_hyper_connection.input_mix_weight_down",
248
+ "model.language_model.layers.6.mlp_hyper_connection.input_mix_weight_up",
249
+ "model.language_model.layers.7.attn_hyper_connection.block_inject_weight",
250
+ "model.language_model.layers.7.attn_hyper_connection.input_mix_weight_down",
251
+ "model.language_model.layers.7.attn_hyper_connection.input_mix_weight_up",
252
+ "model.language_model.layers.7.mlp.gate",
253
+ "model.language_model.layers.7.mlp.shared_expert.down_proj",
254
+ "model.language_model.layers.7.mlp.shared_expert.gate_proj",
255
+ "model.language_model.layers.7.mlp.shared_expert.up_proj",
256
+ "model.language_model.layers.7.mlp.shared_expert_gate",
257
+ "model.language_model.layers.7.mlp_hyper_connection.block_inject_weight",
258
+ "model.language_model.layers.7.mlp_hyper_connection.input_mix_weight_down",
259
+ "model.language_model.layers.7.mlp_hyper_connection.input_mix_weight_up",
260
+ "model.language_model.layers.7.self_attn.indexer.index_qk_proj",
261
+ "model.language_model.layers.7.self_attn.k_proj",
262
+ "model.language_model.layers.7.self_attn.o_proj",
263
+ "model.language_model.layers.7.self_attn.q_proj",
264
+ "model.language_model.layers.7.self_attn.v_proj",
265
+ "model.visual.blocks.0.attn.proj",
266
+ "model.visual.blocks.0.attn.qkv",
267
+ "model.visual.blocks.0.mlp.linear_fc1",
268
+ "model.visual.blocks.0.mlp.linear_fc2",
269
+ "model.visual.blocks.1.attn.proj",
270
+ "model.visual.blocks.1.attn.qkv",
271
+ "model.visual.blocks.1.mlp.linear_fc1",
272
+ "model.visual.blocks.1.mlp.linear_fc2",
273
+ "model.visual.merger.linear_fc1",
274
+ "model.visual.merger.linear_fc2",
275
+ "model.visual.patch_embed.proj",
276
+ "model.visual.pos_embed",
277
+ "mtp.fc_embedding",
278
+ "mtp.fc_hidden",
279
+ "mtp.hyper_connection_mixer.input_mix_weight_down",
280
+ "mtp.hyper_connection_mixer.input_mix_weight_up",
281
+ "mtp.layers.0.attn_hyper_connection.block_inject_weight",
282
+ "mtp.layers.0.attn_hyper_connection.input_mix_weight_down",
283
+ "mtp.layers.0.attn_hyper_connection.input_mix_weight_up",
284
+ "mtp.layers.0.mlp.gate",
285
+ "mtp.layers.0.mlp.shared_expert.down_proj",
286
+ "mtp.layers.0.mlp.shared_expert.gate_proj",
287
+ "mtp.layers.0.mlp.shared_expert.up_proj",
288
+ "mtp.layers.0.mlp.shared_expert_gate",
289
+ "mtp.layers.0.mlp_hyper_connection.block_inject_weight",
290
+ "mtp.layers.0.mlp_hyper_connection.input_mix_weight_down",
291
+ "mtp.layers.0.mlp_hyper_connection.input_mix_weight_up",
292
+ "mtp.layers.0.self_attn.indexer.index_qk_proj",
293
+ "mtp.layers.0.self_attn.k_proj",
294
+ "mtp.layers.0.self_attn.o_proj",
295
+ "mtp.layers.0.self_attn.q_proj",
296
+ "mtp.layers.0.self_attn.v_proj"
297
+ ],
298
+ "modules_to_convert": [
299
+ "ple.ple_embedding.ngram_embedding"
300
+ ]
301
+ }
302
+ }
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 248044,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 248046,
6
+ 248044
7
+ ],
8
+ "pad_token_id": 248044,
9
+ "temperature": 1.0,
10
+ "top_k": 20,
11
+ "top_p": 0.95
12
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1be8d3a864c25cdf7c6dc7cdca2f45b34f20e52a6fd316be66a09b9d5bba620b
3
+ size 37655018
preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 16777216,
4
+ "shortest_edge": 65536
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "image_processor_type": "Qwen2VLImageProcessorFast"
21
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0997f410c57a1f4e53b09e4be8f4a172d90edd9564368fb0847030937229b9f3
3
+ size 12809320
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{%- set reasoning_instructions = '' %}\n{%- if enable_thinking is undefined or enable_thinking is true %}\n {%- set resolved_reasoning_effort = reasoning_effort|default('xhigh') %}\n {%- if resolved_reasoning_effort not in ('xhigh', 'medium', 'low') %}\n {{- raise_exception('Unexpected reasoning effort ' ~ reasoning_effort ~ '. Supported types are xhigh (default), medium, and low.') }}\n {%- endif %}\n {%- if resolved_reasoning_effort == 'xhigh' %}\n {%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}\n {%- elif resolved_reasoning_effort == 'low' %}\n {%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}\n {%- endif %}\n{%- endif %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {%- if reasoning_instructions %}\n {{- reasoning_instructions + '\\n\\n' }}\n {%- endif %}\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 {%- if content %}\n {{- '<|im_start|>system\\n' + (reasoning_instructions + '\\n\\n' if reasoning_instructions else '') + content + '<|im_end|>\\n' }}\n {%- elif reasoning_instructions %}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' }}\n {%- endif %}\n {%- elif reasoning_instructions %}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|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 {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if preserve_thinking is undefined or preserve_thinking is true or 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 and tool_call.arguments != '' %}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}\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
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 25165824,
4
+ "shortest_edge": 4096
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "video_processor_type": "Qwen3VLVideoProcessor"
21
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff