OzzyGT HF Staff commited on
Commit
871b72b
·
verified ·
1 Parent(s): 0bdadec

Upload 21 files

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/tokenizer.json filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: apache-2.0
5
+ base_model:
6
+ - OpenMOSS-Team/MOSS-Image-SFT
7
+ pipeline_tag: text-to-image
8
+ library_name: diffusers
9
+ tags:
10
+ - image-generation
11
+ - moss-image
12
+ - modular-diffusers
13
+ ---
14
+
15
+ # MOSS-Image SFT
16
+
17
+ ![MOSS-Image SFT sample](https://huggingface.co/datasets/OzzyGT/diffusers-examples/resolve/main/MOSS_Image_SFT/bf16_2048x1152.png)
18
+
19
+ This is [OpenMOSS-Team/MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT) converted to the standard diffusers layout, so it runs as a Modular Diffusers pipeline with the custom blocks below instead of the custom pipeline shipped in the original repository. The weights are the original bf16 ones.
20
+
21
+ Note: You need diffusers from `main` (0.41.0.dev0 or later).
22
+
23
+ ## Usage
24
+
25
+ You can find ready-to-use scripts in the [diffusers-recipes](https://github.com/asomoza/diffusers-recipes/blob/main/models/moss_image/README.md) repository.
26
+
27
+ MOSS-Image runs as a Modular Diffusers pipeline built from the [MOSS-Image custom blocks](https://huggingface.co/OzzyGT/moss_image_custom_blocks), which load the transformer code shipped in this repository (hence `trust_remote_code` and `trust_components_code`). The VAE runs in float32, like the original.
28
+
29
+ **Note:** both flags run Python code downloaded from the Hub: `trust_remote_code=True` runs the code of the blocks repository, and `trust_components_code=True` runs the code shipped in the `components_repo`. Only use them with repositories you trust, and review their code before passing different ones.
30
+
31
+ With every component on the GPU, generating at 2048x1152 needs more than 32 GB of VRAM. For smaller GPUs, see the offloading recipes in diffusers-recipes or use one of the [SDNQ quantized versions](https://huggingface.co/OzzyGT/MOSS_Image_SFT_sdnq_dynamic_8bit).
32
+
33
+ For prompting, recommended settings and the layout format, see the [original model card](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT) and the [user guide](https://github.com/OpenMOSS/MOSS-Image/blob/main/USERGUIDE.md#layout-prompts-experimental). The sample below uses a layout prompt: boxes are `[y_min, x_min, y_max, x_max]` in pixels with the origin at the center of the canvas.
34
+
35
+ Note: the samples use 28 steps, which is also the default of the custom blocks, because it already gives good results in about half the time. The official recommendation is 50 steps or more, so raise `num_inference_steps` if you want the best quality.
36
+
37
+ ## Sample image
38
+
39
+ The image above was generated with the following prompt and settings (seed `7`):
40
+
41
+ ```python
42
+ import json
43
+
44
+ import torch
45
+ from diffusers import ModularPipelineBlocks
46
+
47
+
48
+ blocks = ModularPipelineBlocks.from_pretrained(
49
+ "OzzyGT/moss_image_custom_blocks",
50
+ trust_remote_code=True,
51
+ components_repo="OzzyGT/MOSS_Image_SFT_diffusers",
52
+ trust_components_code=True,
53
+ )
54
+ pipe = blocks.init_pipeline()
55
+ pipe.load_components(dtype={"default": torch.bfloat16, "vae": torch.float32})
56
+ pipe.to("cuda")
57
+
58
+ layout = {
59
+ "summary": {
60
+ "meta": ["photo"],
61
+ "canvas": "single",
62
+ "caption": (
63
+ "A photograph of the inside of a small bicycle repair workshop, shot on a Sony A7 IV with a 35mm f/1.8 "
64
+ "lens at f/2.8, 1/125 s, ISO 1600, handheld at eye level, wide 16:9 frame. Low late-afternoon sunlight "
65
+ "comes through a large front window on the right in hard shafts with dust in the air, the rest of the "
66
+ "room is lit by bare fluorescent tubes on the ceiling. Shallow depth of field with the back wall slightly "
67
+ "out of focus, visible sensor grain. A red road bicycle is clamped in a repair stand in the center while "
68
+ "an adult mechanic in a grease-stained navy work apron adjusts its rear derailleur. A painted wooden sign "
69
+ 'on the back wall reads "SPOKE & CHAIN". A pegboard of hand tools hangs on the left wall above an A-frame '
70
+ "chalkboard with a price list, and an adult black cat sleeps curled up on a metal stool by the window. "
71
+ "Oil stains on a grey concrete floor, spare tires hanging from hooks, scuffed white walls."
72
+ ),
73
+ },
74
+ "items": [
75
+ {
76
+ "label": "text",
77
+ "caption": "A long painted wooden sign on the back wall, dark green with cream serif capital letters.",
78
+ "text": "SPOKE & CHAIN",
79
+ "bbox": [-496, -464, -346, 236],
80
+ },
81
+ {
82
+ "label": "object",
83
+ "caption": "A perforated pegboard with wrenches, screwdrivers, tire levers and a chain whip on hooks.",
84
+ "bbox": [-396, -984, 124, -544],
85
+ },
86
+ {
87
+ "label": "object",
88
+ "caption": "A red steel road bicycle with drop handlebars, clamped by its seat post in a grey repair stand.",
89
+ "bbox": [-196, -504, 329, 371],
90
+ },
91
+ {
92
+ "label": "object",
93
+ "caption": (
94
+ "An adult man in his forties with short grey hair, a grey t-shirt and a grease-stained navy work "
95
+ "apron, standing and turning a small screwdriver on the rear derailleur."
96
+ ),
97
+ "bbox": [-371, 396, 504, 736],
98
+ },
99
+ {
100
+ "label": "text",
101
+ "caption": "A black A-frame chalkboard on the floor with a handwritten price list in white chalk.",
102
+ "text": "FLAT REPAIR $12\nFULL TUNE-UP $45\nOPEN 8-6",
103
+ "bbox": [184, -964, 524, -604],
104
+ },
105
+ {
106
+ "label": "object",
107
+ "caption": "An adult black cat sleeping curled up on the seat of a metal shop stool in a patch of sunlight.",
108
+ "bbox": [104, 766, 209, 981],
109
+ },
110
+ ],
111
+ "bbox_coord_space": "abs_centralized",
112
+ "bbox_format": "yxyx",
113
+ }
114
+ prompt = json.dumps(layout, ensure_ascii=False)
115
+
116
+ image = pipe(
117
+ prompt=prompt,
118
+ num_inference_steps=28,
119
+ height=1152,
120
+ width=2048,
121
+ generator=torch.Generator("cuda").manual_seed(7),
122
+ output="images",
123
+ )[0]
124
+ image.save("moss_image.png")
125
+ ```
126
+
127
+ ## License
128
+
129
+ This model is released under the [Apache-2.0 license](LICENSE), the same as the original.
modular_model_index.json ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "ModularPipeline",
3
+ "_blocks_class_name": "MOSSImageBlocks",
4
+ "scheduler": [
5
+ "diffusers",
6
+ "FlowMatchEulerDiscreteScheduler",
7
+ {
8
+ "pretrained_model_name_or_path": null,
9
+ "revision": null,
10
+ "subfolder": "scheduler",
11
+ "type_hint": [
12
+ "diffusers",
13
+ "FlowMatchEulerDiscreteScheduler"
14
+ ],
15
+ "variant": null
16
+ }
17
+ ],
18
+ "text_encoder": [
19
+ "transformers",
20
+ "Qwen3_5TextModel",
21
+ {
22
+ "pretrained_model_name_or_path": null,
23
+ "revision": null,
24
+ "subfolder": "text_encoder",
25
+ "type_hint": [
26
+ "transformers",
27
+ "Qwen3_5TextModel"
28
+ ],
29
+ "variant": null
30
+ }
31
+ ],
32
+ "tokenizer": [
33
+ "transformers",
34
+ "Qwen2Tokenizer",
35
+ {
36
+ "pretrained_model_name_or_path": null,
37
+ "revision": null,
38
+ "subfolder": "tokenizer",
39
+ "type_hint": [
40
+ "transformers",
41
+ "Qwen2Tokenizer"
42
+ ],
43
+ "variant": null
44
+ }
45
+ ],
46
+ "transformer": [
47
+ "transformer_moss_image",
48
+ "MOSSImageTransformer2DModel",
49
+ {
50
+ "pretrained_model_name_or_path": null,
51
+ "revision": null,
52
+ "subfolder": "transformer",
53
+ "type_hint": [
54
+ "transformer_moss_image",
55
+ "MOSSImageTransformer2DModel"
56
+ ],
57
+ "variant": null
58
+ }
59
+ ],
60
+ "vae": [
61
+ "diffusers",
62
+ "AutoencoderKLFlux2",
63
+ {
64
+ "pretrained_model_name_or_path": null,
65
+ "revision": null,
66
+ "subfolder": "vae",
67
+ "type_hint": [
68
+ "diffusers",
69
+ "AutoencoderKLFlux2"
70
+ ],
71
+ "variant": null
72
+ }
73
+ ]
74
+ }
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "FlowMatchEulerDiscreteScheduler",
3
+ "_diffusers_version": "0.41.0.dev0",
4
+ "base_image_seq_len": 256,
5
+ "base_shift": 0.5,
6
+ "invert_sigmas": false,
7
+ "max_image_seq_len": 4096,
8
+ "max_shift": 1.15,
9
+ "num_train_timesteps": 1000,
10
+ "shift": 5.0,
11
+ "shift_terminal": null,
12
+ "stochastic_sampling": false,
13
+ "time_shift_type": "exponential",
14
+ "use_beta_sigmas": false,
15
+ "use_dynamic_shifting": false,
16
+ "use_exponential_sigmas": false,
17
+ "use_karras_sigmas": false
18
+ }
text_encoder/config.json ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3_5TextModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "attn_output_gate": true,
8
+ "bos_token_id": null,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": 248044,
11
+ "full_attention_interval": 4,
12
+ "head_dim": 256,
13
+ "hidden_act": "silu",
14
+ "hidden_size": 4096,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 12288,
17
+ "layer_types": [
18
+ "linear_attention",
19
+ "linear_attention",
20
+ "linear_attention",
21
+ "full_attention",
22
+ "linear_attention",
23
+ "linear_attention",
24
+ "linear_attention",
25
+ "full_attention",
26
+ "linear_attention",
27
+ "linear_attention",
28
+ "linear_attention",
29
+ "full_attention",
30
+ "linear_attention",
31
+ "linear_attention",
32
+ "linear_attention",
33
+ "full_attention",
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
+ ],
51
+ "linear_conv_kernel_dim": 4,
52
+ "linear_key_head_dim": 128,
53
+ "linear_num_key_heads": 16,
54
+ "linear_num_value_heads": 32,
55
+ "linear_value_head_dim": 128,
56
+ "mamba_ssm_dtype": "float32",
57
+ "max_position_embeddings": 262144,
58
+ "mlp_only_layers": [],
59
+ "model_type": "qwen3_5_text",
60
+ "mtp_num_hidden_layers": 1,
61
+ "mtp_use_dedicated_embeddings": false,
62
+ "num_attention_heads": 16,
63
+ "num_hidden_layers": 32,
64
+ "num_key_value_heads": 4,
65
+ "pad_token_id": null,
66
+ "partial_rotary_factor": 0.25,
67
+ "rms_norm_eps": 1e-06,
68
+ "rope_parameters": {
69
+ "mrope_interleaved": true,
70
+ "mrope_section": [
71
+ 11,
72
+ 11,
73
+ 10
74
+ ],
75
+ "partial_rotary_factor": 0.25,
76
+ "rope_theta": 10000000,
77
+ "rope_type": "default"
78
+ },
79
+ "tie_word_embeddings": false,
80
+ "transformers_version": "5.14.1",
81
+ "use_cache": true,
82
+ "vocab_size": 248320
83
+ }
text_encoder/model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74f209d5299e87bbcc7de2c12e3a4b49cb56a06cd0bed6ae9a60fd5432dd6c67
3
+ size 4973901040
text_encoder/model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:365021e5a60c859a936e23b879695f4c7bce2cc008541afe173efdbde0500bab
3
+ size 4988361936
text_encoder/model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:91a8bd6ee80a0f126925c278c4e01ef2ffa8410490a369c3d619e6d350757d0e
3
+ size 4954199896
text_encoder/model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:45d65389f300e39d4f56840c480ad791d9c6c49d3fc044962d83785b388b7192
3
+ size 956953032
text_encoder/model.safetensors.index.json ADDED
@@ -0,0 +1,434 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_parameters": 7936684544,
4
+ "total_size": 15873369088
5
+ },
6
+ "weight_map": {
7
+ "embed_tokens.weight": "model-00001-of-00004.safetensors",
8
+ "layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
9
+ "layers.0.linear_attn.A_log": "model-00001-of-00004.safetensors",
10
+ "layers.0.linear_attn.conv1d.weight": "model-00001-of-00004.safetensors",
11
+ "layers.0.linear_attn.dt_bias": "model-00001-of-00004.safetensors",
12
+ "layers.0.linear_attn.in_proj_a.weight": "model-00001-of-00004.safetensors",
13
+ "layers.0.linear_attn.in_proj_b.weight": "model-00001-of-00004.safetensors",
14
+ "layers.0.linear_attn.in_proj_qkv.weight": "model-00001-of-00004.safetensors",
15
+ "layers.0.linear_attn.in_proj_z.weight": "model-00001-of-00004.safetensors",
16
+ "layers.0.linear_attn.norm.weight": "model-00001-of-00004.safetensors",
17
+ "layers.0.linear_attn.out_proj.weight": "model-00001-of-00004.safetensors",
18
+ "layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
19
+ "layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
20
+ "layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
21
+ "layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
22
+ "layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
23
+ "layers.1.linear_attn.A_log": "model-00001-of-00004.safetensors",
24
+ "layers.1.linear_attn.conv1d.weight": "model-00001-of-00004.safetensors",
25
+ "layers.1.linear_attn.dt_bias": "model-00001-of-00004.safetensors",
26
+ "layers.1.linear_attn.in_proj_a.weight": "model-00001-of-00004.safetensors",
27
+ "layers.1.linear_attn.in_proj_b.weight": "model-00001-of-00004.safetensors",
28
+ "layers.1.linear_attn.in_proj_qkv.weight": "model-00001-of-00004.safetensors",
29
+ "layers.1.linear_attn.in_proj_z.weight": "model-00001-of-00004.safetensors",
30
+ "layers.1.linear_attn.norm.weight": "model-00001-of-00004.safetensors",
31
+ "layers.1.linear_attn.out_proj.weight": "model-00001-of-00004.safetensors",
32
+ "layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
33
+ "layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
34
+ "layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
35
+ "layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
36
+ "layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
37
+ "layers.10.linear_attn.A_log": "model-00002-of-00004.safetensors",
38
+ "layers.10.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
39
+ "layers.10.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
40
+ "layers.10.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
41
+ "layers.10.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
42
+ "layers.10.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
43
+ "layers.10.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
44
+ "layers.10.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
45
+ "layers.10.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
46
+ "layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
47
+ "layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
48
+ "layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
49
+ "layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
50
+ "layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
51
+ "layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
52
+ "layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
53
+ "layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
54
+ "layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
55
+ "layers.11.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
56
+ "layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
57
+ "layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
58
+ "layers.11.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
59
+ "layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
60
+ "layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
61
+ "layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
62
+ "layers.12.linear_attn.A_log": "model-00002-of-00004.safetensors",
63
+ "layers.12.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
64
+ "layers.12.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
65
+ "layers.12.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
66
+ "layers.12.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
67
+ "layers.12.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
68
+ "layers.12.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
69
+ "layers.12.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
70
+ "layers.12.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
71
+ "layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
72
+ "layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
73
+ "layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
74
+ "layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
75
+ "layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
76
+ "layers.13.linear_attn.A_log": "model-00002-of-00004.safetensors",
77
+ "layers.13.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
78
+ "layers.13.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
79
+ "layers.13.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
80
+ "layers.13.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
81
+ "layers.13.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
82
+ "layers.13.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
83
+ "layers.13.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
84
+ "layers.13.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
85
+ "layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
86
+ "layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
87
+ "layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
88
+ "layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
89
+ "layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
90
+ "layers.14.linear_attn.A_log": "model-00002-of-00004.safetensors",
91
+ "layers.14.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
92
+ "layers.14.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
93
+ "layers.14.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
94
+ "layers.14.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
95
+ "layers.14.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
96
+ "layers.14.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
97
+ "layers.14.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
98
+ "layers.14.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
99
+ "layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
100
+ "layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
101
+ "layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
102
+ "layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
103
+ "layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
104
+ "layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
105
+ "layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
106
+ "layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
107
+ "layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
108
+ "layers.15.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
109
+ "layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
110
+ "layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
111
+ "layers.15.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
112
+ "layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
113
+ "layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
114
+ "layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
115
+ "layers.16.linear_attn.A_log": "model-00002-of-00004.safetensors",
116
+ "layers.16.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
117
+ "layers.16.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
118
+ "layers.16.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
119
+ "layers.16.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
120
+ "layers.16.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
121
+ "layers.16.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
122
+ "layers.16.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
123
+ "layers.16.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
124
+ "layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
125
+ "layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
126
+ "layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
127
+ "layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
128
+ "layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
129
+ "layers.17.linear_attn.A_log": "model-00002-of-00004.safetensors",
130
+ "layers.17.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
131
+ "layers.17.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
132
+ "layers.17.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
133
+ "layers.17.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
134
+ "layers.17.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
135
+ "layers.17.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
136
+ "layers.17.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
137
+ "layers.17.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
138
+ "layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
139
+ "layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
140
+ "layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
141
+ "layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
142
+ "layers.18.input_layernorm.weight": "model-00003-of-00004.safetensors",
143
+ "layers.18.linear_attn.A_log": "model-00002-of-00004.safetensors",
144
+ "layers.18.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
145
+ "layers.18.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
146
+ "layers.18.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
147
+ "layers.18.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
148
+ "layers.18.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
149
+ "layers.18.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
150
+ "layers.18.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
151
+ "layers.18.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
152
+ "layers.18.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
153
+ "layers.18.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
154
+ "layers.18.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
155
+ "layers.18.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
156
+ "layers.19.input_layernorm.weight": "model-00003-of-00004.safetensors",
157
+ "layers.19.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
158
+ "layers.19.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
159
+ "layers.19.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
160
+ "layers.19.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
161
+ "layers.19.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
162
+ "layers.19.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
163
+ "layers.19.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
164
+ "layers.19.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
165
+ "layers.19.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
166
+ "layers.19.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
167
+ "layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
168
+ "layers.2.linear_attn.A_log": "model-00001-of-00004.safetensors",
169
+ "layers.2.linear_attn.conv1d.weight": "model-00001-of-00004.safetensors",
170
+ "layers.2.linear_attn.dt_bias": "model-00001-of-00004.safetensors",
171
+ "layers.2.linear_attn.in_proj_a.weight": "model-00001-of-00004.safetensors",
172
+ "layers.2.linear_attn.in_proj_b.weight": "model-00001-of-00004.safetensors",
173
+ "layers.2.linear_attn.in_proj_qkv.weight": "model-00001-of-00004.safetensors",
174
+ "layers.2.linear_attn.in_proj_z.weight": "model-00001-of-00004.safetensors",
175
+ "layers.2.linear_attn.norm.weight": "model-00001-of-00004.safetensors",
176
+ "layers.2.linear_attn.out_proj.weight": "model-00001-of-00004.safetensors",
177
+ "layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
178
+ "layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
179
+ "layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
180
+ "layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
181
+ "layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
182
+ "layers.20.linear_attn.A_log": "model-00003-of-00004.safetensors",
183
+ "layers.20.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
184
+ "layers.20.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
185
+ "layers.20.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
186
+ "layers.20.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
187
+ "layers.20.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
188
+ "layers.20.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
189
+ "layers.20.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
190
+ "layers.20.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
191
+ "layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
192
+ "layers.20.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
193
+ "layers.20.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
194
+ "layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
195
+ "layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
196
+ "layers.21.linear_attn.A_log": "model-00003-of-00004.safetensors",
197
+ "layers.21.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
198
+ "layers.21.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
199
+ "layers.21.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
200
+ "layers.21.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
201
+ "layers.21.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
202
+ "layers.21.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
203
+ "layers.21.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
204
+ "layers.21.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
205
+ "layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
206
+ "layers.21.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
207
+ "layers.21.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
208
+ "layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
209
+ "layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
210
+ "layers.22.linear_attn.A_log": "model-00003-of-00004.safetensors",
211
+ "layers.22.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
212
+ "layers.22.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
213
+ "layers.22.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
214
+ "layers.22.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
215
+ "layers.22.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
216
+ "layers.22.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
217
+ "layers.22.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
218
+ "layers.22.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
219
+ "layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
220
+ "layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
221
+ "layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
222
+ "layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
223
+ "layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
224
+ "layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
225
+ "layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
226
+ "layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
227
+ "layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
228
+ "layers.23.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
229
+ "layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
230
+ "layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
231
+ "layers.23.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
232
+ "layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
233
+ "layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
234
+ "layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
235
+ "layers.24.linear_attn.A_log": "model-00003-of-00004.safetensors",
236
+ "layers.24.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
237
+ "layers.24.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
238
+ "layers.24.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
239
+ "layers.24.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
240
+ "layers.24.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
241
+ "layers.24.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
242
+ "layers.24.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
243
+ "layers.24.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
244
+ "layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
245
+ "layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
246
+ "layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
247
+ "layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
248
+ "layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
249
+ "layers.25.linear_attn.A_log": "model-00003-of-00004.safetensors",
250
+ "layers.25.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
251
+ "layers.25.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
252
+ "layers.25.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
253
+ "layers.25.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
254
+ "layers.25.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
255
+ "layers.25.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
256
+ "layers.25.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
257
+ "layers.25.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
258
+ "layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
259
+ "layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
260
+ "layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
261
+ "layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
262
+ "layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
263
+ "layers.26.linear_attn.A_log": "model-00003-of-00004.safetensors",
264
+ "layers.26.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
265
+ "layers.26.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
266
+ "layers.26.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
267
+ "layers.26.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
268
+ "layers.26.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
269
+ "layers.26.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
270
+ "layers.26.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
271
+ "layers.26.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
272
+ "layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
273
+ "layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
274
+ "layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
275
+ "layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
276
+ "layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
277
+ "layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
278
+ "layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
279
+ "layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
280
+ "layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
281
+ "layers.27.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
282
+ "layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
283
+ "layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
284
+ "layers.27.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
285
+ "layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
286
+ "layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
287
+ "layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
288
+ "layers.28.linear_attn.A_log": "model-00003-of-00004.safetensors",
289
+ "layers.28.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
290
+ "layers.28.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
291
+ "layers.28.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
292
+ "layers.28.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
293
+ "layers.28.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
294
+ "layers.28.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
295
+ "layers.28.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
296
+ "layers.28.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
297
+ "layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
298
+ "layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
299
+ "layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
300
+ "layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
301
+ "layers.29.input_layernorm.weight": "model-00004-of-00004.safetensors",
302
+ "layers.29.linear_attn.A_log": "model-00003-of-00004.safetensors",
303
+ "layers.29.linear_attn.conv1d.weight": "model-00003-of-00004.safetensors",
304
+ "layers.29.linear_attn.dt_bias": "model-00003-of-00004.safetensors",
305
+ "layers.29.linear_attn.in_proj_a.weight": "model-00003-of-00004.safetensors",
306
+ "layers.29.linear_attn.in_proj_b.weight": "model-00003-of-00004.safetensors",
307
+ "layers.29.linear_attn.in_proj_qkv.weight": "model-00003-of-00004.safetensors",
308
+ "layers.29.linear_attn.in_proj_z.weight": "model-00003-of-00004.safetensors",
309
+ "layers.29.linear_attn.norm.weight": "model-00003-of-00004.safetensors",
310
+ "layers.29.linear_attn.out_proj.weight": "model-00003-of-00004.safetensors",
311
+ "layers.29.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
312
+ "layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
313
+ "layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
314
+ "layers.29.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
315
+ "layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
316
+ "layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
317
+ "layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
318
+ "layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
319
+ "layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
320
+ "layers.3.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
321
+ "layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
322
+ "layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
323
+ "layers.3.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
324
+ "layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
325
+ "layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
326
+ "layers.30.input_layernorm.weight": "model-00004-of-00004.safetensors",
327
+ "layers.30.linear_attn.A_log": "model-00004-of-00004.safetensors",
328
+ "layers.30.linear_attn.conv1d.weight": "model-00004-of-00004.safetensors",
329
+ "layers.30.linear_attn.dt_bias": "model-00004-of-00004.safetensors",
330
+ "layers.30.linear_attn.in_proj_a.weight": "model-00004-of-00004.safetensors",
331
+ "layers.30.linear_attn.in_proj_b.weight": "model-00004-of-00004.safetensors",
332
+ "layers.30.linear_attn.in_proj_qkv.weight": "model-00004-of-00004.safetensors",
333
+ "layers.30.linear_attn.in_proj_z.weight": "model-00004-of-00004.safetensors",
334
+ "layers.30.linear_attn.norm.weight": "model-00004-of-00004.safetensors",
335
+ "layers.30.linear_attn.out_proj.weight": "model-00004-of-00004.safetensors",
336
+ "layers.30.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
337
+ "layers.30.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
338
+ "layers.30.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
339
+ "layers.30.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
340
+ "layers.31.input_layernorm.weight": "model-00004-of-00004.safetensors",
341
+ "layers.31.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
342
+ "layers.31.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
343
+ "layers.31.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
344
+ "layers.31.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
345
+ "layers.31.self_attn.k_norm.weight": "model-00004-of-00004.safetensors",
346
+ "layers.31.self_attn.k_proj.weight": "model-00004-of-00004.safetensors",
347
+ "layers.31.self_attn.o_proj.weight": "model-00004-of-00004.safetensors",
348
+ "layers.31.self_attn.q_norm.weight": "model-00004-of-00004.safetensors",
349
+ "layers.31.self_attn.q_proj.weight": "model-00004-of-00004.safetensors",
350
+ "layers.31.self_attn.v_proj.weight": "model-00004-of-00004.safetensors",
351
+ "layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
352
+ "layers.4.linear_attn.A_log": "model-00001-of-00004.safetensors",
353
+ "layers.4.linear_attn.conv1d.weight": "model-00001-of-00004.safetensors",
354
+ "layers.4.linear_attn.dt_bias": "model-00001-of-00004.safetensors",
355
+ "layers.4.linear_attn.in_proj_a.weight": "model-00001-of-00004.safetensors",
356
+ "layers.4.linear_attn.in_proj_b.weight": "model-00001-of-00004.safetensors",
357
+ "layers.4.linear_attn.in_proj_qkv.weight": "model-00001-of-00004.safetensors",
358
+ "layers.4.linear_attn.in_proj_z.weight": "model-00001-of-00004.safetensors",
359
+ "layers.4.linear_attn.norm.weight": "model-00001-of-00004.safetensors",
360
+ "layers.4.linear_attn.out_proj.weight": "model-00001-of-00004.safetensors",
361
+ "layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
362
+ "layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
363
+ "layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
364
+ "layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
365
+ "layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
366
+ "layers.5.linear_attn.A_log": "model-00001-of-00004.safetensors",
367
+ "layers.5.linear_attn.conv1d.weight": "model-00001-of-00004.safetensors",
368
+ "layers.5.linear_attn.dt_bias": "model-00001-of-00004.safetensors",
369
+ "layers.5.linear_attn.in_proj_a.weight": "model-00001-of-00004.safetensors",
370
+ "layers.5.linear_attn.in_proj_b.weight": "model-00001-of-00004.safetensors",
371
+ "layers.5.linear_attn.in_proj_qkv.weight": "model-00001-of-00004.safetensors",
372
+ "layers.5.linear_attn.in_proj_z.weight": "model-00001-of-00004.safetensors",
373
+ "layers.5.linear_attn.norm.weight": "model-00001-of-00004.safetensors",
374
+ "layers.5.linear_attn.out_proj.weight": "model-00001-of-00004.safetensors",
375
+ "layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
376
+ "layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
377
+ "layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
378
+ "layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
379
+ "layers.6.input_layernorm.weight": "model-00002-of-00004.safetensors",
380
+ "layers.6.linear_attn.A_log": "model-00001-of-00004.safetensors",
381
+ "layers.6.linear_attn.conv1d.weight": "model-00001-of-00004.safetensors",
382
+ "layers.6.linear_attn.dt_bias": "model-00001-of-00004.safetensors",
383
+ "layers.6.linear_attn.in_proj_a.weight": "model-00001-of-00004.safetensors",
384
+ "layers.6.linear_attn.in_proj_b.weight": "model-00001-of-00004.safetensors",
385
+ "layers.6.linear_attn.in_proj_qkv.weight": "model-00001-of-00004.safetensors",
386
+ "layers.6.linear_attn.in_proj_z.weight": "model-00001-of-00004.safetensors",
387
+ "layers.6.linear_attn.norm.weight": "model-00001-of-00004.safetensors",
388
+ "layers.6.linear_attn.out_proj.weight": "model-00001-of-00004.safetensors",
389
+ "layers.6.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
390
+ "layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
391
+ "layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
392
+ "layers.6.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
393
+ "layers.7.input_layernorm.weight": "model-00002-of-00004.safetensors",
394
+ "layers.7.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
395
+ "layers.7.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
396
+ "layers.7.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
397
+ "layers.7.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
398
+ "layers.7.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
399
+ "layers.7.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
400
+ "layers.7.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
401
+ "layers.7.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
402
+ "layers.7.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
403
+ "layers.7.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
404
+ "layers.8.input_layernorm.weight": "model-00002-of-00004.safetensors",
405
+ "layers.8.linear_attn.A_log": "model-00002-of-00004.safetensors",
406
+ "layers.8.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
407
+ "layers.8.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
408
+ "layers.8.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
409
+ "layers.8.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
410
+ "layers.8.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
411
+ "layers.8.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
412
+ "layers.8.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
413
+ "layers.8.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
414
+ "layers.8.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
415
+ "layers.8.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
416
+ "layers.8.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
417
+ "layers.8.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
418
+ "layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
419
+ "layers.9.linear_attn.A_log": "model-00002-of-00004.safetensors",
420
+ "layers.9.linear_attn.conv1d.weight": "model-00002-of-00004.safetensors",
421
+ "layers.9.linear_attn.dt_bias": "model-00002-of-00004.safetensors",
422
+ "layers.9.linear_attn.in_proj_a.weight": "model-00002-of-00004.safetensors",
423
+ "layers.9.linear_attn.in_proj_b.weight": "model-00002-of-00004.safetensors",
424
+ "layers.9.linear_attn.in_proj_qkv.weight": "model-00002-of-00004.safetensors",
425
+ "layers.9.linear_attn.in_proj_z.weight": "model-00002-of-00004.safetensors",
426
+ "layers.9.linear_attn.norm.weight": "model-00002-of-00004.safetensors",
427
+ "layers.9.linear_attn.out_proj.weight": "model-00002-of-00004.safetensors",
428
+ "layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
429
+ "layers.9.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
430
+ "layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
431
+ "layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
432
+ "norm.weight": "model-00004-of-00004.safetensors"
433
+ }
434
+ }
tokenizer/chat_template.jinja ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set image_count = namespace(value=0) %}
2
+ {%- set video_count = namespace(value=0) %}
3
+ {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
+ {%- if content is string %}
5
+ {{- content }}
6
+ {%- elif content is iterable and content is not mapping %}
7
+ {%- for item in content %}
8
+ {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
9
+ {%- if is_system_content %}
10
+ {{- raise_exception('System message cannot contain images.') }}
11
+ {%- endif %}
12
+ {%- if do_vision_count %}
13
+ {%- set image_count.value = image_count.value + 1 %}
14
+ {%- endif %}
15
+ {%- if add_vision_id %}
16
+ {{- 'Picture ' ~ image_count.value ~ ': ' }}
17
+ {%- endif %}
18
+ {{- '<|vision_start|><|image_pad|><|vision_end|>' }}
19
+ {%- elif 'video' in item or item.type == 'video' %}
20
+ {%- if is_system_content %}
21
+ {{- raise_exception('System message cannot contain videos.') }}
22
+ {%- endif %}
23
+ {%- if do_vision_count %}
24
+ {%- set video_count.value = video_count.value + 1 %}
25
+ {%- endif %}
26
+ {%- if add_vision_id %}
27
+ {{- 'Video ' ~ video_count.value ~ ': ' }}
28
+ {%- endif %}
29
+ {{- '<|vision_start|><|video_pad|><|vision_end|>' }}
30
+ {%- elif 'text' in item %}
31
+ {{- item.text }}
32
+ {%- else %}
33
+ {{- raise_exception('Unexpected item type in content.') }}
34
+ {%- endif %}
35
+ {%- endfor %}
36
+ {%- elif content is none or content is undefined %}
37
+ {{- '' }}
38
+ {%- else %}
39
+ {{- raise_exception('Unexpected content type.') }}
40
+ {%- endif %}
41
+ {%- endmacro %}
42
+ {%- if not messages %}
43
+ {{- raise_exception('No messages provided.') }}
44
+ {%- endif %}
45
+ {%- if tools and tools is iterable and tools is not mapping %}
46
+ {{- '<|im_start|>system\n' }}
47
+ {{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
48
+ {%- for tool in tools %}
49
+ {{- "\n" }}
50
+ {{- tool | tojson }}
51
+ {%- endfor %}
52
+ {{- "\n</tools>" }}
53
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
54
+ {%- if messages[0].role == 'system' %}
55
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
56
+ {%- if content %}
57
+ {{- '\n\n' + content }}
58
+ {%- endif %}
59
+ {%- endif %}
60
+ {{- '<|im_end|>\n' }}
61
+ {%- else %}
62
+ {%- if messages[0].role == 'system' %}
63
+ {%- set content = render_content(messages[0].content, false, true)|trim %}
64
+ {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
65
+ {%- endif %}
66
+ {%- endif %}
67
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
68
+ {%- for message in messages[::-1] %}
69
+ {%- set index = (messages|length - 1) - loop.index0 %}
70
+ {%- if ns.multi_step_tool and message.role == "user" %}
71
+ {%- set content = render_content(message.content, false)|trim %}
72
+ {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
73
+ {%- set ns.multi_step_tool = false %}
74
+ {%- set ns.last_query_index = index %}
75
+ {%- endif %}
76
+ {%- endif %}
77
+ {%- endfor %}
78
+ {%- if ns.multi_step_tool %}
79
+ {{- raise_exception('No user query found in messages.') }}
80
+ {%- endif %}
81
+ {%- for message in messages %}
82
+ {%- set content = render_content(message.content, true)|trim %}
83
+ {%- if message.role == "system" %}
84
+ {%- if not loop.first %}
85
+ {{- raise_exception('System message must be at the beginning.') }}
86
+ {%- endif %}
87
+ {%- elif message.role == "user" %}
88
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
89
+ {%- elif message.role == "assistant" %}
90
+ {%- set reasoning_content = '' %}
91
+ {%- if message.reasoning_content is string %}
92
+ {%- set reasoning_content = message.reasoning_content %}
93
+ {%- else %}
94
+ {%- if '</think>' in content %}
95
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
96
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
97
+ {%- endif %}
98
+ {%- endif %}
99
+ {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index %}
101
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
+ {%- else %}
103
+ {{- '<|im_start|>' + message.role + '\n' + content }}
104
+ {%- endif %}
105
+ {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
106
+ {%- for tool_call in message.tool_calls %}
107
+ {%- if tool_call.function is defined %}
108
+ {%- set tool_call = tool_call.function %}
109
+ {%- endif %}
110
+ {%- if loop.first %}
111
+ {%- if content|trim %}
112
+ {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
113
+ {%- else %}
114
+ {{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
115
+ {%- endif %}
116
+ {%- else %}
117
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
118
+ {%- endif %}
119
+ {%- if tool_call.arguments is defined %}
120
+ {%- for args_name, args_value in tool_call.arguments|items %}
121
+ {{- '<parameter=' + args_name + '>\n' }}
122
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
123
+ {{- args_value }}
124
+ {{- '\n</parameter>\n' }}
125
+ {%- endfor %}
126
+ {%- endif %}
127
+ {{- '</function>\n</tool_call>' }}
128
+ {%- endfor %}
129
+ {%- endif %}
130
+ {{- '<|im_end|>\n' }}
131
+ {%- elif message.role == "tool" %}
132
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
133
+ {{- '<|im_start|>user' }}
134
+ {%- endif %}
135
+ {{- '\n<tool_response>\n' }}
136
+ {{- content }}
137
+ {{- '\n</tool_response>' }}
138
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
139
+ {{- '<|im_end|>\n' }}
140
+ {%- elif loop.last %}
141
+ {{- '<|im_end|>\n' }}
142
+ {%- endif %}
143
+ {%- else %}
144
+ {{- raise_exception('Unexpected message role.') }}
145
+ {%- endif %}
146
+ {%- endfor %}
147
+ {%- if add_generation_prompt %}
148
+ {{- '<|im_start|>assistant\n' }}
149
+ {%- if enable_thinking is defined and enable_thinking is false %}
150
+ {{- '<think>\n\n</think>\n\n' }}
151
+ {%- else %}
152
+ {{- '<think>\n' }}
153
+ {%- endif %}
154
+ {%- endif %}
tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523
3
+ size 19989325
tokenizer/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
+ "local_files_only": true,
14
+ "model_max_length": 262144,
15
+ "model_specific_special_tokens": {
16
+ "audio_bos_token": "<|audio_start|>",
17
+ "audio_eos_token": "<|audio_end|>",
18
+ "audio_token": "<|audio_pad|>",
19
+ "image_token": "<|image_pad|>",
20
+ "video_token": "<|video_pad|>",
21
+ "vision_bos_token": "<|vision_start|>",
22
+ "vision_eos_token": "<|vision_end|>"
23
+ },
24
+ "pad_token": "<|endoftext|>",
25
+ "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+",
26
+ "split_special_tokens": false,
27
+ "tokenizer_class": "Qwen2Tokenizer",
28
+ "unk_token": null,
29
+ "video_token": "<|video_pad|>",
30
+ "vision_bos_token": "<|vision_start|>",
31
+ "vision_eos_token": "<|vision_end|>"
32
+ }
transformer/config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MOSSImageTransformer2DModel",
3
+ "_diffusers_version": "0.41.0.dev0",
4
+ "attention_head_dim": 128,
5
+ "ffn_dim": 8192,
6
+ "in_channels": 128,
7
+ "num_attention_heads": 24,
8
+ "num_layers": 42,
9
+ "num_refiner_layers": 2,
10
+ "rope_theta": 10000.0,
11
+ "text_embed_dim": 4096,
12
+ "timestep_embed_dim": 256
13
+ }
transformer/diffusion_pytorch_model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fb54fb6c20195e177d80ddbfc5b72a9d0d8f4fca171acd95381d07cf3c6dcf0
3
+ size 4991980336
transformer/diffusion_pytorch_model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e2061d3dcb25e4fa3686e486f4ee85853054a0b87b996cb5c83fa571ee39ae1
3
+ size 4983139792
transformer/diffusion_pytorch_model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1a535dc8a3fc6fc1d71027c2a643d28d791064f1a73c42b20dc9c06d6fe775a
3
+ size 189549160
transformer/diffusion_pytorch_model.safetensors.index.json ADDED
@@ -0,0 +1,469 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 10164617216
4
+ },
5
+ "weight_map": {
6
+ "block_modulation.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
7
+ "block_modulation.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
8
+ "context_embedder.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
9
+ "context_embedder.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
10
+ "context_refiner.0.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
11
+ "context_refiner.0.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
12
+ "context_refiner.0.attn.to_out.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
13
+ "context_refiner.0.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
14
+ "context_refiner.0.attn.to_qkv.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
15
+ "context_refiner.0.attn.to_qkv.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
16
+ "context_refiner.0.ff_down.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
17
+ "context_refiner.0.ff_down.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
18
+ "context_refiner.0.ff_gate.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
19
+ "context_refiner.0.ff_gate.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
20
+ "context_refiner.0.ff_up.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
21
+ "context_refiner.0.ff_up.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
22
+ "context_refiner.0.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
23
+ "context_refiner.0.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
24
+ "context_refiner.1.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
25
+ "context_refiner.1.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
26
+ "context_refiner.1.attn.to_out.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
27
+ "context_refiner.1.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
28
+ "context_refiner.1.attn.to_qkv.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
29
+ "context_refiner.1.attn.to_qkv.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
30
+ "context_refiner.1.ff_down.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
31
+ "context_refiner.1.ff_down.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
32
+ "context_refiner.1.ff_gate.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
33
+ "context_refiner.1.ff_gate.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
34
+ "context_refiner.1.ff_up.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
35
+ "context_refiner.1.ff_up.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
36
+ "context_refiner.1.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
37
+ "context_refiner.1.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
38
+ "norm_out.weight": "diffusion_pytorch_model-00003-of-00003.safetensors",
39
+ "norm_out_modulation.bias": "diffusion_pytorch_model-00003-of-00003.safetensors",
40
+ "norm_out_modulation.weight": "diffusion_pytorch_model-00003-of-00003.safetensors",
41
+ "proj_out.weight": "diffusion_pytorch_model-00003-of-00003.safetensors",
42
+ "time_embedder.linear_1.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
43
+ "time_embedder.linear_1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
44
+ "time_embedder.linear_2.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
45
+ "time_embedder.linear_2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
46
+ "transformer_blocks.0.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
47
+ "transformer_blocks.0.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
48
+ "transformer_blocks.0.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
49
+ "transformer_blocks.0.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
50
+ "transformer_blocks.0.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
51
+ "transformer_blocks.0.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
52
+ "transformer_blocks.0.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
53
+ "transformer_blocks.0.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
54
+ "transformer_blocks.0.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
55
+ "transformer_blocks.0.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
56
+ "transformer_blocks.1.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
57
+ "transformer_blocks.1.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
58
+ "transformer_blocks.1.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
59
+ "transformer_blocks.1.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
60
+ "transformer_blocks.1.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
61
+ "transformer_blocks.1.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
62
+ "transformer_blocks.1.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
63
+ "transformer_blocks.1.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
64
+ "transformer_blocks.1.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
65
+ "transformer_blocks.1.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
66
+ "transformer_blocks.10.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
67
+ "transformer_blocks.10.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
68
+ "transformer_blocks.10.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
69
+ "transformer_blocks.10.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
70
+ "transformer_blocks.10.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
71
+ "transformer_blocks.10.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
72
+ "transformer_blocks.10.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
73
+ "transformer_blocks.10.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
74
+ "transformer_blocks.10.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
75
+ "transformer_blocks.10.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
76
+ "transformer_blocks.11.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
77
+ "transformer_blocks.11.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
78
+ "transformer_blocks.11.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
79
+ "transformer_blocks.11.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
80
+ "transformer_blocks.11.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
81
+ "transformer_blocks.11.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
82
+ "transformer_blocks.11.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
83
+ "transformer_blocks.11.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
84
+ "transformer_blocks.11.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
85
+ "transformer_blocks.11.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
86
+ "transformer_blocks.12.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
87
+ "transformer_blocks.12.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
88
+ "transformer_blocks.12.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
89
+ "transformer_blocks.12.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
90
+ "transformer_blocks.12.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
91
+ "transformer_blocks.12.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
92
+ "transformer_blocks.12.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
93
+ "transformer_blocks.12.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
94
+ "transformer_blocks.12.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
95
+ "transformer_blocks.12.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
96
+ "transformer_blocks.13.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
97
+ "transformer_blocks.13.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
98
+ "transformer_blocks.13.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
99
+ "transformer_blocks.13.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
100
+ "transformer_blocks.13.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
101
+ "transformer_blocks.13.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
102
+ "transformer_blocks.13.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
103
+ "transformer_blocks.13.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
104
+ "transformer_blocks.13.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
105
+ "transformer_blocks.13.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
106
+ "transformer_blocks.14.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
107
+ "transformer_blocks.14.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
108
+ "transformer_blocks.14.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
109
+ "transformer_blocks.14.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
110
+ "transformer_blocks.14.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
111
+ "transformer_blocks.14.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
112
+ "transformer_blocks.14.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
113
+ "transformer_blocks.14.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
114
+ "transformer_blocks.14.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
115
+ "transformer_blocks.14.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
116
+ "transformer_blocks.15.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
117
+ "transformer_blocks.15.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
118
+ "transformer_blocks.15.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
119
+ "transformer_blocks.15.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
120
+ "transformer_blocks.15.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
121
+ "transformer_blocks.15.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
122
+ "transformer_blocks.15.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
123
+ "transformer_blocks.15.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
124
+ "transformer_blocks.15.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
125
+ "transformer_blocks.15.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
126
+ "transformer_blocks.16.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
127
+ "transformer_blocks.16.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
128
+ "transformer_blocks.16.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
129
+ "transformer_blocks.16.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
130
+ "transformer_blocks.16.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
131
+ "transformer_blocks.16.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
132
+ "transformer_blocks.16.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
133
+ "transformer_blocks.16.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
134
+ "transformer_blocks.16.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
135
+ "transformer_blocks.16.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
136
+ "transformer_blocks.17.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
137
+ "transformer_blocks.17.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
138
+ "transformer_blocks.17.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
139
+ "transformer_blocks.17.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
140
+ "transformer_blocks.17.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
141
+ "transformer_blocks.17.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
142
+ "transformer_blocks.17.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
143
+ "transformer_blocks.17.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
144
+ "transformer_blocks.17.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
145
+ "transformer_blocks.17.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
146
+ "transformer_blocks.18.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
147
+ "transformer_blocks.18.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
148
+ "transformer_blocks.18.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
149
+ "transformer_blocks.18.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
150
+ "transformer_blocks.18.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
151
+ "transformer_blocks.18.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
152
+ "transformer_blocks.18.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
153
+ "transformer_blocks.18.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
154
+ "transformer_blocks.18.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
155
+ "transformer_blocks.18.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
156
+ "transformer_blocks.19.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
157
+ "transformer_blocks.19.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
158
+ "transformer_blocks.19.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
159
+ "transformer_blocks.19.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
160
+ "transformer_blocks.19.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
161
+ "transformer_blocks.19.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
162
+ "transformer_blocks.19.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
163
+ "transformer_blocks.19.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
164
+ "transformer_blocks.19.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
165
+ "transformer_blocks.19.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
166
+ "transformer_blocks.2.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
167
+ "transformer_blocks.2.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
168
+ "transformer_blocks.2.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
169
+ "transformer_blocks.2.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
170
+ "transformer_blocks.2.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
171
+ "transformer_blocks.2.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
172
+ "transformer_blocks.2.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
173
+ "transformer_blocks.2.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
174
+ "transformer_blocks.2.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
175
+ "transformer_blocks.2.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
176
+ "transformer_blocks.20.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
177
+ "transformer_blocks.20.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
178
+ "transformer_blocks.20.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
179
+ "transformer_blocks.20.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
180
+ "transformer_blocks.20.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
181
+ "transformer_blocks.20.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
182
+ "transformer_blocks.20.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
183
+ "transformer_blocks.20.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
184
+ "transformer_blocks.20.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
185
+ "transformer_blocks.20.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
186
+ "transformer_blocks.21.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
187
+ "transformer_blocks.21.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
188
+ "transformer_blocks.21.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
189
+ "transformer_blocks.21.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
190
+ "transformer_blocks.21.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
191
+ "transformer_blocks.21.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
192
+ "transformer_blocks.21.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
193
+ "transformer_blocks.21.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
194
+ "transformer_blocks.21.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
195
+ "transformer_blocks.21.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
196
+ "transformer_blocks.22.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
197
+ "transformer_blocks.22.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
198
+ "transformer_blocks.22.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
199
+ "transformer_blocks.22.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
200
+ "transformer_blocks.22.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
201
+ "transformer_blocks.22.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
202
+ "transformer_blocks.22.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
203
+ "transformer_blocks.22.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
204
+ "transformer_blocks.22.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
205
+ "transformer_blocks.22.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
206
+ "transformer_blocks.23.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
207
+ "transformer_blocks.23.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
208
+ "transformer_blocks.23.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
209
+ "transformer_blocks.23.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
210
+ "transformer_blocks.23.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
211
+ "transformer_blocks.23.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
212
+ "transformer_blocks.23.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
213
+ "transformer_blocks.23.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
214
+ "transformer_blocks.23.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
215
+ "transformer_blocks.23.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
216
+ "transformer_blocks.24.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
217
+ "transformer_blocks.24.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
218
+ "transformer_blocks.24.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
219
+ "transformer_blocks.24.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
220
+ "transformer_blocks.24.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
221
+ "transformer_blocks.24.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
222
+ "transformer_blocks.24.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
223
+ "transformer_blocks.24.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
224
+ "transformer_blocks.24.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
225
+ "transformer_blocks.24.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
226
+ "transformer_blocks.25.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
227
+ "transformer_blocks.25.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
228
+ "transformer_blocks.25.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
229
+ "transformer_blocks.25.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
230
+ "transformer_blocks.25.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
231
+ "transformer_blocks.25.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
232
+ "transformer_blocks.25.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
233
+ "transformer_blocks.25.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
234
+ "transformer_blocks.25.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
235
+ "transformer_blocks.25.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
236
+ "transformer_blocks.26.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
237
+ "transformer_blocks.26.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
238
+ "transformer_blocks.26.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
239
+ "transformer_blocks.26.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
240
+ "transformer_blocks.26.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
241
+ "transformer_blocks.26.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
242
+ "transformer_blocks.26.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
243
+ "transformer_blocks.26.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
244
+ "transformer_blocks.26.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
245
+ "transformer_blocks.26.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
246
+ "transformer_blocks.27.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
247
+ "transformer_blocks.27.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
248
+ "transformer_blocks.27.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
249
+ "transformer_blocks.27.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
250
+ "transformer_blocks.27.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
251
+ "transformer_blocks.27.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
252
+ "transformer_blocks.27.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
253
+ "transformer_blocks.27.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
254
+ "transformer_blocks.27.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
255
+ "transformer_blocks.27.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
256
+ "transformer_blocks.28.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
257
+ "transformer_blocks.28.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
258
+ "transformer_blocks.28.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
259
+ "transformer_blocks.28.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
260
+ "transformer_blocks.28.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
261
+ "transformer_blocks.28.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
262
+ "transformer_blocks.28.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
263
+ "transformer_blocks.28.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
264
+ "transformer_blocks.28.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
265
+ "transformer_blocks.28.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
266
+ "transformer_blocks.29.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
267
+ "transformer_blocks.29.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
268
+ "transformer_blocks.29.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
269
+ "transformer_blocks.29.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
270
+ "transformer_blocks.29.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
271
+ "transformer_blocks.29.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
272
+ "transformer_blocks.29.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
273
+ "transformer_blocks.29.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
274
+ "transformer_blocks.29.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
275
+ "transformer_blocks.29.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
276
+ "transformer_blocks.3.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
277
+ "transformer_blocks.3.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
278
+ "transformer_blocks.3.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
279
+ "transformer_blocks.3.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
280
+ "transformer_blocks.3.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
281
+ "transformer_blocks.3.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
282
+ "transformer_blocks.3.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
283
+ "transformer_blocks.3.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
284
+ "transformer_blocks.3.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
285
+ "transformer_blocks.3.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
286
+ "transformer_blocks.30.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
287
+ "transformer_blocks.30.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
288
+ "transformer_blocks.30.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
289
+ "transformer_blocks.30.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
290
+ "transformer_blocks.30.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
291
+ "transformer_blocks.30.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
292
+ "transformer_blocks.30.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
293
+ "transformer_blocks.30.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
294
+ "transformer_blocks.30.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
295
+ "transformer_blocks.30.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
296
+ "transformer_blocks.31.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
297
+ "transformer_blocks.31.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
298
+ "transformer_blocks.31.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
299
+ "transformer_blocks.31.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
300
+ "transformer_blocks.31.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
301
+ "transformer_blocks.31.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
302
+ "transformer_blocks.31.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
303
+ "transformer_blocks.31.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
304
+ "transformer_blocks.31.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
305
+ "transformer_blocks.31.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
306
+ "transformer_blocks.32.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
307
+ "transformer_blocks.32.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
308
+ "transformer_blocks.32.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
309
+ "transformer_blocks.32.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
310
+ "transformer_blocks.32.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
311
+ "transformer_blocks.32.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
312
+ "transformer_blocks.32.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
313
+ "transformer_blocks.32.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
314
+ "transformer_blocks.32.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
315
+ "transformer_blocks.32.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
316
+ "transformer_blocks.33.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
317
+ "transformer_blocks.33.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
318
+ "transformer_blocks.33.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
319
+ "transformer_blocks.33.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
320
+ "transformer_blocks.33.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
321
+ "transformer_blocks.33.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
322
+ "transformer_blocks.33.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
323
+ "transformer_blocks.33.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
324
+ "transformer_blocks.33.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
325
+ "transformer_blocks.33.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
326
+ "transformer_blocks.34.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
327
+ "transformer_blocks.34.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
328
+ "transformer_blocks.34.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
329
+ "transformer_blocks.34.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
330
+ "transformer_blocks.34.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
331
+ "transformer_blocks.34.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
332
+ "transformer_blocks.34.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
333
+ "transformer_blocks.34.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
334
+ "transformer_blocks.34.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
335
+ "transformer_blocks.34.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
336
+ "transformer_blocks.35.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
337
+ "transformer_blocks.35.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
338
+ "transformer_blocks.35.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
339
+ "transformer_blocks.35.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
340
+ "transformer_blocks.35.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
341
+ "transformer_blocks.35.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
342
+ "transformer_blocks.35.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
343
+ "transformer_blocks.35.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
344
+ "transformer_blocks.35.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
345
+ "transformer_blocks.35.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
346
+ "transformer_blocks.36.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
347
+ "transformer_blocks.36.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
348
+ "transformer_blocks.36.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
349
+ "transformer_blocks.36.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
350
+ "transformer_blocks.36.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
351
+ "transformer_blocks.36.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
352
+ "transformer_blocks.36.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
353
+ "transformer_blocks.36.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
354
+ "transformer_blocks.36.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
355
+ "transformer_blocks.36.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
356
+ "transformer_blocks.37.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
357
+ "transformer_blocks.37.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
358
+ "transformer_blocks.37.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
359
+ "transformer_blocks.37.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
360
+ "transformer_blocks.37.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
361
+ "transformer_blocks.37.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
362
+ "transformer_blocks.37.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
363
+ "transformer_blocks.37.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
364
+ "transformer_blocks.37.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
365
+ "transformer_blocks.37.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
366
+ "transformer_blocks.38.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
367
+ "transformer_blocks.38.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
368
+ "transformer_blocks.38.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
369
+ "transformer_blocks.38.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
370
+ "transformer_blocks.38.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
371
+ "transformer_blocks.38.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
372
+ "transformer_blocks.38.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
373
+ "transformer_blocks.38.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
374
+ "transformer_blocks.38.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
375
+ "transformer_blocks.38.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
376
+ "transformer_blocks.39.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
377
+ "transformer_blocks.39.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
378
+ "transformer_blocks.39.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
379
+ "transformer_blocks.39.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
380
+ "transformer_blocks.39.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
381
+ "transformer_blocks.39.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
382
+ "transformer_blocks.39.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
383
+ "transformer_blocks.39.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
384
+ "transformer_blocks.39.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
385
+ "transformer_blocks.39.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
386
+ "transformer_blocks.4.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
387
+ "transformer_blocks.4.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
388
+ "transformer_blocks.4.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
389
+ "transformer_blocks.4.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
390
+ "transformer_blocks.4.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
391
+ "transformer_blocks.4.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
392
+ "transformer_blocks.4.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
393
+ "transformer_blocks.4.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
394
+ "transformer_blocks.4.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
395
+ "transformer_blocks.4.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
396
+ "transformer_blocks.40.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
397
+ "transformer_blocks.40.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
398
+ "transformer_blocks.40.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
399
+ "transformer_blocks.40.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
400
+ "transformer_blocks.40.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
401
+ "transformer_blocks.40.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
402
+ "transformer_blocks.40.ff_in.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
403
+ "transformer_blocks.40.ff_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
404
+ "transformer_blocks.40.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
405
+ "transformer_blocks.40.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
406
+ "transformer_blocks.41.attn.norm_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
407
+ "transformer_blocks.41.attn.norm_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
408
+ "transformer_blocks.41.attn.to_k.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
409
+ "transformer_blocks.41.attn.to_out.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
410
+ "transformer_blocks.41.attn.to_q.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
411
+ "transformer_blocks.41.attn.to_v.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
412
+ "transformer_blocks.41.ff_in.weight": "diffusion_pytorch_model-00003-of-00003.safetensors",
413
+ "transformer_blocks.41.ff_out.weight": "diffusion_pytorch_model-00003-of-00003.safetensors",
414
+ "transformer_blocks.41.norm1.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
415
+ "transformer_blocks.41.norm2.weight": "diffusion_pytorch_model-00002-of-00003.safetensors",
416
+ "transformer_blocks.5.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
417
+ "transformer_blocks.5.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
418
+ "transformer_blocks.5.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
419
+ "transformer_blocks.5.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
420
+ "transformer_blocks.5.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
421
+ "transformer_blocks.5.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
422
+ "transformer_blocks.5.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
423
+ "transformer_blocks.5.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
424
+ "transformer_blocks.5.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
425
+ "transformer_blocks.5.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
426
+ "transformer_blocks.6.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
427
+ "transformer_blocks.6.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
428
+ "transformer_blocks.6.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
429
+ "transformer_blocks.6.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
430
+ "transformer_blocks.6.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
431
+ "transformer_blocks.6.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
432
+ "transformer_blocks.6.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
433
+ "transformer_blocks.6.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
434
+ "transformer_blocks.6.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
435
+ "transformer_blocks.6.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
436
+ "transformer_blocks.7.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
437
+ "transformer_blocks.7.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
438
+ "transformer_blocks.7.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
439
+ "transformer_blocks.7.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
440
+ "transformer_blocks.7.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
441
+ "transformer_blocks.7.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
442
+ "transformer_blocks.7.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
443
+ "transformer_blocks.7.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
444
+ "transformer_blocks.7.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
445
+ "transformer_blocks.7.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
446
+ "transformer_blocks.8.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
447
+ "transformer_blocks.8.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
448
+ "transformer_blocks.8.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
449
+ "transformer_blocks.8.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
450
+ "transformer_blocks.8.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
451
+ "transformer_blocks.8.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
452
+ "transformer_blocks.8.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
453
+ "transformer_blocks.8.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
454
+ "transformer_blocks.8.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
455
+ "transformer_blocks.8.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
456
+ "transformer_blocks.9.attn.norm_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
457
+ "transformer_blocks.9.attn.norm_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
458
+ "transformer_blocks.9.attn.to_k.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
459
+ "transformer_blocks.9.attn.to_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
460
+ "transformer_blocks.9.attn.to_q.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
461
+ "transformer_blocks.9.attn.to_v.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
462
+ "transformer_blocks.9.ff_in.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
463
+ "transformer_blocks.9.ff_out.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
464
+ "transformer_blocks.9.norm1.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
465
+ "transformer_blocks.9.norm2.weight": "diffusion_pytorch_model-00001-of-00003.safetensors",
466
+ "x_embedder.bias": "diffusion_pytorch_model-00001-of-00003.safetensors",
467
+ "x_embedder.weight": "diffusion_pytorch_model-00001-of-00003.safetensors"
468
+ }
469
+ }
transformer/transformer_moss_image.py ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2026 OpenMOSS and The HuggingFace Team. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from typing import Any
16
+
17
+ import torch
18
+ import torch.nn as nn
19
+
20
+ from diffusers.configuration_utils import ConfigMixin, register_to_config
21
+ from diffusers.loaders import PeftAdapterMixin
22
+ from diffusers.models.attention import AttentionMixin, AttentionModuleMixin
23
+ from diffusers.models.attention_dispatch import dispatch_attention_fn
24
+ from diffusers.models.embeddings import TimestepEmbedding
25
+ from diffusers.models.modeling_outputs import Transformer2DModelOutput
26
+ from diffusers.models.modeling_utils import ModelMixin
27
+ from diffusers.models.normalization import RMSNorm
28
+ from diffusers.utils import apply_lora_scale
29
+ from diffusers.utils.torch_utils import maybe_adjust_dtype_for_device
30
+
31
+
32
+ def situ(hidden_states: torch.Tensor, gate: torch.Tensor) -> torch.Tensor:
33
+ """Gated activation of the MOSS-Image feed-forward layers, with the gate and the value soft-clamped by tanh."""
34
+ return (4.0 * torch.tanh(gate / 4.0) * torch.sigmoid(gate)) * (25.0 * torch.tanh(hidden_states / 25.0))
35
+
36
+
37
+ def apply_rotary_emb(hidden_states: torch.Tensor, freqs_cos: torch.Tensor, freqs_sin: torch.Tensor) -> torch.Tensor:
38
+ """Rotate-half RoPE, computed in the dtype of `hidden_states` like the original model."""
39
+ x1, x2 = hidden_states.chunk(2, dim=-1)
40
+ return hidden_states * freqs_cos + torch.cat((-x2, x1), dim=-1) * freqs_sin
41
+
42
+
43
+ class MOSSImageAttnProcessor:
44
+ _attention_backend = None
45
+ _parallel_config = None
46
+
47
+ def __call__(
48
+ self,
49
+ attn: "MOSSImageAttention",
50
+ hidden_states: torch.Tensor,
51
+ freqs_cos: torch.Tensor,
52
+ freqs_sin: torch.Tensor,
53
+ ) -> torch.Tensor:
54
+ if attn.to_qkv is not None:
55
+ query, key, value = attn.to_qkv(hidden_states).chunk(3, dim=-1)
56
+ else:
57
+ query = attn.to_q(hidden_states)
58
+ key = attn.to_k(hidden_states)
59
+ value = attn.to_v(hidden_states)
60
+
61
+ query = attn.norm_q(query.unflatten(-1, (attn.heads, -1)))
62
+ key = attn.norm_k(key.unflatten(-1, (attn.heads, -1)))
63
+ value = value.unflatten(-1, (attn.heads, -1))
64
+
65
+ query = apply_rotary_emb(query, freqs_cos, freqs_sin)
66
+ key = apply_rotary_emb(key, freqs_cos, freqs_sin)
67
+
68
+ hidden_states = dispatch_attention_fn(
69
+ query.to(value.dtype),
70
+ key.to(value.dtype),
71
+ value,
72
+ backend=self._attention_backend,
73
+ parallel_config=self._parallel_config,
74
+ )
75
+ hidden_states = hidden_states.flatten(2, 3)
76
+ return attn.to_out(hidden_states)
77
+
78
+
79
+ class MOSSImageAttention(nn.Module, AttentionModuleMixin):
80
+ _default_processor_cls = MOSSImageAttnProcessor
81
+ _available_processors = [MOSSImageAttnProcessor]
82
+
83
+ def __init__(self, dim: int, heads: int, bias: bool, fused_qkv: bool, eps: float = 1e-6):
84
+ super().__init__()
85
+ self.heads = heads
86
+ head_dim = dim // heads
87
+
88
+ # The text refiner blocks use one fused, biased qkv projection; the main blocks use three unbiased ones.
89
+ if fused_qkv:
90
+ self.to_qkv = nn.Linear(dim, 3 * dim, bias=bias)
91
+ self.to_q = self.to_k = self.to_v = None
92
+ else:
93
+ self.to_qkv = None
94
+ self.to_q = nn.Linear(dim, dim, bias=bias)
95
+ self.to_k = nn.Linear(dim, dim, bias=bias)
96
+ self.to_v = nn.Linear(dim, dim, bias=bias)
97
+ self.norm_q = RMSNorm(head_dim, eps=eps)
98
+ self.norm_k = RMSNorm(head_dim, eps=eps)
99
+ self.to_out = nn.Linear(dim, dim, bias=bias)
100
+
101
+ self.set_processor(self._default_processor_cls())
102
+
103
+ def forward(self, hidden_states: torch.Tensor, freqs_cos: torch.Tensor, freqs_sin: torch.Tensor) -> torch.Tensor:
104
+ return self.processor(self, hidden_states, freqs_cos, freqs_sin)
105
+
106
+
107
+ class MOSSImageTextRefinerBlock(nn.Module):
108
+ """Unmodulated transformer block that refines the text-encoder states before the joint blocks."""
109
+
110
+ def __init__(self, dim: int, ffn_dim: int, num_attention_heads: int, eps: float = 1e-6):
111
+ super().__init__()
112
+ self.norm1 = RMSNorm(dim, eps=eps)
113
+ self.attn = MOSSImageAttention(dim, num_attention_heads, bias=True, fused_qkv=True, eps=eps)
114
+ self.norm2 = RMSNorm(dim, eps=eps)
115
+ self.ff_gate = nn.Linear(dim, ffn_dim)
116
+ self.ff_up = nn.Linear(dim, ffn_dim)
117
+ self.ff_down = nn.Linear(ffn_dim, dim)
118
+
119
+ def forward(self, hidden_states: torch.Tensor, freqs_cos: torch.Tensor, freqs_sin: torch.Tensor) -> torch.Tensor:
120
+ hidden_states = hidden_states + self.attn(self.norm1(hidden_states), freqs_cos, freqs_sin)
121
+ norm_hidden_states = self.norm2(hidden_states)
122
+ ff_output = self.ff_down(situ(self.ff_up(norm_hidden_states), self.ff_gate(norm_hidden_states)))
123
+ return hidden_states + ff_output
124
+
125
+
126
+ class MOSSImageTransformerBlock(nn.Module):
127
+ """Single-stream block over the concatenated image and text tokens, modulated by the shared timestep embedding."""
128
+
129
+ def __init__(self, dim: int, ffn_dim: int, num_attention_heads: int, eps: float = 1e-6):
130
+ super().__init__()
131
+ self.norm1 = RMSNorm(dim, eps=eps)
132
+ self.attn = MOSSImageAttention(dim, num_attention_heads, bias=False, fused_qkv=False, eps=eps)
133
+ self.norm2 = RMSNorm(dim, eps=eps)
134
+ self.ff_in = nn.Linear(dim, 2 * ffn_dim, bias=False)
135
+ self.ff_out = nn.Linear(ffn_dim, dim, bias=False)
136
+
137
+ def forward(
138
+ self,
139
+ hidden_states: torch.Tensor,
140
+ modulation: torch.Tensor,
141
+ freqs_cos: torch.Tensor,
142
+ freqs_sin: torch.Tensor,
143
+ ) -> torch.Tensor:
144
+ shift_msa, scale_msa, gate_msa, shift_mlp, scale_mlp, gate_mlp = modulation.unbind(1)
145
+
146
+ norm_hidden_states = self.norm1(hidden_states) * (1 + scale_msa[:, None]) + shift_msa[:, None]
147
+ attn_output = self.attn(norm_hidden_states, freqs_cos, freqs_sin)
148
+ hidden_states = hidden_states + attn_output * gate_msa[:, None]
149
+
150
+ norm_hidden_states = self.norm2(hidden_states) * (1 + scale_mlp[:, None]) + shift_mlp[:, None]
151
+ ff_hidden_states, ff_gate = self.ff_in(norm_hidden_states).chunk(2, dim=-1)
152
+ ff_output = self.ff_out(situ(ff_hidden_states, ff_gate))
153
+ return hidden_states + ff_output * gate_mlp[:, None]
154
+
155
+
156
+ class MOSSImageRotaryPosEmbed(nn.Module):
157
+ """4-axis RoPE over `(unused, frame, height, width)` coordinates.
158
+
159
+ Image tokens sit at frame `text_seq_len` on a grid centered at zero; text token `i` sits at frame `i`. Each axis
160
+ uses `head_dim // 8` frequencies, built in float32 on the CPU like the original model.
161
+ """
162
+
163
+ def __init__(self, head_dim: int, theta: float):
164
+ super().__init__()
165
+ self.num_bands = head_dim // 8
166
+ self.theta = theta
167
+
168
+ def forward(self, height: int, width: int, text_seq_len: int, device: torch.device):
169
+ exponent = torch.arange(self.num_bands, dtype=torch.float32) / self.num_bands
170
+ bands = (1 / (self.theta**exponent)).to(device)
171
+
172
+ grid_h, grid_w = torch.meshgrid(
173
+ torch.arange(height, device=device), torch.arange(width, device=device), indexing="ij"
174
+ )
175
+ image_ids = torch.stack(
176
+ (torch.zeros_like(grid_h), torch.full_like(grid_h, text_seq_len), grid_h, grid_w), dim=-1
177
+ )
178
+ image_ids = image_ids.flatten(0, 1).float()
179
+ image_ids[:, 2] -= (height - 1) / 2
180
+ image_ids[:, 3] -= (width - 1) / 2
181
+ text_ids = torch.zeros(text_seq_len, 4, device=device, dtype=torch.float32)
182
+ text_ids[:, 1] = torch.arange(text_seq_len, device=device)
183
+
184
+ phase = (torch.cat((image_ids, text_ids), dim=0).unsqueeze(-1) * bands).flatten(1)
185
+ phase = torch.cat((phase, phase), dim=-1)
186
+ # (1, seq_len, 1, head_dim), broadcast over the attention heads
187
+ return phase.cos()[None, :, None], phase.sin()[None, :, None]
188
+
189
+
190
+ class MOSSImageTransformer2DModel(ModelMixin, ConfigMixin, PeftAdapterMixin, AttentionMixin):
191
+ r"""
192
+ The MOSS-Image diffusion transformer.
193
+
194
+ Image tokens are the FLUX.2 VAE latents (patchified to 128 channels at 1/16 of the image resolution). The text
195
+ states pass through `num_refiner_layers` unmodulated blocks, then image and text tokens go through `num_layers`
196
+ single-stream blocks, all modulated by one projection of the timestep embedding. Each sample runs at its own text
197
+ length, so prompts are never padded.
198
+
199
+ Args:
200
+ in_channels (`int`, defaults to `128`): Channels of the patchified latents.
201
+ num_layers (`int`, defaults to `42`): Number of single-stream transformer blocks.
202
+ num_refiner_layers (`int`, defaults to `2`): Number of text refiner blocks.
203
+ num_attention_heads (`int`, defaults to `24`): Number of attention heads.
204
+ attention_head_dim (`int`, defaults to `128`): Dimension of each attention head.
205
+ ffn_dim (`int`, defaults to `8192`): Hidden dimension of the feed-forward layers.
206
+ text_embed_dim (`int`, defaults to `4096`): Dimension of the text-encoder states.
207
+ timestep_embed_dim (`int`, defaults to `256`): Dimension of the sinusoidal timestep embedding.
208
+ rope_theta (`float`, defaults to `10000.0`): Base of the RoPE frequencies.
209
+ """
210
+
211
+ _supports_gradient_checkpointing = True
212
+ _no_split_modules = ["MOSSImageTransformerBlock", "MOSSImageTextRefinerBlock"]
213
+ _repeated_blocks = ["MOSSImageTransformerBlock", "MOSSImageTextRefinerBlock"]
214
+ _skip_layerwise_casting_patterns = ["norm"]
215
+
216
+ @register_to_config
217
+ def __init__(
218
+ self,
219
+ in_channels: int = 128,
220
+ num_layers: int = 42,
221
+ num_refiner_layers: int = 2,
222
+ num_attention_heads: int = 24,
223
+ attention_head_dim: int = 128,
224
+ ffn_dim: int = 8192,
225
+ text_embed_dim: int = 4096,
226
+ timestep_embed_dim: int = 256,
227
+ rope_theta: float = 10000.0,
228
+ ):
229
+ super().__init__()
230
+ inner_dim = num_attention_heads * attention_head_dim
231
+
232
+ self.rope = MOSSImageRotaryPosEmbed(attention_head_dim, rope_theta)
233
+ self.x_embedder = nn.Linear(in_channels, inner_dim)
234
+ self.context_embedder = nn.Linear(text_embed_dim, inner_dim)
235
+ self.context_refiner = nn.ModuleList(
236
+ [MOSSImageTextRefinerBlock(inner_dim, ffn_dim, num_attention_heads) for _ in range(num_refiner_layers)]
237
+ )
238
+ self.time_embedder = TimestepEmbedding(timestep_embed_dim, inner_dim)
239
+ self.block_modulation = nn.Linear(inner_dim, 6 * inner_dim)
240
+ self.transformer_blocks = nn.ModuleList(
241
+ [MOSSImageTransformerBlock(inner_dim, ffn_dim, num_attention_heads) for _ in range(num_layers)]
242
+ )
243
+ self.norm_out = RMSNorm(inner_dim, eps=1e-6)
244
+ self.norm_out_modulation = nn.Linear(inner_dim, 2 * inner_dim)
245
+ self.proj_out = nn.Linear(inner_dim, in_channels, bias=False)
246
+
247
+ self.gradient_checkpointing = False
248
+
249
+ def timestep_embedding(self, timestep: torch.Tensor) -> torch.Tensor:
250
+ # cos first, then sin; float64 where the device supports it, like the original model
251
+ half = self.config.timestep_embed_dim // 2
252
+ freqs_dtype = maybe_adjust_dtype_for_device(torch.float64, timestep.device)
253
+ freqs = 10000 ** (-torch.arange(half, device=timestep.device, dtype=freqs_dtype) / half)
254
+ phase = timestep.to(freqs_dtype)[:, None] * freqs
255
+ return torch.cat((phase.cos(), phase.sin()), dim=-1).float()
256
+
257
+ @apply_lora_scale("attention_kwargs")
258
+ def forward(
259
+ self,
260
+ hidden_states: torch.Tensor,
261
+ timestep: torch.Tensor,
262
+ encoder_hidden_states: list[torch.Tensor],
263
+ skip_layers: list[int] | None = None,
264
+ attention_kwargs: dict[str, Any] | None = None,
265
+ return_dict: bool = True,
266
+ ) -> torch.Tensor | Transformer2DModelOutput:
267
+ r"""
268
+ Args:
269
+ hidden_states (`torch.Tensor`):
270
+ Patchified latents of shape `(batch_size, in_channels, height, width)`.
271
+ timestep (`torch.Tensor`):
272
+ Timesteps on the `[0, 1000]` scale, a scalar or one per sample.
273
+ encoder_hidden_states (`list[torch.Tensor]`):
274
+ Unpadded text-encoder states, one `(text_seq_len, text_embed_dim)` tensor per sample.
275
+ skip_layers (`list[int]`, *optional*):
276
+ Indices of the transformer blocks to skip.
277
+ attention_kwargs (`dict`, *optional*):
278
+ Extra arguments; `scale` sets the LoRA scale.
279
+ return_dict (`bool`, defaults to `True`):
280
+ Whether to return a [`~models.modeling_outputs.Transformer2DModelOutput`] instead of a tuple.
281
+
282
+ Returns:
283
+ [`~models.modeling_outputs.Transformer2DModelOutput`] or `tuple`: The predicted flow of shape
284
+ `(batch_size, in_channels, height, width)`, as `sample` or as the first element of the tuple.
285
+ """
286
+ batch_size, _, height, width = hidden_states.shape
287
+ if len(encoder_hidden_states) != batch_size:
288
+ raise ValueError(
289
+ f"`encoder_hidden_states` holds {len(encoder_hidden_states)} tensors for a batch of {batch_size}"
290
+ )
291
+ device = hidden_states.device
292
+ image_seq_len = height * width
293
+
294
+ timestep = torch.as_tensor(timestep, device=device).reshape(-1).expand(batch_size)
295
+ temb = self.time_embedder(self.timestep_embedding(timestep).to(hidden_states.dtype))
296
+ modulation = self.block_modulation(temb).view(batch_size, 6, -1)
297
+ shift_out, scale_out = self.norm_out_modulation(temb).view(batch_size, 2, -1).unbind(1)
298
+
299
+ # Image positions depend on each sample's text length, so samples run one at a time
300
+ outputs = []
301
+ for index in range(batch_size):
302
+ text_seq_len = encoder_hidden_states[index].shape[0]
303
+ freqs_cos, freqs_sin = self.rope(height, width, text_seq_len, device)
304
+ freqs_cos, freqs_sin = freqs_cos.to(hidden_states.dtype), freqs_sin.to(hidden_states.dtype)
305
+ text_freqs = (freqs_cos[:, image_seq_len:], freqs_sin[:, image_seq_len:])
306
+
307
+ image_tokens = self.x_embedder(hidden_states[index : index + 1].flatten(2).transpose(1, 2).contiguous())
308
+ text_tokens = self.context_embedder(encoder_hidden_states[index][None])
309
+ for block in self.context_refiner:
310
+ if torch.is_grad_enabled() and self.gradient_checkpointing:
311
+ text_tokens = self._gradient_checkpointing_func(block, text_tokens, *text_freqs)
312
+ else:
313
+ text_tokens = block(text_tokens, *text_freqs)
314
+
315
+ tokens = torch.cat((image_tokens, text_tokens), dim=1)
316
+ sample_modulation = modulation[index : index + 1]
317
+ for block_index, block in enumerate(self.transformer_blocks):
318
+ if skip_layers is not None and block_index in skip_layers:
319
+ continue
320
+ if torch.is_grad_enabled() and self.gradient_checkpointing:
321
+ tokens = self._gradient_checkpointing_func(block, tokens, sample_modulation, freqs_cos, freqs_sin)
322
+ else:
323
+ tokens = block(tokens, sample_modulation, freqs_cos, freqs_sin)
324
+
325
+ image_tokens = self.norm_out(tokens[:, :image_seq_len])
326
+ image_tokens = image_tokens * (1 + scale_out[index : index + 1, None]) + shift_out[index : index + 1, None]
327
+ image_tokens = self.proj_out(image_tokens)
328
+ outputs.append(image_tokens.transpose(1, 2).reshape(1, -1, height, width))
329
+
330
+ output = torch.cat(outputs, dim=0)
331
+ if not return_dict:
332
+ return (output,)
333
+ return Transformer2DModelOutput(sample=output)
vae/config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKLFlux2",
3
+ "_diffusers_version": "0.38.0",
4
+ "act_fn": "silu",
5
+ "batch_norm_eps": 0.0001,
6
+ "batch_norm_momentum": 0.1,
7
+ "block_out_channels": [
8
+ 128,
9
+ 256,
10
+ 512,
11
+ 512
12
+ ],
13
+ "decoder_block_out_channels": [
14
+ 96,
15
+ 192,
16
+ 384,
17
+ 384
18
+ ],
19
+ "down_block_types": [
20
+ "DownEncoderBlock2D",
21
+ "DownEncoderBlock2D",
22
+ "DownEncoderBlock2D",
23
+ "DownEncoderBlock2D"
24
+ ],
25
+ "force_upcast": true,
26
+ "in_channels": 3,
27
+ "latent_channels": 32,
28
+ "layers_per_block": 2,
29
+ "mid_block_add_attention": true,
30
+ "norm_num_groups": 32,
31
+ "out_channels": 3,
32
+ "patch_size": [
33
+ 2,
34
+ 2
35
+ ],
36
+ "sample_size": 1024,
37
+ "up_block_types": [
38
+ "UpDecoderBlock2D",
39
+ "UpDecoderBlock2D",
40
+ "UpDecoderBlock2D",
41
+ "UpDecoderBlock2D"
42
+ ],
43
+ "use_post_quant_conv": true,
44
+ "use_quant_conv": true
45
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3bdf94dc67ec69b30ea9fe1fa8340085679cae64d019f7c7e4a9921f1a7f17a
3
+ size 249521372