VCLab-PolyU commited on
Commit
71aefa6
·
verified ·
1 Parent(s): be9c25d

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ 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
+ Qwen3.5-4B-SAMoD-Video-R10/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ Qwen3.5-4B-SAMoD-Image-R05/tokenizer.json filter=lfs diff=lfs merge=lfs -text
38
+ Qwen3.5-4B-SAMoD-Image-R25/tokenizer.json filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
Qwen3.5-4B-SAMoD-Image-R05/chat_template.jinja ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 messages is none or messages is undefined or (messages is iterable and messages is not mapping and messages|length == 0) %}
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
+ {%- if not (messages|length == 1 and messages[0].role == "assistant") %}
80
+ {{- raise_exception('No user query found in messages.') }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- for message in messages %}
84
+ {%- set content = render_content(message.content, true)|trim %}
85
+ {%- if message.role == "system" %}
86
+ {%- if not loop.first %}
87
+ {{- raise_exception('System message must be at the beginning.') }}
88
+ {%- endif %}
89
+ {%- elif message.role == "user" %}
90
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
91
+ {%- elif message.role == "assistant" %}
92
+ {%- set reasoning_content = '' %}
93
+ {%- if message.reasoning_content is string %}
94
+ {%- set reasoning_content = message.reasoning_content %}
95
+ {%- else %}
96
+ {%- if '</think>' in content %}
97
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
98
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
99
+ {%- endif %}
100
+ {%- endif %}
101
+ {%- set reasoning_content = reasoning_content|trim %}
102
+ {%- if loop.index0 > ns.last_query_index %}
103
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
104
+ {%- else %}
105
+ {{- '<|im_start|>' + message.role + '\n' + content }}
106
+ {%- endif %}
107
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
108
+ {%- for tool_call in message.tool_calls %}
109
+ {%- if tool_call.function is defined %}
110
+ {%- set tool_call = tool_call.function %}
111
+ {%- endif %}
112
+ {%- if loop.first %}
113
+ {%- if content|trim %}
114
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- else %}
116
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
117
+ {%- endif %}
118
+ {%- else %}
119
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
120
+ {%- endif %}
121
+ {%- if tool_call.arguments is defined %}
122
+ {%- for args_name, args_value in tool_call.arguments|items %}
123
+ {{- '<parameter=' + args_name + '>\n' }}
124
+ {%- 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 %}
125
+ {{- args_value }}
126
+ {{- '\n</parameter>\n' }}
127
+ {%- endfor %}
128
+ {%- endif %}
129
+ {{- '</function>\n</tool_call>' }}
130
+ {%- endfor %}
131
+ {%- endif %}
132
+ {{- '<|im_end|>\n' }}
133
+ {%- elif message.role == "tool" %}
134
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
135
+ {{- '<|im_start|>user' }}
136
+ {%- endif %}
137
+ {{- '\n<tool_response>\n' }}
138
+ {{- content }}
139
+ {{- '\n</tool_response>' }}
140
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- elif loop.last %}
143
+ {{- '<|im_end|>\n' }}
144
+ {%- endif %}
145
+ {%- else %}
146
+ {{- raise_exception('Unexpected message role.') }}
147
+ {%- endif %}
148
+ {%- endfor %}
149
+ {%- if add_generation_prompt %}
150
+ {{- '<|im_start|>assistant\n' }}
151
+ {%- if enable_thinking is defined and enable_thinking is true %}
152
+ {{- '<think>\n' }}
153
+ {%- elif force_direct_answer is defined and force_direct_answer is true %}
154
+ {{- '<think>\n\n</think>\n\n' }}
155
+ {%- else %}
156
+ {{- '' }}
157
+ {%- endif %}
158
+ {%- endif %}
Qwen3.5-4B-SAMoD-Image-R05/config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5SAMoDForConditionalGeneration"
4
+ ],
5
+ "auto_map": {
6
+ "AutoModelForImageTextToText": "modeling_qwen3_5_samod.Qwen3_5SAMoDForConditionalGeneration"
7
+ },
8
+ "bos_token_id": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": 248046,
11
+ "image_token_id": 248056,
12
+ "model_type": "qwen3_5",
13
+ "pad_token_id": 248044,
14
+ "text_config": {
15
+ "branch_reweight_stopgrad_threshold": false,
16
+ "ohisa_loss_weight": 0.0,
17
+ "samod_dreg_loss_weight": 0.001,
18
+ "samod_margin": 0.1,
19
+ "samod_sparsity_target": 0.05,
20
+ "samod_weight_norm": 0.2,
21
+ "attention_bias": false,
22
+ "attention_dropout": 0.0,
23
+ "attn_output_gate": true,
24
+ "bos_token_id": null,
25
+ "dtype": "bfloat16",
26
+ "eos_token_id": 248044,
27
+ "full_attention_interval": 4,
28
+ "head_dim": 256,
29
+ "hidden_act": "silu",
30
+ "hidden_size": 2560,
31
+ "initializer_range": 0.02,
32
+ "intermediate_size": 9216,
33
+ "layer_types": [
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "linear_attention",
37
+ "full_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "linear_attention",
41
+ "full_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "linear_attention",
45
+ "full_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "linear_attention",
49
+ "full_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "linear_attention",
53
+ "full_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "linear_attention",
57
+ "full_attention",
58
+ "linear_attention",
59
+ "linear_attention",
60
+ "linear_attention",
61
+ "full_attention",
62
+ "linear_attention",
63
+ "linear_attention",
64
+ "linear_attention",
65
+ "full_attention"
66
+ ],
67
+ "linear_conv_kernel_dim": 4,
68
+ "linear_key_head_dim": 128,
69
+ "linear_num_key_heads": 16,
70
+ "linear_num_value_heads": 32,
71
+ "linear_value_head_dim": 128,
72
+ "mamba_ssm_dtype": "float32",
73
+ "max_position_embeddings": 262144,
74
+ "mlp_only_layers": [],
75
+ "model_type": "qwen3_5_text",
76
+ "mtp_num_hidden_layers": 1,
77
+ "mtp_use_dedicated_embeddings": false,
78
+ "num_attention_heads": 16,
79
+ "num_hidden_layers": 32,
80
+ "num_key_value_heads": 4,
81
+ "pad_token_id": null,
82
+ "partial_rotary_factor": 0.25,
83
+ "rms_norm_eps": 1e-06,
84
+ "rope_parameters": {
85
+ "mrope_interleaved": true,
86
+ "mrope_section": [
87
+ 11,
88
+ 11,
89
+ 10
90
+ ],
91
+ "partial_rotary_factor": 0.25,
92
+ "rope_theta": 10000000,
93
+ "rope_type": "default"
94
+ },
95
+ "tie_word_embeddings": true,
96
+ "use_cache": true,
97
+ "vocab_size": 248320
98
+ },
99
+ "tie_word_embeddings": true,
100
+ "transformers_version": "5.5.0",
101
+ "verl_transformers_impl": "qwen3_5_samod",
102
+ "video_token_id": 248057,
103
+ "vision_config": {
104
+ "deepstack_visual_indexes": [],
105
+ "depth": 24,
106
+ "dtype": "bfloat16",
107
+ "hidden_act": "gelu_pytorch_tanh",
108
+ "hidden_size": 1024,
109
+ "in_channels": 3,
110
+ "initializer_range": 0.02,
111
+ "intermediate_size": 4096,
112
+ "model_type": "qwen3_5",
113
+ "num_heads": 16,
114
+ "num_position_embeddings": 2304,
115
+ "out_hidden_size": 2560,
116
+ "patch_size": 16,
117
+ "spatial_merge_size": 2,
118
+ "temporal_patch_size": 2
119
+ },
120
+ "vision_end_token_id": 248054,
121
+ "vision_start_token_id": 248053
122
+ }
Qwen3.5-4B-SAMoD-Image-R05/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 248046,
4
+ "output_attentions": false,
5
+ "output_hidden_states": false,
6
+ "pad_token_id": 248044,
7
+ "transformers_version": "5.5.0",
8
+ "use_cache": true
9
+ }
Qwen3.5-4B-SAMoD-Image-R05/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19e835a9c91231bb7720ec9c8384c8bf193ebc91d569aa782dad2d78b5ad064c
3
+ size 10350355016
Qwen3.5-4B-SAMoD-Image-R05/processor_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
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": "Qwen2VLImageProcessor",
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
+ },
28
+ "processor_class": "Qwen3VLProcessor",
29
+ "video_processor": {
30
+ "do_convert_rgb": true,
31
+ "do_normalize": true,
32
+ "do_rescale": true,
33
+ "do_resize": true,
34
+ "do_sample_frames": true,
35
+ "fps": 2,
36
+ "image_mean": [
37
+ 0.5,
38
+ 0.5,
39
+ 0.5
40
+ ],
41
+ "image_std": [
42
+ 0.5,
43
+ 0.5,
44
+ 0.5
45
+ ],
46
+ "max_frames": 768,
47
+ "merge_size": 2,
48
+ "min_frames": 4,
49
+ "patch_size": 16,
50
+ "resample": 3,
51
+ "rescale_factor": 0.00392156862745098,
52
+ "return_metadata": false,
53
+ "size": {
54
+ "longest_edge": 4194304,
55
+ "shortest_edge": 65536
56
+ },
57
+ "temporal_patch_size": 2,
58
+ "video_processor_type": "Qwen3VLVideoProcessor"
59
+ }
60
+ }
Qwen3.5-4B-SAMoD-Image-R05/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
Qwen3.5-4B-SAMoD-Image-R05/tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|endoftext|>",
24
+ "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+",
25
+ "processor_class": "Qwen3VLProcessor",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "TokenizersBackend",
28
+ "unk_token": null,
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ }
Qwen3.5-4B-SAMoD-Image-R25/chat_template.jinja ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 messages is none or messages is undefined or (messages is iterable and messages is not mapping and messages|length == 0) %}
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
+ {%- if not (messages|length == 1 and messages[0].role == "assistant") %}
80
+ {{- raise_exception('No user query found in messages.') }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- for message in messages %}
84
+ {%- set content = render_content(message.content, true)|trim %}
85
+ {%- if message.role == "system" %}
86
+ {%- if not loop.first %}
87
+ {{- raise_exception('System message must be at the beginning.') }}
88
+ {%- endif %}
89
+ {%- elif message.role == "user" %}
90
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
91
+ {%- elif message.role == "assistant" %}
92
+ {%- set reasoning_content = '' %}
93
+ {%- if message.reasoning_content is string %}
94
+ {%- set reasoning_content = message.reasoning_content %}
95
+ {%- else %}
96
+ {%- if '</think>' in content %}
97
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
98
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
99
+ {%- endif %}
100
+ {%- endif %}
101
+ {%- set reasoning_content = reasoning_content|trim %}
102
+ {%- if loop.index0 > ns.last_query_index %}
103
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
104
+ {%- else %}
105
+ {{- '<|im_start|>' + message.role + '\n' + content }}
106
+ {%- endif %}
107
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
108
+ {%- for tool_call in message.tool_calls %}
109
+ {%- if tool_call.function is defined %}
110
+ {%- set tool_call = tool_call.function %}
111
+ {%- endif %}
112
+ {%- if loop.first %}
113
+ {%- if content|trim %}
114
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- else %}
116
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
117
+ {%- endif %}
118
+ {%- else %}
119
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
120
+ {%- endif %}
121
+ {%- if tool_call.arguments is defined %}
122
+ {%- for args_name, args_value in tool_call.arguments|items %}
123
+ {{- '<parameter=' + args_name + '>\n' }}
124
+ {%- 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 %}
125
+ {{- args_value }}
126
+ {{- '\n</parameter>\n' }}
127
+ {%- endfor %}
128
+ {%- endif %}
129
+ {{- '</function>\n</tool_call>' }}
130
+ {%- endfor %}
131
+ {%- endif %}
132
+ {{- '<|im_end|>\n' }}
133
+ {%- elif message.role == "tool" %}
134
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
135
+ {{- '<|im_start|>user' }}
136
+ {%- endif %}
137
+ {{- '\n<tool_response>\n' }}
138
+ {{- content }}
139
+ {{- '\n</tool_response>' }}
140
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- elif loop.last %}
143
+ {{- '<|im_end|>\n' }}
144
+ {%- endif %}
145
+ {%- else %}
146
+ {{- raise_exception('Unexpected message role.') }}
147
+ {%- endif %}
148
+ {%- endfor %}
149
+ {%- if add_generation_prompt %}
150
+ {{- '<|im_start|>assistant\n' }}
151
+ {%- if enable_thinking is defined and enable_thinking is true %}
152
+ {{- '<think>\n' }}
153
+ {%- elif force_direct_answer is defined and force_direct_answer is true %}
154
+ {{- '<think>\n\n</think>\n\n' }}
155
+ {%- else %}
156
+ {{- '' }}
157
+ {%- endif %}
158
+ {%- endif %}
Qwen3.5-4B-SAMoD-Image-R25/config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5SAMoDForConditionalGeneration"
4
+ ],
5
+ "auto_map": {
6
+ "AutoModelForImageTextToText": "modeling_qwen3_5_samod.Qwen3_5SAMoDForConditionalGeneration"
7
+ },
8
+ "bos_token_id": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": 248046,
11
+ "image_token_id": 248056,
12
+ "model_type": "qwen3_5",
13
+ "pad_token_id": 248044,
14
+ "text_config": {
15
+ "branch_reweight_stopgrad_threshold": false,
16
+ "ohisa_loss_weight": 0.0,
17
+ "samod_dreg_loss_weight": 0.001,
18
+ "samod_margin": 0.1,
19
+ "samod_sparsity_target": 0.05,
20
+ "samod_weight_norm": 0.2,
21
+ "attention_bias": false,
22
+ "attention_dropout": 0.0,
23
+ "attn_output_gate": true,
24
+ "bos_token_id": null,
25
+ "dtype": "bfloat16",
26
+ "eos_token_id": 248044,
27
+ "full_attention_interval": 4,
28
+ "head_dim": 256,
29
+ "hidden_act": "silu",
30
+ "hidden_size": 2560,
31
+ "initializer_range": 0.02,
32
+ "intermediate_size": 9216,
33
+ "layer_types": [
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "linear_attention",
37
+ "full_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "linear_attention",
41
+ "full_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "linear_attention",
45
+ "full_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "linear_attention",
49
+ "full_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "linear_attention",
53
+ "full_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "linear_attention",
57
+ "full_attention",
58
+ "linear_attention",
59
+ "linear_attention",
60
+ "linear_attention",
61
+ "full_attention",
62
+ "linear_attention",
63
+ "linear_attention",
64
+ "linear_attention",
65
+ "full_attention"
66
+ ],
67
+ "linear_conv_kernel_dim": 4,
68
+ "linear_key_head_dim": 128,
69
+ "linear_num_key_heads": 16,
70
+ "linear_num_value_heads": 32,
71
+ "linear_value_head_dim": 128,
72
+ "mamba_ssm_dtype": "float32",
73
+ "max_position_embeddings": 262144,
74
+ "mlp_only_layers": [],
75
+ "model_type": "qwen3_5_text",
76
+ "mtp_num_hidden_layers": 1,
77
+ "mtp_use_dedicated_embeddings": false,
78
+ "num_attention_heads": 16,
79
+ "num_hidden_layers": 32,
80
+ "num_key_value_heads": 4,
81
+ "pad_token_id": null,
82
+ "partial_rotary_factor": 0.25,
83
+ "rms_norm_eps": 1e-06,
84
+ "rope_parameters": {
85
+ "mrope_interleaved": true,
86
+ "mrope_section": [
87
+ 11,
88
+ 11,
89
+ 10
90
+ ],
91
+ "partial_rotary_factor": 0.25,
92
+ "rope_theta": 10000000,
93
+ "rope_type": "default"
94
+ },
95
+ "tie_word_embeddings": true,
96
+ "use_cache": true,
97
+ "vocab_size": 248320
98
+ },
99
+ "tie_word_embeddings": true,
100
+ "transformers_version": "5.5.0",
101
+ "verl_transformers_impl": "qwen3_5_samod",
102
+ "video_token_id": 248057,
103
+ "vision_config": {
104
+ "deepstack_visual_indexes": [],
105
+ "depth": 24,
106
+ "dtype": "bfloat16",
107
+ "hidden_act": "gelu_pytorch_tanh",
108
+ "hidden_size": 1024,
109
+ "in_channels": 3,
110
+ "initializer_range": 0.02,
111
+ "intermediate_size": 4096,
112
+ "model_type": "qwen3_5",
113
+ "num_heads": 16,
114
+ "num_position_embeddings": 2304,
115
+ "out_hidden_size": 2560,
116
+ "patch_size": 16,
117
+ "spatial_merge_size": 2,
118
+ "temporal_patch_size": 2
119
+ },
120
+ "vision_end_token_id": 248054,
121
+ "vision_start_token_id": 248053
122
+ }
Qwen3.5-4B-SAMoD-Image-R25/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 248046,
4
+ "output_attentions": false,
5
+ "output_hidden_states": false,
6
+ "pad_token_id": 248044,
7
+ "transformers_version": "5.5.0",
8
+ "use_cache": true
9
+ }
Qwen3.5-4B-SAMoD-Image-R25/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71cf49f7b622d39c4209667bf4bb9bd96eb7fb0635b448a7ed000f3e4ec3525d
3
+ size 10350355016
Qwen3.5-4B-SAMoD-Image-R25/processor_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
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": "Qwen2VLImageProcessor",
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
+ },
28
+ "processor_class": "Qwen3VLProcessor",
29
+ "video_processor": {
30
+ "do_convert_rgb": true,
31
+ "do_normalize": true,
32
+ "do_rescale": true,
33
+ "do_resize": true,
34
+ "do_sample_frames": true,
35
+ "fps": 2,
36
+ "image_mean": [
37
+ 0.5,
38
+ 0.5,
39
+ 0.5
40
+ ],
41
+ "image_std": [
42
+ 0.5,
43
+ 0.5,
44
+ 0.5
45
+ ],
46
+ "max_frames": 768,
47
+ "merge_size": 2,
48
+ "min_frames": 4,
49
+ "patch_size": 16,
50
+ "resample": 3,
51
+ "rescale_factor": 0.00392156862745098,
52
+ "return_metadata": false,
53
+ "size": {
54
+ "longest_edge": 4194304,
55
+ "shortest_edge": 65536
56
+ },
57
+ "temporal_patch_size": 2,
58
+ "video_processor_type": "Qwen3VLVideoProcessor"
59
+ }
60
+ }
Qwen3.5-4B-SAMoD-Image-R25/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
Qwen3.5-4B-SAMoD-Image-R25/tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|endoftext|>",
24
+ "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+",
25
+ "processor_class": "Qwen3VLProcessor",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "TokenizersBackend",
28
+ "unk_token": null,
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ }
Qwen3.5-4B-SAMoD-Video-R10/chat_template.jinja ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 messages is none or messages is undefined or (messages is iterable and messages is not mapping and messages|length == 0) %}
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
+ {%- if not (messages|length == 1 and messages[0].role == "assistant") %}
80
+ {{- raise_exception('No user query found in messages.') }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- for message in messages %}
84
+ {%- set content = render_content(message.content, true)|trim %}
85
+ {%- if message.role == "system" %}
86
+ {%- if not loop.first %}
87
+ {{- raise_exception('System message must be at the beginning.') }}
88
+ {%- endif %}
89
+ {%- elif message.role == "user" %}
90
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
91
+ {%- elif message.role == "assistant" %}
92
+ {%- set reasoning_content = '' %}
93
+ {%- if message.reasoning_content is string %}
94
+ {%- set reasoning_content = message.reasoning_content %}
95
+ {%- else %}
96
+ {%- if '</think>' in content %}
97
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
98
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
99
+ {%- endif %}
100
+ {%- endif %}
101
+ {%- set reasoning_content = reasoning_content|trim %}
102
+ {%- if loop.index0 > ns.last_query_index %}
103
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
104
+ {%- else %}
105
+ {{- '<|im_start|>' + message.role + '\n' + content }}
106
+ {%- endif %}
107
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
108
+ {%- for tool_call in message.tool_calls %}
109
+ {%- if tool_call.function is defined %}
110
+ {%- set tool_call = tool_call.function %}
111
+ {%- endif %}
112
+ {%- if loop.first %}
113
+ {%- if content|trim %}
114
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- else %}
116
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
117
+ {%- endif %}
118
+ {%- else %}
119
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
120
+ {%- endif %}
121
+ {%- if tool_call.arguments is defined %}
122
+ {%- for args_name, args_value in tool_call.arguments|items %}
123
+ {{- '<parameter=' + args_name + '>\n' }}
124
+ {%- 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 %}
125
+ {{- args_value }}
126
+ {{- '\n</parameter>\n' }}
127
+ {%- endfor %}
128
+ {%- endif %}
129
+ {{- '</function>\n</tool_call>' }}
130
+ {%- endfor %}
131
+ {%- endif %}
132
+ {{- '<|im_end|>\n' }}
133
+ {%- elif message.role == "tool" %}
134
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
135
+ {{- '<|im_start|>user' }}
136
+ {%- endif %}
137
+ {{- '\n<tool_response>\n' }}
138
+ {{- content }}
139
+ {{- '\n</tool_response>' }}
140
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- elif loop.last %}
143
+ {{- '<|im_end|>\n' }}
144
+ {%- endif %}
145
+ {%- else %}
146
+ {{- raise_exception('Unexpected message role.') }}
147
+ {%- endif %}
148
+ {%- endfor %}
149
+ {%- if add_generation_prompt %}
150
+ {{- '<|im_start|>assistant\n' }}
151
+ {%- if enable_thinking is defined and enable_thinking is true %}
152
+ {{- '<think>\n' }}
153
+ {%- elif force_direct_answer is defined and force_direct_answer is true %}
154
+ {{- '<think>\n\n</think>\n\n' }}
155
+ {%- else %}
156
+ {{- '' }}
157
+ {%- endif %}
158
+ {%- endif %}
Qwen3.5-4B-SAMoD-Video-R10/config.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5SAMoDForConditionalGeneration"
4
+ ],
5
+ "auto_map": {
6
+ "AutoModelForImageTextToText": "modeling_qwen3_5_samod.Qwen3_5SAMoDForConditionalGeneration"
7
+ },
8
+ "bos_token_id": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": 248046,
11
+ "image_token_id": 248056,
12
+ "model_type": "qwen3_5",
13
+ "pad_token_id": 248044,
14
+ "text_config": {
15
+ "branch_reweight_stopgrad_threshold": false,
16
+ "ohisa_loss_weight": 0.0,
17
+ "samod_dreg_loss_weight": 0.001,
18
+ "samod_margin": 0.1,
19
+ "samod_sparsity_target": 0.05,
20
+ "samod_weight_norm": 0.2,
21
+ "attention_bias": false,
22
+ "attention_dropout": 0.0,
23
+ "attn_output_gate": true,
24
+ "bos_token_id": null,
25
+ "dtype": "bfloat16",
26
+ "eos_token_id": 248044,
27
+ "full_attention_interval": 4,
28
+ "head_dim": 256,
29
+ "hidden_act": "silu",
30
+ "hidden_size": 2560,
31
+ "initializer_range": 0.02,
32
+ "intermediate_size": 9216,
33
+ "layer_types": [
34
+ "linear_attention",
35
+ "linear_attention",
36
+ "linear_attention",
37
+ "full_attention",
38
+ "linear_attention",
39
+ "linear_attention",
40
+ "linear_attention",
41
+ "full_attention",
42
+ "linear_attention",
43
+ "linear_attention",
44
+ "linear_attention",
45
+ "full_attention",
46
+ "linear_attention",
47
+ "linear_attention",
48
+ "linear_attention",
49
+ "full_attention",
50
+ "linear_attention",
51
+ "linear_attention",
52
+ "linear_attention",
53
+ "full_attention",
54
+ "linear_attention",
55
+ "linear_attention",
56
+ "linear_attention",
57
+ "full_attention",
58
+ "linear_attention",
59
+ "linear_attention",
60
+ "linear_attention",
61
+ "full_attention",
62
+ "linear_attention",
63
+ "linear_attention",
64
+ "linear_attention",
65
+ "full_attention"
66
+ ],
67
+ "linear_conv_kernel_dim": 4,
68
+ "linear_key_head_dim": 128,
69
+ "linear_num_key_heads": 16,
70
+ "linear_num_value_heads": 32,
71
+ "linear_value_head_dim": 128,
72
+ "mamba_ssm_dtype": "float32",
73
+ "max_position_embeddings": 262144,
74
+ "mlp_only_layers": [],
75
+ "model_type": "qwen3_5_text",
76
+ "mtp_num_hidden_layers": 1,
77
+ "mtp_use_dedicated_embeddings": false,
78
+ "num_attention_heads": 16,
79
+ "num_hidden_layers": 32,
80
+ "num_key_value_heads": 4,
81
+ "pad_token_id": null,
82
+ "partial_rotary_factor": 0.25,
83
+ "rms_norm_eps": 1e-06,
84
+ "rope_parameters": {
85
+ "mrope_interleaved": true,
86
+ "mrope_section": [
87
+ 11,
88
+ 11,
89
+ 10
90
+ ],
91
+ "partial_rotary_factor": 0.25,
92
+ "rope_theta": 10000000,
93
+ "rope_type": "default"
94
+ },
95
+ "tie_word_embeddings": true,
96
+ "use_cache": true,
97
+ "vocab_size": 248320
98
+ },
99
+ "tie_word_embeddings": true,
100
+ "transformers_version": "5.5.0",
101
+ "verl_transformers_impl": "qwen3_5_samod",
102
+ "video_token_id": 248057,
103
+ "vision_config": {
104
+ "deepstack_visual_indexes": [],
105
+ "depth": 24,
106
+ "dtype": "bfloat16",
107
+ "hidden_act": "gelu_pytorch_tanh",
108
+ "hidden_size": 1024,
109
+ "in_channels": 3,
110
+ "initializer_range": 0.02,
111
+ "intermediate_size": 4096,
112
+ "model_type": "qwen3_5",
113
+ "num_heads": 16,
114
+ "num_position_embeddings": 2304,
115
+ "out_hidden_size": 2560,
116
+ "patch_size": 16,
117
+ "spatial_merge_size": 2,
118
+ "temporal_patch_size": 2
119
+ },
120
+ "vision_end_token_id": 248054,
121
+ "vision_start_token_id": 248053
122
+ }
Qwen3.5-4B-SAMoD-Video-R10/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 248046,
4
+ "output_attentions": false,
5
+ "output_hidden_states": false,
6
+ "pad_token_id": 248044,
7
+ "transformers_version": "5.5.0",
8
+ "use_cache": true
9
+ }
Qwen3.5-4B-SAMoD-Video-R10/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35ecdaa2f8932a3a9fcf50f611d7ee90fdf228a53d143bc8d537fd0c03fa45bf
3
+ size 10350355016
Qwen3.5-4B-SAMoD-Video-R10/processor_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
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": "Qwen2VLImageProcessor",
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
+ },
28
+ "processor_class": "Qwen3VLProcessor",
29
+ "video_processor": {
30
+ "do_convert_rgb": true,
31
+ "do_normalize": true,
32
+ "do_rescale": true,
33
+ "do_resize": true,
34
+ "do_sample_frames": true,
35
+ "fps": 2,
36
+ "image_mean": [
37
+ 0.5,
38
+ 0.5,
39
+ 0.5
40
+ ],
41
+ "image_std": [
42
+ 0.5,
43
+ 0.5,
44
+ 0.5
45
+ ],
46
+ "max_frames": 768,
47
+ "merge_size": 2,
48
+ "min_frames": 4,
49
+ "patch_size": 16,
50
+ "resample": 3,
51
+ "rescale_factor": 0.00392156862745098,
52
+ "return_metadata": false,
53
+ "size": {
54
+ "longest_edge": 4194304,
55
+ "shortest_edge": 65536
56
+ },
57
+ "temporal_patch_size": 2,
58
+ "video_processor_type": "Qwen3VLVideoProcessor"
59
+ }
60
+ }
Qwen3.5-4B-SAMoD-Video-R10/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4
3
+ size 19989343
Qwen3.5-4B-SAMoD-Video-R10/tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "audio_bos_token": "<|audio_start|>",
4
+ "audio_eos_token": "<|audio_end|>",
5
+ "audio_token": "<|audio_pad|>",
6
+ "backend": "tokenizers",
7
+ "bos_token": null,
8
+ "clean_up_tokenization_spaces": false,
9
+ "eos_token": "<|im_end|>",
10
+ "errors": "replace",
11
+ "image_token": "<|image_pad|>",
12
+ "is_local": true,
13
+ "model_max_length": 262144,
14
+ "model_specific_special_tokens": {
15
+ "audio_bos_token": "<|audio_start|>",
16
+ "audio_eos_token": "<|audio_end|>",
17
+ "audio_token": "<|audio_pad|>",
18
+ "image_token": "<|image_pad|>",
19
+ "video_token": "<|video_pad|>",
20
+ "vision_bos_token": "<|vision_start|>",
21
+ "vision_eos_token": "<|vision_end|>"
22
+ },
23
+ "pad_token": "<|endoftext|>",
24
+ "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+",
25
+ "processor_class": "Qwen3VLProcessor",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "TokenizersBackend",
28
+ "unk_token": null,
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ }