taewhan gkalstn0 commited on
Commit
8c56983
·
0 Parent(s):

Motif Vision Encoder release

Browse files

Co-authored-by: gkalstn0 <gkalstn0@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
+ *.gif filter=lfs diff=lfs merge=lfs -text
37
+ assets/architecture.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/dense_attention_comparison.png filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Motif Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: transformers
4
+ pipeline_tag: image-feature-extraction
5
+ tags:
6
+ - motif
7
+ - vision-transformer
8
+ - self-supervised
9
+ - image-feature-extraction
10
+ - video
11
+ - custom_code
12
+ ---
13
+
14
+ # Motif Vision Encoder
15
+
16
+ Motif Vision Encoder is a unified image + video self-supervised vision encoder on a ViT
17
+ backbone. A single 3D-convolutional tokenizer ingests both modalities — an image is a
18
+ 1-frame clip (`T=1`), a video is `T>1` — so the same weights produce dense patch-level
19
+ features and a language-aligned global (CLS) representation.
20
+
21
+ Trained on **~1/3 the data of DINOv3** (0.5B vs 1.7B samples), it still reaches competitive
22
+ performance across image and video benchmarks — and leads on DAVIS video tracking.
23
+
24
+ <p align="center">
25
+ <img src="assets/haaland_attn_blk20.gif" width="480" alt="Point tracking on a video clip: Motif vs V-JEPA 2.1"/>
26
+ </p>
27
+ <p align="center"><em>Point tracking on a video clip (top: Motif, bottom: V-JEPA 2.1) — a query point propagated across frames by patch-feature cosine similarity. Motif tracks the subject more reliably than V-JEPA 2.1.</em></p>
28
+
29
+ - **Architecture**: ViT-7B (embed 4096 / depth 40 / heads 32), patch 16, 3D axial RoPE
30
+ (`base=100`), SwiGLU FFN, LayerScale, per-head QK-norm, gated attention, 4 register tokens.
31
+ - **Tokenizer**: `Conv3d(kernel=stride=(tubelet, patch, patch))` — image `(B,3,H,W)` → `T=1`,
32
+ video `(B,T,3,H,W)`. Token layout `[CLS] + [register × 4] + [patch × N]`.
33
+
34
+
35
+ ## Usage
36
+
37
+ The model ships a self-contained `modeling_motif_vision_encoder.py`, so it loads with `trust_remote_code=True`.
38
+
39
+ ### Image
40
+
41
+ ```python
42
+ import torch
43
+ from transformers import AutoImageProcessor, AutoModel
44
+ from transformers.image_utils import load_image
45
+
46
+ url = "http://images.cocodataset.org/val2017/000000039769.jpg"
47
+ image = load_image(url)
48
+
49
+ repo = "Motif-Technologies/Motif-Vision-Encoder"
50
+ processor = AutoImageProcessor.from_pretrained(repo)
51
+ model = AutoModel.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda").eval()
52
+
53
+ inputs = processor(images=image, return_tensors="pt").to(model.device, torch.bfloat16)
54
+ with torch.inference_mode():
55
+ outputs = model(**inputs)
56
+
57
+ outputs.last_hidden_state # (1, 1 + 4 + N, 4096) CLS + registers + patch tokens
58
+ outputs.pooler_output # (1, 4096) global (CLS) representation
59
+
60
+ patch_tokens = outputs.last_hidden_state[:, 5:, :] # (1, N, 4096), N = (H/16)*(W/16)
61
+ ```
62
+
63
+ The processor resizes the shorter side to 512, center-crops to 512×512, and normalizes with
64
+ ImageNet mean/std (BICUBIC). `H`/`W` must be multiples of 16.
65
+
66
+ ### Video
67
+
68
+ An image is a 1-frame clip; a video is the same call with a `(B, T, 3, H, W)` tensor. Apply the
69
+ same per-frame transform (resize → center-crop → ImageNet norm) and stack over time:
70
+
71
+ ```python
72
+ import torch
73
+
74
+ video = torch.randn(1, 8, 3, 256, 256, device="cuda", dtype=torch.bfloat16) # (B, T, 3, H, W)
75
+ with torch.inference_mode():
76
+ outputs = model(pixel_values=video)
77
+ ```
78
+
79
+ ## Model details
80
+
81
+ <p align="center">
82
+ <img src="assets/architecture.png" width="820" alt="Motif Vision Encoder architecture: image and video inputs, patch embedding, 40-block transformer stack, and transformer block internals"/>
83
+ </p>
84
+
85
+ | | |
86
+ |---|---|
87
+ | Backbone | ViT-7B, patch 16, embed 4096, depth 40, heads 32, SwiGLU |
88
+ | Register tokens | 4 |
89
+ | Position encoding | 3D axial RoPE (T,H,W), `base=100.0` |
90
+ | Video tokenizer | 3D Conv, tubelet size 2 |
91
+ | Precision | bf16 weights |
92
+ | Training | DINO + iBOT + KoLeo self-distillation, Gram anchoring, contrastive caption alignment |
93
+ | Training data | ~0.47B samples — 448.6M images (96%) + 18.5M video clips (4%) |
94
+
95
+ Outputs (`BaseModelOutputWithPooling`): `last_hidden_state` `(B, 1+4+N, 4096)`,
96
+ `pooler_output` `(B, 4096)`.
97
+
98
+ ## Evaluation
99
+
100
+ Compared against the strongest publicly reported self-supervised / vision backbones. Higher is
101
+ better for every column. Best comparable value per column in bold, second best <u>underlined</u>.
102
+
103
+ DAVIS S/M/L follow the DINOv3 protocol (J&F-mean at video short side 420/480, 840/960,
104
+ 1260/1440 px). V-JEPA 2.1 is not part of the DINOv3 Table 5 tracking benchmark, so only its
105
+ single-resolution (S) figure is available.
106
+
107
+ | Model | Training<br>data | DAVIS S<br>J&F ↑ | DAVIS M<br>J&F ↑ | DAVIS L<br>J&F ↑ | ImageNet-1K<br>lin. probe ↑ | ADE20K<br>mIoU ↑ | K400 ↑ |
108
+ |---|---|---|---|---|---|---|---|
109
+ | **Motif Vision Encoder** | 0.5B | **74.0** | **80.5** | **83.5** | 87.4 | <u>52.0</u> | 87.4 |
110
+ | DINOv3 | 1.7B | <u>71.1</u> | <u>79.7</u> | <u>83.3</u> | 88.4 | **55.9** | <u>87.8</u> |
111
+ | Web-DINO | 2B | 57.2 | 65.8 | 69.5 | 85.9 | 42.7 | 86.8 |
112
+ | PEcore | 5.4B | 48.2 | 53.1 | 49.8 | **89.3** | 38.9 | **87.9** |
113
+ | SigLIP2 | 10B | 56.1 | 62.3 | 62.9 | <u>89.1</u> | 45.4 | 86.9 |
114
+ | OpenCLIP | 2B | – | – | – | – | – | – |
115
+ | V-JEPA 2.1 | 0.022B | 69.0 | – | – | 85.5 | 47.9 | 87.7 |
116
+
117
+ Protocol: DINOv3-style linear/attentive probes for image tasks; V-JEPA 2-style protocol for
118
+ video. Baseline DAVIS / ADE20K / K400 figures are taken from the DINOv3 technical report's
119
+ unified evaluation (Tab. 3, 5, 6) and ImageNet from Tab. 7; OpenCLIP is not in that report and
120
+ its benchmarks are not reported under a comparable protocol.
121
+
122
+ Motif is state of the art on DAVIS video tracking at every resolution (74.0 / 80.5 / 83.5 J&F)
123
+ and stays competitive on the other image and video benchmarks, using roughly 1/3 of DINOv3's
124
+ training data (~0.5B samples).
125
+
126
+ <p align="center">
127
+ <img src="assets/davis_mask_propagation.gif" width="820" alt="Mask propagation: ground truth vs DINOv3 vs Motif"/>
128
+ </p>
129
+
130
+ <p align="center">
131
+ <img src="assets/dense_attention_comparison.png" width="820" alt="Dense attention and feature-similarity comparison across Motif, DINOv3, V-JEPA 2.1, and SigLIP2"/>
132
+ </p>
133
+ <p align="center"><em>Dense features on a single image (768px). Columns: query point, CLS attention, query-point attention, patch-feature cosine similarity. Motif and DINOv3 keep attention and similarity tightly localized on the queried object, while V-JEPA 2.1 and SigLIP2 are noticeably noisier.</em></p>
134
+
135
+
136
+ ## License
137
+
138
+ Released under the **MIT License** (see `LICENSE`). The model was trained on data governed by the
139
+ respective dataset licenses; downstream users are responsible for compliance with those terms.
assets/architecture.png ADDED

Git LFS Details

  • SHA256: 47412aadb9dbd433ead3984627be246298afa034ce457c675a6d195a1343d6ae
  • Pointer size: 131 Bytes
  • Size of remote file: 400 kB
assets/davis_mask_propagation.gif ADDED

Git LFS Details

  • SHA256: e66feecc91280bd5b9508d170e5810511360061451a44937d470e6e6cd5f5931
  • Pointer size: 133 Bytes
  • Size of remote file: 17.6 MB
assets/dense_attention_comparison.png ADDED

Git LFS Details

  • SHA256: 578d395000ee6c909af378f4c7093e74983baeff8870e6885de7103e21761285
  • Pointer size: 132 Bytes
  • Size of remote file: 2.9 MB
assets/haaland_attn_blk20.gif ADDED

Git LFS Details

  • SHA256: 74bdfadd4b22999e7051f6fac7afd002c128c2198f4d9ce9117456c1d4a9a85c
  • Pointer size: 132 Bytes
  • Size of remote file: 2.47 MB
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MotifVisionModel"
4
+ ],
5
+ "auto_map": {
6
+ "AutoConfig": "modeling_motif_vision_encoder.MotifVisionConfig",
7
+ "AutoModel": "modeling_motif_vision_encoder.MotifVisionModel"
8
+ },
9
+ "depth": 40,
10
+ "drop_path_rate": 0.0,
11
+ "dtype": "bfloat16",
12
+ "embed_dim": 4096,
13
+ "ffn_bias": true,
14
+ "ffn_layer": "swiglu64",
15
+ "ffn_ratio": 3.0,
16
+ "gated_attention": "elementwise",
17
+ "img_size": 512,
18
+ "in_chans": 3,
19
+ "layerscale_init": 1e-05,
20
+ "mask_k_bias": true,
21
+ "model_type": "motif_vision",
22
+ "n_storage_tokens": 4,
23
+ "norm_layer": "layernormbf16",
24
+ "num_frames": 1,
25
+ "num_heads": 32,
26
+ "patch_size": 16,
27
+ "pos_embed_rope_base": 100.0,
28
+ "pos_embed_rope_rescale_coords": 2.0,
29
+ "proj_bias": true,
30
+ "qk_norm": true,
31
+ "qkv_bias": false,
32
+ "transformers_version": "5.8.1",
33
+ "tubelet_size": 2,
34
+ "untie_cls_and_patch_norms": false,
35
+ "untie_global_and_local_cls_norm": true
36
+ }
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5794edce3920ce891f0058e3bb1209dc75f54a2295438c3f14de27f9f4e6106
3
+ size 3939675808
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:655ff397bd7ac87cc6d075d2a1830ca81baca3e202c0906bb40099bfc4e3caf3
3
+ size 3994160376
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6e38c83a23cdba8fb0fee04289ee861d0e8ab319b83244b38fa6f21f7245ab0
3
+ size 3994134520
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:861e3ef26cfd8045028b7ae543ef6d449fb76307c394d2bf2d01ea8245301a03
3
+ size 2853015560
model.safetensors.index.json ADDED
@@ -0,0 +1,780 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_parameters": 7390451712,
4
+ "total_size": 14780903552
5
+ },
6
+ "weight_map": {
7
+ "backbone.blocks.0.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
8
+ "backbone.blocks.0.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
9
+ "backbone.blocks.0.attn.k_norm.weight": "model-00001-of-00004.safetensors",
10
+ "backbone.blocks.0.attn.proj.bias": "model-00001-of-00004.safetensors",
11
+ "backbone.blocks.0.attn.proj.weight": "model-00001-of-00004.safetensors",
12
+ "backbone.blocks.0.attn.q_norm.weight": "model-00001-of-00004.safetensors",
13
+ "backbone.blocks.0.attn.qkv.weight": "model-00001-of-00004.safetensors",
14
+ "backbone.blocks.0.ls1.gamma": "model-00001-of-00004.safetensors",
15
+ "backbone.blocks.0.ls2.gamma": "model-00001-of-00004.safetensors",
16
+ "backbone.blocks.0.mlp.w1.bias": "model-00001-of-00004.safetensors",
17
+ "backbone.blocks.0.mlp.w1.weight": "model-00001-of-00004.safetensors",
18
+ "backbone.blocks.0.mlp.w2.bias": "model-00001-of-00004.safetensors",
19
+ "backbone.blocks.0.mlp.w2.weight": "model-00001-of-00004.safetensors",
20
+ "backbone.blocks.0.mlp.w3.bias": "model-00001-of-00004.safetensors",
21
+ "backbone.blocks.0.mlp.w3.weight": "model-00001-of-00004.safetensors",
22
+ "backbone.blocks.0.norm1.bias": "model-00001-of-00004.safetensors",
23
+ "backbone.blocks.0.norm1.weight": "model-00001-of-00004.safetensors",
24
+ "backbone.blocks.0.norm2.bias": "model-00001-of-00004.safetensors",
25
+ "backbone.blocks.0.norm2.weight": "model-00001-of-00004.safetensors",
26
+ "backbone.blocks.1.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
27
+ "backbone.blocks.1.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
28
+ "backbone.blocks.1.attn.k_norm.weight": "model-00001-of-00004.safetensors",
29
+ "backbone.blocks.1.attn.proj.bias": "model-00001-of-00004.safetensors",
30
+ "backbone.blocks.1.attn.proj.weight": "model-00001-of-00004.safetensors",
31
+ "backbone.blocks.1.attn.q_norm.weight": "model-00001-of-00004.safetensors",
32
+ "backbone.blocks.1.attn.qkv.weight": "model-00001-of-00004.safetensors",
33
+ "backbone.blocks.1.ls1.gamma": "model-00001-of-00004.safetensors",
34
+ "backbone.blocks.1.ls2.gamma": "model-00001-of-00004.safetensors",
35
+ "backbone.blocks.1.mlp.w1.bias": "model-00001-of-00004.safetensors",
36
+ "backbone.blocks.1.mlp.w1.weight": "model-00001-of-00004.safetensors",
37
+ "backbone.blocks.1.mlp.w2.bias": "model-00001-of-00004.safetensors",
38
+ "backbone.blocks.1.mlp.w2.weight": "model-00001-of-00004.safetensors",
39
+ "backbone.blocks.1.mlp.w3.bias": "model-00001-of-00004.safetensors",
40
+ "backbone.blocks.1.mlp.w3.weight": "model-00001-of-00004.safetensors",
41
+ "backbone.blocks.1.norm1.bias": "model-00001-of-00004.safetensors",
42
+ "backbone.blocks.1.norm1.weight": "model-00001-of-00004.safetensors",
43
+ "backbone.blocks.1.norm2.bias": "model-00001-of-00004.safetensors",
44
+ "backbone.blocks.1.norm2.weight": "model-00001-of-00004.safetensors",
45
+ "backbone.blocks.10.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
46
+ "backbone.blocks.10.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
47
+ "backbone.blocks.10.attn.k_norm.weight": "model-00001-of-00004.safetensors",
48
+ "backbone.blocks.10.attn.proj.bias": "model-00001-of-00004.safetensors",
49
+ "backbone.blocks.10.attn.proj.weight": "model-00001-of-00004.safetensors",
50
+ "backbone.blocks.10.attn.q_norm.weight": "model-00001-of-00004.safetensors",
51
+ "backbone.blocks.10.attn.qkv.weight": "model-00001-of-00004.safetensors",
52
+ "backbone.blocks.10.ls1.gamma": "model-00001-of-00004.safetensors",
53
+ "backbone.blocks.10.ls2.gamma": "model-00002-of-00004.safetensors",
54
+ "backbone.blocks.10.mlp.w1.bias": "model-00001-of-00004.safetensors",
55
+ "backbone.blocks.10.mlp.w1.weight": "model-00001-of-00004.safetensors",
56
+ "backbone.blocks.10.mlp.w2.bias": "model-00002-of-00004.safetensors",
57
+ "backbone.blocks.10.mlp.w2.weight": "model-00002-of-00004.safetensors",
58
+ "backbone.blocks.10.mlp.w3.bias": "model-00002-of-00004.safetensors",
59
+ "backbone.blocks.10.mlp.w3.weight": "model-00002-of-00004.safetensors",
60
+ "backbone.blocks.10.norm1.bias": "model-00001-of-00004.safetensors",
61
+ "backbone.blocks.10.norm1.weight": "model-00001-of-00004.safetensors",
62
+ "backbone.blocks.10.norm2.bias": "model-00001-of-00004.safetensors",
63
+ "backbone.blocks.10.norm2.weight": "model-00001-of-00004.safetensors",
64
+ "backbone.blocks.11.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
65
+ "backbone.blocks.11.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
66
+ "backbone.blocks.11.attn.k_norm.weight": "model-00002-of-00004.safetensors",
67
+ "backbone.blocks.11.attn.proj.bias": "model-00002-of-00004.safetensors",
68
+ "backbone.blocks.11.attn.proj.weight": "model-00002-of-00004.safetensors",
69
+ "backbone.blocks.11.attn.q_norm.weight": "model-00002-of-00004.safetensors",
70
+ "backbone.blocks.11.attn.qkv.weight": "model-00002-of-00004.safetensors",
71
+ "backbone.blocks.11.ls1.gamma": "model-00002-of-00004.safetensors",
72
+ "backbone.blocks.11.ls2.gamma": "model-00002-of-00004.safetensors",
73
+ "backbone.blocks.11.mlp.w1.bias": "model-00002-of-00004.safetensors",
74
+ "backbone.blocks.11.mlp.w1.weight": "model-00002-of-00004.safetensors",
75
+ "backbone.blocks.11.mlp.w2.bias": "model-00002-of-00004.safetensors",
76
+ "backbone.blocks.11.mlp.w2.weight": "model-00002-of-00004.safetensors",
77
+ "backbone.blocks.11.mlp.w3.bias": "model-00002-of-00004.safetensors",
78
+ "backbone.blocks.11.mlp.w3.weight": "model-00002-of-00004.safetensors",
79
+ "backbone.blocks.11.norm1.bias": "model-00002-of-00004.safetensors",
80
+ "backbone.blocks.11.norm1.weight": "model-00002-of-00004.safetensors",
81
+ "backbone.blocks.11.norm2.bias": "model-00002-of-00004.safetensors",
82
+ "backbone.blocks.11.norm2.weight": "model-00002-of-00004.safetensors",
83
+ "backbone.blocks.12.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
84
+ "backbone.blocks.12.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
85
+ "backbone.blocks.12.attn.k_norm.weight": "model-00002-of-00004.safetensors",
86
+ "backbone.blocks.12.attn.proj.bias": "model-00002-of-00004.safetensors",
87
+ "backbone.blocks.12.attn.proj.weight": "model-00002-of-00004.safetensors",
88
+ "backbone.blocks.12.attn.q_norm.weight": "model-00002-of-00004.safetensors",
89
+ "backbone.blocks.12.attn.qkv.weight": "model-00002-of-00004.safetensors",
90
+ "backbone.blocks.12.ls1.gamma": "model-00002-of-00004.safetensors",
91
+ "backbone.blocks.12.ls2.gamma": "model-00002-of-00004.safetensors",
92
+ "backbone.blocks.12.mlp.w1.bias": "model-00002-of-00004.safetensors",
93
+ "backbone.blocks.12.mlp.w1.weight": "model-00002-of-00004.safetensors",
94
+ "backbone.blocks.12.mlp.w2.bias": "model-00002-of-00004.safetensors",
95
+ "backbone.blocks.12.mlp.w2.weight": "model-00002-of-00004.safetensors",
96
+ "backbone.blocks.12.mlp.w3.bias": "model-00002-of-00004.safetensors",
97
+ "backbone.blocks.12.mlp.w3.weight": "model-00002-of-00004.safetensors",
98
+ "backbone.blocks.12.norm1.bias": "model-00002-of-00004.safetensors",
99
+ "backbone.blocks.12.norm1.weight": "model-00002-of-00004.safetensors",
100
+ "backbone.blocks.12.norm2.bias": "model-00002-of-00004.safetensors",
101
+ "backbone.blocks.12.norm2.weight": "model-00002-of-00004.safetensors",
102
+ "backbone.blocks.13.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
103
+ "backbone.blocks.13.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
104
+ "backbone.blocks.13.attn.k_norm.weight": "model-00002-of-00004.safetensors",
105
+ "backbone.blocks.13.attn.proj.bias": "model-00002-of-00004.safetensors",
106
+ "backbone.blocks.13.attn.proj.weight": "model-00002-of-00004.safetensors",
107
+ "backbone.blocks.13.attn.q_norm.weight": "model-00002-of-00004.safetensors",
108
+ "backbone.blocks.13.attn.qkv.weight": "model-00002-of-00004.safetensors",
109
+ "backbone.blocks.13.ls1.gamma": "model-00002-of-00004.safetensors",
110
+ "backbone.blocks.13.ls2.gamma": "model-00002-of-00004.safetensors",
111
+ "backbone.blocks.13.mlp.w1.bias": "model-00002-of-00004.safetensors",
112
+ "backbone.blocks.13.mlp.w1.weight": "model-00002-of-00004.safetensors",
113
+ "backbone.blocks.13.mlp.w2.bias": "model-00002-of-00004.safetensors",
114
+ "backbone.blocks.13.mlp.w2.weight": "model-00002-of-00004.safetensors",
115
+ "backbone.blocks.13.mlp.w3.bias": "model-00002-of-00004.safetensors",
116
+ "backbone.blocks.13.mlp.w3.weight": "model-00002-of-00004.safetensors",
117
+ "backbone.blocks.13.norm1.bias": "model-00002-of-00004.safetensors",
118
+ "backbone.blocks.13.norm1.weight": "model-00002-of-00004.safetensors",
119
+ "backbone.blocks.13.norm2.bias": "model-00002-of-00004.safetensors",
120
+ "backbone.blocks.13.norm2.weight": "model-00002-of-00004.safetensors",
121
+ "backbone.blocks.14.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
122
+ "backbone.blocks.14.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
123
+ "backbone.blocks.14.attn.k_norm.weight": "model-00002-of-00004.safetensors",
124
+ "backbone.blocks.14.attn.proj.bias": "model-00002-of-00004.safetensors",
125
+ "backbone.blocks.14.attn.proj.weight": "model-00002-of-00004.safetensors",
126
+ "backbone.blocks.14.attn.q_norm.weight": "model-00002-of-00004.safetensors",
127
+ "backbone.blocks.14.attn.qkv.weight": "model-00002-of-00004.safetensors",
128
+ "backbone.blocks.14.ls1.gamma": "model-00002-of-00004.safetensors",
129
+ "backbone.blocks.14.ls2.gamma": "model-00002-of-00004.safetensors",
130
+ "backbone.blocks.14.mlp.w1.bias": "model-00002-of-00004.safetensors",
131
+ "backbone.blocks.14.mlp.w1.weight": "model-00002-of-00004.safetensors",
132
+ "backbone.blocks.14.mlp.w2.bias": "model-00002-of-00004.safetensors",
133
+ "backbone.blocks.14.mlp.w2.weight": "model-00002-of-00004.safetensors",
134
+ "backbone.blocks.14.mlp.w3.bias": "model-00002-of-00004.safetensors",
135
+ "backbone.blocks.14.mlp.w3.weight": "model-00002-of-00004.safetensors",
136
+ "backbone.blocks.14.norm1.bias": "model-00002-of-00004.safetensors",
137
+ "backbone.blocks.14.norm1.weight": "model-00002-of-00004.safetensors",
138
+ "backbone.blocks.14.norm2.bias": "model-00002-of-00004.safetensors",
139
+ "backbone.blocks.14.norm2.weight": "model-00002-of-00004.safetensors",
140
+ "backbone.blocks.15.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
141
+ "backbone.blocks.15.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
142
+ "backbone.blocks.15.attn.k_norm.weight": "model-00002-of-00004.safetensors",
143
+ "backbone.blocks.15.attn.proj.bias": "model-00002-of-00004.safetensors",
144
+ "backbone.blocks.15.attn.proj.weight": "model-00002-of-00004.safetensors",
145
+ "backbone.blocks.15.attn.q_norm.weight": "model-00002-of-00004.safetensors",
146
+ "backbone.blocks.15.attn.qkv.weight": "model-00002-of-00004.safetensors",
147
+ "backbone.blocks.15.ls1.gamma": "model-00002-of-00004.safetensors",
148
+ "backbone.blocks.15.ls2.gamma": "model-00002-of-00004.safetensors",
149
+ "backbone.blocks.15.mlp.w1.bias": "model-00002-of-00004.safetensors",
150
+ "backbone.blocks.15.mlp.w1.weight": "model-00002-of-00004.safetensors",
151
+ "backbone.blocks.15.mlp.w2.bias": "model-00002-of-00004.safetensors",
152
+ "backbone.blocks.15.mlp.w2.weight": "model-00002-of-00004.safetensors",
153
+ "backbone.blocks.15.mlp.w3.bias": "model-00002-of-00004.safetensors",
154
+ "backbone.blocks.15.mlp.w3.weight": "model-00002-of-00004.safetensors",
155
+ "backbone.blocks.15.norm1.bias": "model-00002-of-00004.safetensors",
156
+ "backbone.blocks.15.norm1.weight": "model-00002-of-00004.safetensors",
157
+ "backbone.blocks.15.norm2.bias": "model-00002-of-00004.safetensors",
158
+ "backbone.blocks.15.norm2.weight": "model-00002-of-00004.safetensors",
159
+ "backbone.blocks.16.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
160
+ "backbone.blocks.16.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
161
+ "backbone.blocks.16.attn.k_norm.weight": "model-00002-of-00004.safetensors",
162
+ "backbone.blocks.16.attn.proj.bias": "model-00002-of-00004.safetensors",
163
+ "backbone.blocks.16.attn.proj.weight": "model-00002-of-00004.safetensors",
164
+ "backbone.blocks.16.attn.q_norm.weight": "model-00002-of-00004.safetensors",
165
+ "backbone.blocks.16.attn.qkv.weight": "model-00002-of-00004.safetensors",
166
+ "backbone.blocks.16.ls1.gamma": "model-00002-of-00004.safetensors",
167
+ "backbone.blocks.16.ls2.gamma": "model-00002-of-00004.safetensors",
168
+ "backbone.blocks.16.mlp.w1.bias": "model-00002-of-00004.safetensors",
169
+ "backbone.blocks.16.mlp.w1.weight": "model-00002-of-00004.safetensors",
170
+ "backbone.blocks.16.mlp.w2.bias": "model-00002-of-00004.safetensors",
171
+ "backbone.blocks.16.mlp.w2.weight": "model-00002-of-00004.safetensors",
172
+ "backbone.blocks.16.mlp.w3.bias": "model-00002-of-00004.safetensors",
173
+ "backbone.blocks.16.mlp.w3.weight": "model-00002-of-00004.safetensors",
174
+ "backbone.blocks.16.norm1.bias": "model-00002-of-00004.safetensors",
175
+ "backbone.blocks.16.norm1.weight": "model-00002-of-00004.safetensors",
176
+ "backbone.blocks.16.norm2.bias": "model-00002-of-00004.safetensors",
177
+ "backbone.blocks.16.norm2.weight": "model-00002-of-00004.safetensors",
178
+ "backbone.blocks.17.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
179
+ "backbone.blocks.17.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
180
+ "backbone.blocks.17.attn.k_norm.weight": "model-00002-of-00004.safetensors",
181
+ "backbone.blocks.17.attn.proj.bias": "model-00002-of-00004.safetensors",
182
+ "backbone.blocks.17.attn.proj.weight": "model-00002-of-00004.safetensors",
183
+ "backbone.blocks.17.attn.q_norm.weight": "model-00002-of-00004.safetensors",
184
+ "backbone.blocks.17.attn.qkv.weight": "model-00002-of-00004.safetensors",
185
+ "backbone.blocks.17.ls1.gamma": "model-00002-of-00004.safetensors",
186
+ "backbone.blocks.17.ls2.gamma": "model-00002-of-00004.safetensors",
187
+ "backbone.blocks.17.mlp.w1.bias": "model-00002-of-00004.safetensors",
188
+ "backbone.blocks.17.mlp.w1.weight": "model-00002-of-00004.safetensors",
189
+ "backbone.blocks.17.mlp.w2.bias": "model-00002-of-00004.safetensors",
190
+ "backbone.blocks.17.mlp.w2.weight": "model-00002-of-00004.safetensors",
191
+ "backbone.blocks.17.mlp.w3.bias": "model-00002-of-00004.safetensors",
192
+ "backbone.blocks.17.mlp.w3.weight": "model-00002-of-00004.safetensors",
193
+ "backbone.blocks.17.norm1.bias": "model-00002-of-00004.safetensors",
194
+ "backbone.blocks.17.norm1.weight": "model-00002-of-00004.safetensors",
195
+ "backbone.blocks.17.norm2.bias": "model-00002-of-00004.safetensors",
196
+ "backbone.blocks.17.norm2.weight": "model-00002-of-00004.safetensors",
197
+ "backbone.blocks.18.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
198
+ "backbone.blocks.18.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
199
+ "backbone.blocks.18.attn.k_norm.weight": "model-00002-of-00004.safetensors",
200
+ "backbone.blocks.18.attn.proj.bias": "model-00002-of-00004.safetensors",
201
+ "backbone.blocks.18.attn.proj.weight": "model-00002-of-00004.safetensors",
202
+ "backbone.blocks.18.attn.q_norm.weight": "model-00002-of-00004.safetensors",
203
+ "backbone.blocks.18.attn.qkv.weight": "model-00002-of-00004.safetensors",
204
+ "backbone.blocks.18.ls1.gamma": "model-00002-of-00004.safetensors",
205
+ "backbone.blocks.18.ls2.gamma": "model-00002-of-00004.safetensors",
206
+ "backbone.blocks.18.mlp.w1.bias": "model-00002-of-00004.safetensors",
207
+ "backbone.blocks.18.mlp.w1.weight": "model-00002-of-00004.safetensors",
208
+ "backbone.blocks.18.mlp.w2.bias": "model-00002-of-00004.safetensors",
209
+ "backbone.blocks.18.mlp.w2.weight": "model-00002-of-00004.safetensors",
210
+ "backbone.blocks.18.mlp.w3.bias": "model-00002-of-00004.safetensors",
211
+ "backbone.blocks.18.mlp.w3.weight": "model-00002-of-00004.safetensors",
212
+ "backbone.blocks.18.norm1.bias": "model-00002-of-00004.safetensors",
213
+ "backbone.blocks.18.norm1.weight": "model-00002-of-00004.safetensors",
214
+ "backbone.blocks.18.norm2.bias": "model-00002-of-00004.safetensors",
215
+ "backbone.blocks.18.norm2.weight": "model-00002-of-00004.safetensors",
216
+ "backbone.blocks.19.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
217
+ "backbone.blocks.19.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
218
+ "backbone.blocks.19.attn.k_norm.weight": "model-00002-of-00004.safetensors",
219
+ "backbone.blocks.19.attn.proj.bias": "model-00002-of-00004.safetensors",
220
+ "backbone.blocks.19.attn.proj.weight": "model-00002-of-00004.safetensors",
221
+ "backbone.blocks.19.attn.q_norm.weight": "model-00002-of-00004.safetensors",
222
+ "backbone.blocks.19.attn.qkv.weight": "model-00002-of-00004.safetensors",
223
+ "backbone.blocks.19.ls1.gamma": "model-00002-of-00004.safetensors",
224
+ "backbone.blocks.19.ls2.gamma": "model-00002-of-00004.safetensors",
225
+ "backbone.blocks.19.mlp.w1.bias": "model-00002-of-00004.safetensors",
226
+ "backbone.blocks.19.mlp.w1.weight": "model-00002-of-00004.safetensors",
227
+ "backbone.blocks.19.mlp.w2.bias": "model-00002-of-00004.safetensors",
228
+ "backbone.blocks.19.mlp.w2.weight": "model-00002-of-00004.safetensors",
229
+ "backbone.blocks.19.mlp.w3.bias": "model-00002-of-00004.safetensors",
230
+ "backbone.blocks.19.mlp.w3.weight": "model-00002-of-00004.safetensors",
231
+ "backbone.blocks.19.norm1.bias": "model-00002-of-00004.safetensors",
232
+ "backbone.blocks.19.norm1.weight": "model-00002-of-00004.safetensors",
233
+ "backbone.blocks.19.norm2.bias": "model-00002-of-00004.safetensors",
234
+ "backbone.blocks.19.norm2.weight": "model-00002-of-00004.safetensors",
235
+ "backbone.blocks.2.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
236
+ "backbone.blocks.2.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
237
+ "backbone.blocks.2.attn.k_norm.weight": "model-00001-of-00004.safetensors",
238
+ "backbone.blocks.2.attn.proj.bias": "model-00001-of-00004.safetensors",
239
+ "backbone.blocks.2.attn.proj.weight": "model-00001-of-00004.safetensors",
240
+ "backbone.blocks.2.attn.q_norm.weight": "model-00001-of-00004.safetensors",
241
+ "backbone.blocks.2.attn.qkv.weight": "model-00001-of-00004.safetensors",
242
+ "backbone.blocks.2.ls1.gamma": "model-00001-of-00004.safetensors",
243
+ "backbone.blocks.2.ls2.gamma": "model-00001-of-00004.safetensors",
244
+ "backbone.blocks.2.mlp.w1.bias": "model-00001-of-00004.safetensors",
245
+ "backbone.blocks.2.mlp.w1.weight": "model-00001-of-00004.safetensors",
246
+ "backbone.blocks.2.mlp.w2.bias": "model-00001-of-00004.safetensors",
247
+ "backbone.blocks.2.mlp.w2.weight": "model-00001-of-00004.safetensors",
248
+ "backbone.blocks.2.mlp.w3.bias": "model-00001-of-00004.safetensors",
249
+ "backbone.blocks.2.mlp.w3.weight": "model-00001-of-00004.safetensors",
250
+ "backbone.blocks.2.norm1.bias": "model-00001-of-00004.safetensors",
251
+ "backbone.blocks.2.norm1.weight": "model-00001-of-00004.safetensors",
252
+ "backbone.blocks.2.norm2.bias": "model-00001-of-00004.safetensors",
253
+ "backbone.blocks.2.norm2.weight": "model-00001-of-00004.safetensors",
254
+ "backbone.blocks.20.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
255
+ "backbone.blocks.20.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
256
+ "backbone.blocks.20.attn.k_norm.weight": "model-00002-of-00004.safetensors",
257
+ "backbone.blocks.20.attn.proj.bias": "model-00002-of-00004.safetensors",
258
+ "backbone.blocks.20.attn.proj.weight": "model-00002-of-00004.safetensors",
259
+ "backbone.blocks.20.attn.q_norm.weight": "model-00002-of-00004.safetensors",
260
+ "backbone.blocks.20.attn.qkv.weight": "model-00002-of-00004.safetensors",
261
+ "backbone.blocks.20.ls1.gamma": "model-00002-of-00004.safetensors",
262
+ "backbone.blocks.20.ls2.gamma": "model-00002-of-00004.safetensors",
263
+ "backbone.blocks.20.mlp.w1.bias": "model-00002-of-00004.safetensors",
264
+ "backbone.blocks.20.mlp.w1.weight": "model-00002-of-00004.safetensors",
265
+ "backbone.blocks.20.mlp.w2.bias": "model-00002-of-00004.safetensors",
266
+ "backbone.blocks.20.mlp.w2.weight": "model-00002-of-00004.safetensors",
267
+ "backbone.blocks.20.mlp.w3.bias": "model-00002-of-00004.safetensors",
268
+ "backbone.blocks.20.mlp.w3.weight": "model-00002-of-00004.safetensors",
269
+ "backbone.blocks.20.norm1.bias": "model-00002-of-00004.safetensors",
270
+ "backbone.blocks.20.norm1.weight": "model-00002-of-00004.safetensors",
271
+ "backbone.blocks.20.norm2.bias": "model-00002-of-00004.safetensors",
272
+ "backbone.blocks.20.norm2.weight": "model-00002-of-00004.safetensors",
273
+ "backbone.blocks.21.attn.gate_proj.bias": "model-00002-of-00004.safetensors",
274
+ "backbone.blocks.21.attn.gate_proj.weight": "model-00002-of-00004.safetensors",
275
+ "backbone.blocks.21.attn.k_norm.weight": "model-00002-of-00004.safetensors",
276
+ "backbone.blocks.21.attn.proj.bias": "model-00002-of-00004.safetensors",
277
+ "backbone.blocks.21.attn.proj.weight": "model-00002-of-00004.safetensors",
278
+ "backbone.blocks.21.attn.q_norm.weight": "model-00002-of-00004.safetensors",
279
+ "backbone.blocks.21.attn.qkv.weight": "model-00002-of-00004.safetensors",
280
+ "backbone.blocks.21.ls1.gamma": "model-00002-of-00004.safetensors",
281
+ "backbone.blocks.21.ls2.gamma": "model-00003-of-00004.safetensors",
282
+ "backbone.blocks.21.mlp.w1.bias": "model-00003-of-00004.safetensors",
283
+ "backbone.blocks.21.mlp.w1.weight": "model-00003-of-00004.safetensors",
284
+ "backbone.blocks.21.mlp.w2.bias": "model-00003-of-00004.safetensors",
285
+ "backbone.blocks.21.mlp.w2.weight": "model-00003-of-00004.safetensors",
286
+ "backbone.blocks.21.mlp.w3.bias": "model-00003-of-00004.safetensors",
287
+ "backbone.blocks.21.mlp.w3.weight": "model-00003-of-00004.safetensors",
288
+ "backbone.blocks.21.norm1.bias": "model-00002-of-00004.safetensors",
289
+ "backbone.blocks.21.norm1.weight": "model-00002-of-00004.safetensors",
290
+ "backbone.blocks.21.norm2.bias": "model-00002-of-00004.safetensors",
291
+ "backbone.blocks.21.norm2.weight": "model-00002-of-00004.safetensors",
292
+ "backbone.blocks.22.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
293
+ "backbone.blocks.22.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
294
+ "backbone.blocks.22.attn.k_norm.weight": "model-00003-of-00004.safetensors",
295
+ "backbone.blocks.22.attn.proj.bias": "model-00003-of-00004.safetensors",
296
+ "backbone.blocks.22.attn.proj.weight": "model-00003-of-00004.safetensors",
297
+ "backbone.blocks.22.attn.q_norm.weight": "model-00003-of-00004.safetensors",
298
+ "backbone.blocks.22.attn.qkv.weight": "model-00003-of-00004.safetensors",
299
+ "backbone.blocks.22.ls1.gamma": "model-00003-of-00004.safetensors",
300
+ "backbone.blocks.22.ls2.gamma": "model-00003-of-00004.safetensors",
301
+ "backbone.blocks.22.mlp.w1.bias": "model-00003-of-00004.safetensors",
302
+ "backbone.blocks.22.mlp.w1.weight": "model-00003-of-00004.safetensors",
303
+ "backbone.blocks.22.mlp.w2.bias": "model-00003-of-00004.safetensors",
304
+ "backbone.blocks.22.mlp.w2.weight": "model-00003-of-00004.safetensors",
305
+ "backbone.blocks.22.mlp.w3.bias": "model-00003-of-00004.safetensors",
306
+ "backbone.blocks.22.mlp.w3.weight": "model-00003-of-00004.safetensors",
307
+ "backbone.blocks.22.norm1.bias": "model-00003-of-00004.safetensors",
308
+ "backbone.blocks.22.norm1.weight": "model-00003-of-00004.safetensors",
309
+ "backbone.blocks.22.norm2.bias": "model-00003-of-00004.safetensors",
310
+ "backbone.blocks.22.norm2.weight": "model-00003-of-00004.safetensors",
311
+ "backbone.blocks.23.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
312
+ "backbone.blocks.23.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
313
+ "backbone.blocks.23.attn.k_norm.weight": "model-00003-of-00004.safetensors",
314
+ "backbone.blocks.23.attn.proj.bias": "model-00003-of-00004.safetensors",
315
+ "backbone.blocks.23.attn.proj.weight": "model-00003-of-00004.safetensors",
316
+ "backbone.blocks.23.attn.q_norm.weight": "model-00003-of-00004.safetensors",
317
+ "backbone.blocks.23.attn.qkv.weight": "model-00003-of-00004.safetensors",
318
+ "backbone.blocks.23.ls1.gamma": "model-00003-of-00004.safetensors",
319
+ "backbone.blocks.23.ls2.gamma": "model-00003-of-00004.safetensors",
320
+ "backbone.blocks.23.mlp.w1.bias": "model-00003-of-00004.safetensors",
321
+ "backbone.blocks.23.mlp.w1.weight": "model-00003-of-00004.safetensors",
322
+ "backbone.blocks.23.mlp.w2.bias": "model-00003-of-00004.safetensors",
323
+ "backbone.blocks.23.mlp.w2.weight": "model-00003-of-00004.safetensors",
324
+ "backbone.blocks.23.mlp.w3.bias": "model-00003-of-00004.safetensors",
325
+ "backbone.blocks.23.mlp.w3.weight": "model-00003-of-00004.safetensors",
326
+ "backbone.blocks.23.norm1.bias": "model-00003-of-00004.safetensors",
327
+ "backbone.blocks.23.norm1.weight": "model-00003-of-00004.safetensors",
328
+ "backbone.blocks.23.norm2.bias": "model-00003-of-00004.safetensors",
329
+ "backbone.blocks.23.norm2.weight": "model-00003-of-00004.safetensors",
330
+ "backbone.blocks.24.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
331
+ "backbone.blocks.24.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
332
+ "backbone.blocks.24.attn.k_norm.weight": "model-00003-of-00004.safetensors",
333
+ "backbone.blocks.24.attn.proj.bias": "model-00003-of-00004.safetensors",
334
+ "backbone.blocks.24.attn.proj.weight": "model-00003-of-00004.safetensors",
335
+ "backbone.blocks.24.attn.q_norm.weight": "model-00003-of-00004.safetensors",
336
+ "backbone.blocks.24.attn.qkv.weight": "model-00003-of-00004.safetensors",
337
+ "backbone.blocks.24.ls1.gamma": "model-00003-of-00004.safetensors",
338
+ "backbone.blocks.24.ls2.gamma": "model-00003-of-00004.safetensors",
339
+ "backbone.blocks.24.mlp.w1.bias": "model-00003-of-00004.safetensors",
340
+ "backbone.blocks.24.mlp.w1.weight": "model-00003-of-00004.safetensors",
341
+ "backbone.blocks.24.mlp.w2.bias": "model-00003-of-00004.safetensors",
342
+ "backbone.blocks.24.mlp.w2.weight": "model-00003-of-00004.safetensors",
343
+ "backbone.blocks.24.mlp.w3.bias": "model-00003-of-00004.safetensors",
344
+ "backbone.blocks.24.mlp.w3.weight": "model-00003-of-00004.safetensors",
345
+ "backbone.blocks.24.norm1.bias": "model-00003-of-00004.safetensors",
346
+ "backbone.blocks.24.norm1.weight": "model-00003-of-00004.safetensors",
347
+ "backbone.blocks.24.norm2.bias": "model-00003-of-00004.safetensors",
348
+ "backbone.blocks.24.norm2.weight": "model-00003-of-00004.safetensors",
349
+ "backbone.blocks.25.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
350
+ "backbone.blocks.25.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
351
+ "backbone.blocks.25.attn.k_norm.weight": "model-00003-of-00004.safetensors",
352
+ "backbone.blocks.25.attn.proj.bias": "model-00003-of-00004.safetensors",
353
+ "backbone.blocks.25.attn.proj.weight": "model-00003-of-00004.safetensors",
354
+ "backbone.blocks.25.attn.q_norm.weight": "model-00003-of-00004.safetensors",
355
+ "backbone.blocks.25.attn.qkv.weight": "model-00003-of-00004.safetensors",
356
+ "backbone.blocks.25.ls1.gamma": "model-00003-of-00004.safetensors",
357
+ "backbone.blocks.25.ls2.gamma": "model-00003-of-00004.safetensors",
358
+ "backbone.blocks.25.mlp.w1.bias": "model-00003-of-00004.safetensors",
359
+ "backbone.blocks.25.mlp.w1.weight": "model-00003-of-00004.safetensors",
360
+ "backbone.blocks.25.mlp.w2.bias": "model-00003-of-00004.safetensors",
361
+ "backbone.blocks.25.mlp.w2.weight": "model-00003-of-00004.safetensors",
362
+ "backbone.blocks.25.mlp.w3.bias": "model-00003-of-00004.safetensors",
363
+ "backbone.blocks.25.mlp.w3.weight": "model-00003-of-00004.safetensors",
364
+ "backbone.blocks.25.norm1.bias": "model-00003-of-00004.safetensors",
365
+ "backbone.blocks.25.norm1.weight": "model-00003-of-00004.safetensors",
366
+ "backbone.blocks.25.norm2.bias": "model-00003-of-00004.safetensors",
367
+ "backbone.blocks.25.norm2.weight": "model-00003-of-00004.safetensors",
368
+ "backbone.blocks.26.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
369
+ "backbone.blocks.26.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
370
+ "backbone.blocks.26.attn.k_norm.weight": "model-00003-of-00004.safetensors",
371
+ "backbone.blocks.26.attn.proj.bias": "model-00003-of-00004.safetensors",
372
+ "backbone.blocks.26.attn.proj.weight": "model-00003-of-00004.safetensors",
373
+ "backbone.blocks.26.attn.q_norm.weight": "model-00003-of-00004.safetensors",
374
+ "backbone.blocks.26.attn.qkv.weight": "model-00003-of-00004.safetensors",
375
+ "backbone.blocks.26.ls1.gamma": "model-00003-of-00004.safetensors",
376
+ "backbone.blocks.26.ls2.gamma": "model-00003-of-00004.safetensors",
377
+ "backbone.blocks.26.mlp.w1.bias": "model-00003-of-00004.safetensors",
378
+ "backbone.blocks.26.mlp.w1.weight": "model-00003-of-00004.safetensors",
379
+ "backbone.blocks.26.mlp.w2.bias": "model-00003-of-00004.safetensors",
380
+ "backbone.blocks.26.mlp.w2.weight": "model-00003-of-00004.safetensors",
381
+ "backbone.blocks.26.mlp.w3.bias": "model-00003-of-00004.safetensors",
382
+ "backbone.blocks.26.mlp.w3.weight": "model-00003-of-00004.safetensors",
383
+ "backbone.blocks.26.norm1.bias": "model-00003-of-00004.safetensors",
384
+ "backbone.blocks.26.norm1.weight": "model-00003-of-00004.safetensors",
385
+ "backbone.blocks.26.norm2.bias": "model-00003-of-00004.safetensors",
386
+ "backbone.blocks.26.norm2.weight": "model-00003-of-00004.safetensors",
387
+ "backbone.blocks.27.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
388
+ "backbone.blocks.27.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
389
+ "backbone.blocks.27.attn.k_norm.weight": "model-00003-of-00004.safetensors",
390
+ "backbone.blocks.27.attn.proj.bias": "model-00003-of-00004.safetensors",
391
+ "backbone.blocks.27.attn.proj.weight": "model-00003-of-00004.safetensors",
392
+ "backbone.blocks.27.attn.q_norm.weight": "model-00003-of-00004.safetensors",
393
+ "backbone.blocks.27.attn.qkv.weight": "model-00003-of-00004.safetensors",
394
+ "backbone.blocks.27.ls1.gamma": "model-00003-of-00004.safetensors",
395
+ "backbone.blocks.27.ls2.gamma": "model-00003-of-00004.safetensors",
396
+ "backbone.blocks.27.mlp.w1.bias": "model-00003-of-00004.safetensors",
397
+ "backbone.blocks.27.mlp.w1.weight": "model-00003-of-00004.safetensors",
398
+ "backbone.blocks.27.mlp.w2.bias": "model-00003-of-00004.safetensors",
399
+ "backbone.blocks.27.mlp.w2.weight": "model-00003-of-00004.safetensors",
400
+ "backbone.blocks.27.mlp.w3.bias": "model-00003-of-00004.safetensors",
401
+ "backbone.blocks.27.mlp.w3.weight": "model-00003-of-00004.safetensors",
402
+ "backbone.blocks.27.norm1.bias": "model-00003-of-00004.safetensors",
403
+ "backbone.blocks.27.norm1.weight": "model-00003-of-00004.safetensors",
404
+ "backbone.blocks.27.norm2.bias": "model-00003-of-00004.safetensors",
405
+ "backbone.blocks.27.norm2.weight": "model-00003-of-00004.safetensors",
406
+ "backbone.blocks.28.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
407
+ "backbone.blocks.28.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
408
+ "backbone.blocks.28.attn.k_norm.weight": "model-00003-of-00004.safetensors",
409
+ "backbone.blocks.28.attn.proj.bias": "model-00003-of-00004.safetensors",
410
+ "backbone.blocks.28.attn.proj.weight": "model-00003-of-00004.safetensors",
411
+ "backbone.blocks.28.attn.q_norm.weight": "model-00003-of-00004.safetensors",
412
+ "backbone.blocks.28.attn.qkv.weight": "model-00003-of-00004.safetensors",
413
+ "backbone.blocks.28.ls1.gamma": "model-00003-of-00004.safetensors",
414
+ "backbone.blocks.28.ls2.gamma": "model-00003-of-00004.safetensors",
415
+ "backbone.blocks.28.mlp.w1.bias": "model-00003-of-00004.safetensors",
416
+ "backbone.blocks.28.mlp.w1.weight": "model-00003-of-00004.safetensors",
417
+ "backbone.blocks.28.mlp.w2.bias": "model-00003-of-00004.safetensors",
418
+ "backbone.blocks.28.mlp.w2.weight": "model-00003-of-00004.safetensors",
419
+ "backbone.blocks.28.mlp.w3.bias": "model-00003-of-00004.safetensors",
420
+ "backbone.blocks.28.mlp.w3.weight": "model-00003-of-00004.safetensors",
421
+ "backbone.blocks.28.norm1.bias": "model-00003-of-00004.safetensors",
422
+ "backbone.blocks.28.norm1.weight": "model-00003-of-00004.safetensors",
423
+ "backbone.blocks.28.norm2.bias": "model-00003-of-00004.safetensors",
424
+ "backbone.blocks.28.norm2.weight": "model-00003-of-00004.safetensors",
425
+ "backbone.blocks.29.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
426
+ "backbone.blocks.29.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
427
+ "backbone.blocks.29.attn.k_norm.weight": "model-00003-of-00004.safetensors",
428
+ "backbone.blocks.29.attn.proj.bias": "model-00003-of-00004.safetensors",
429
+ "backbone.blocks.29.attn.proj.weight": "model-00003-of-00004.safetensors",
430
+ "backbone.blocks.29.attn.q_norm.weight": "model-00003-of-00004.safetensors",
431
+ "backbone.blocks.29.attn.qkv.weight": "model-00003-of-00004.safetensors",
432
+ "backbone.blocks.29.ls1.gamma": "model-00003-of-00004.safetensors",
433
+ "backbone.blocks.29.ls2.gamma": "model-00003-of-00004.safetensors",
434
+ "backbone.blocks.29.mlp.w1.bias": "model-00003-of-00004.safetensors",
435
+ "backbone.blocks.29.mlp.w1.weight": "model-00003-of-00004.safetensors",
436
+ "backbone.blocks.29.mlp.w2.bias": "model-00003-of-00004.safetensors",
437
+ "backbone.blocks.29.mlp.w2.weight": "model-00003-of-00004.safetensors",
438
+ "backbone.blocks.29.mlp.w3.bias": "model-00003-of-00004.safetensors",
439
+ "backbone.blocks.29.mlp.w3.weight": "model-00003-of-00004.safetensors",
440
+ "backbone.blocks.29.norm1.bias": "model-00003-of-00004.safetensors",
441
+ "backbone.blocks.29.norm1.weight": "model-00003-of-00004.safetensors",
442
+ "backbone.blocks.29.norm2.bias": "model-00003-of-00004.safetensors",
443
+ "backbone.blocks.29.norm2.weight": "model-00003-of-00004.safetensors",
444
+ "backbone.blocks.3.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
445
+ "backbone.blocks.3.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
446
+ "backbone.blocks.3.attn.k_norm.weight": "model-00001-of-00004.safetensors",
447
+ "backbone.blocks.3.attn.proj.bias": "model-00001-of-00004.safetensors",
448
+ "backbone.blocks.3.attn.proj.weight": "model-00001-of-00004.safetensors",
449
+ "backbone.blocks.3.attn.q_norm.weight": "model-00001-of-00004.safetensors",
450
+ "backbone.blocks.3.attn.qkv.weight": "model-00001-of-00004.safetensors",
451
+ "backbone.blocks.3.ls1.gamma": "model-00001-of-00004.safetensors",
452
+ "backbone.blocks.3.ls2.gamma": "model-00001-of-00004.safetensors",
453
+ "backbone.blocks.3.mlp.w1.bias": "model-00001-of-00004.safetensors",
454
+ "backbone.blocks.3.mlp.w1.weight": "model-00001-of-00004.safetensors",
455
+ "backbone.blocks.3.mlp.w2.bias": "model-00001-of-00004.safetensors",
456
+ "backbone.blocks.3.mlp.w2.weight": "model-00001-of-00004.safetensors",
457
+ "backbone.blocks.3.mlp.w3.bias": "model-00001-of-00004.safetensors",
458
+ "backbone.blocks.3.mlp.w3.weight": "model-00001-of-00004.safetensors",
459
+ "backbone.blocks.3.norm1.bias": "model-00001-of-00004.safetensors",
460
+ "backbone.blocks.3.norm1.weight": "model-00001-of-00004.safetensors",
461
+ "backbone.blocks.3.norm2.bias": "model-00001-of-00004.safetensors",
462
+ "backbone.blocks.3.norm2.weight": "model-00001-of-00004.safetensors",
463
+ "backbone.blocks.30.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
464
+ "backbone.blocks.30.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
465
+ "backbone.blocks.30.attn.k_norm.weight": "model-00003-of-00004.safetensors",
466
+ "backbone.blocks.30.attn.proj.bias": "model-00003-of-00004.safetensors",
467
+ "backbone.blocks.30.attn.proj.weight": "model-00003-of-00004.safetensors",
468
+ "backbone.blocks.30.attn.q_norm.weight": "model-00003-of-00004.safetensors",
469
+ "backbone.blocks.30.attn.qkv.weight": "model-00003-of-00004.safetensors",
470
+ "backbone.blocks.30.ls1.gamma": "model-00003-of-00004.safetensors",
471
+ "backbone.blocks.30.ls2.gamma": "model-00003-of-00004.safetensors",
472
+ "backbone.blocks.30.mlp.w1.bias": "model-00003-of-00004.safetensors",
473
+ "backbone.blocks.30.mlp.w1.weight": "model-00003-of-00004.safetensors",
474
+ "backbone.blocks.30.mlp.w2.bias": "model-00003-of-00004.safetensors",
475
+ "backbone.blocks.30.mlp.w2.weight": "model-00003-of-00004.safetensors",
476
+ "backbone.blocks.30.mlp.w3.bias": "model-00003-of-00004.safetensors",
477
+ "backbone.blocks.30.mlp.w3.weight": "model-00003-of-00004.safetensors",
478
+ "backbone.blocks.30.norm1.bias": "model-00003-of-00004.safetensors",
479
+ "backbone.blocks.30.norm1.weight": "model-00003-of-00004.safetensors",
480
+ "backbone.blocks.30.norm2.bias": "model-00003-of-00004.safetensors",
481
+ "backbone.blocks.30.norm2.weight": "model-00003-of-00004.safetensors",
482
+ "backbone.blocks.31.attn.gate_proj.bias": "model-00003-of-00004.safetensors",
483
+ "backbone.blocks.31.attn.gate_proj.weight": "model-00003-of-00004.safetensors",
484
+ "backbone.blocks.31.attn.k_norm.weight": "model-00003-of-00004.safetensors",
485
+ "backbone.blocks.31.attn.proj.bias": "model-00003-of-00004.safetensors",
486
+ "backbone.blocks.31.attn.proj.weight": "model-00003-of-00004.safetensors",
487
+ "backbone.blocks.31.attn.q_norm.weight": "model-00003-of-00004.safetensors",
488
+ "backbone.blocks.31.attn.qkv.weight": "model-00003-of-00004.safetensors",
489
+ "backbone.blocks.31.ls1.gamma": "model-00003-of-00004.safetensors",
490
+ "backbone.blocks.31.ls2.gamma": "model-00003-of-00004.safetensors",
491
+ "backbone.blocks.31.mlp.w1.bias": "model-00003-of-00004.safetensors",
492
+ "backbone.blocks.31.mlp.w1.weight": "model-00003-of-00004.safetensors",
493
+ "backbone.blocks.31.mlp.w2.bias": "model-00003-of-00004.safetensors",
494
+ "backbone.blocks.31.mlp.w2.weight": "model-00003-of-00004.safetensors",
495
+ "backbone.blocks.31.mlp.w3.bias": "model-00003-of-00004.safetensors",
496
+ "backbone.blocks.31.mlp.w3.weight": "model-00003-of-00004.safetensors",
497
+ "backbone.blocks.31.norm1.bias": "model-00003-of-00004.safetensors",
498
+ "backbone.blocks.31.norm1.weight": "model-00003-of-00004.safetensors",
499
+ "backbone.blocks.31.norm2.bias": "model-00003-of-00004.safetensors",
500
+ "backbone.blocks.31.norm2.weight": "model-00003-of-00004.safetensors",
501
+ "backbone.blocks.32.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
502
+ "backbone.blocks.32.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
503
+ "backbone.blocks.32.attn.k_norm.weight": "model-00004-of-00004.safetensors",
504
+ "backbone.blocks.32.attn.proj.bias": "model-00004-of-00004.safetensors",
505
+ "backbone.blocks.32.attn.proj.weight": "model-00004-of-00004.safetensors",
506
+ "backbone.blocks.32.attn.q_norm.weight": "model-00004-of-00004.safetensors",
507
+ "backbone.blocks.32.attn.qkv.weight": "model-00003-of-00004.safetensors",
508
+ "backbone.blocks.32.ls1.gamma": "model-00004-of-00004.safetensors",
509
+ "backbone.blocks.32.ls2.gamma": "model-00004-of-00004.safetensors",
510
+ "backbone.blocks.32.mlp.w1.bias": "model-00004-of-00004.safetensors",
511
+ "backbone.blocks.32.mlp.w1.weight": "model-00004-of-00004.safetensors",
512
+ "backbone.blocks.32.mlp.w2.bias": "model-00004-of-00004.safetensors",
513
+ "backbone.blocks.32.mlp.w2.weight": "model-00004-of-00004.safetensors",
514
+ "backbone.blocks.32.mlp.w3.bias": "model-00004-of-00004.safetensors",
515
+ "backbone.blocks.32.mlp.w3.weight": "model-00004-of-00004.safetensors",
516
+ "backbone.blocks.32.norm1.bias": "model-00003-of-00004.safetensors",
517
+ "backbone.blocks.32.norm1.weight": "model-00003-of-00004.safetensors",
518
+ "backbone.blocks.32.norm2.bias": "model-00004-of-00004.safetensors",
519
+ "backbone.blocks.32.norm2.weight": "model-00004-of-00004.safetensors",
520
+ "backbone.blocks.33.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
521
+ "backbone.blocks.33.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
522
+ "backbone.blocks.33.attn.k_norm.weight": "model-00004-of-00004.safetensors",
523
+ "backbone.blocks.33.attn.proj.bias": "model-00004-of-00004.safetensors",
524
+ "backbone.blocks.33.attn.proj.weight": "model-00004-of-00004.safetensors",
525
+ "backbone.blocks.33.attn.q_norm.weight": "model-00004-of-00004.safetensors",
526
+ "backbone.blocks.33.attn.qkv.weight": "model-00004-of-00004.safetensors",
527
+ "backbone.blocks.33.ls1.gamma": "model-00004-of-00004.safetensors",
528
+ "backbone.blocks.33.ls2.gamma": "model-00004-of-00004.safetensors",
529
+ "backbone.blocks.33.mlp.w1.bias": "model-00004-of-00004.safetensors",
530
+ "backbone.blocks.33.mlp.w1.weight": "model-00004-of-00004.safetensors",
531
+ "backbone.blocks.33.mlp.w2.bias": "model-00004-of-00004.safetensors",
532
+ "backbone.blocks.33.mlp.w2.weight": "model-00004-of-00004.safetensors",
533
+ "backbone.blocks.33.mlp.w3.bias": "model-00004-of-00004.safetensors",
534
+ "backbone.blocks.33.mlp.w3.weight": "model-00004-of-00004.safetensors",
535
+ "backbone.blocks.33.norm1.bias": "model-00004-of-00004.safetensors",
536
+ "backbone.blocks.33.norm1.weight": "model-00004-of-00004.safetensors",
537
+ "backbone.blocks.33.norm2.bias": "model-00004-of-00004.safetensors",
538
+ "backbone.blocks.33.norm2.weight": "model-00004-of-00004.safetensors",
539
+ "backbone.blocks.34.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
540
+ "backbone.blocks.34.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
541
+ "backbone.blocks.34.attn.k_norm.weight": "model-00004-of-00004.safetensors",
542
+ "backbone.blocks.34.attn.proj.bias": "model-00004-of-00004.safetensors",
543
+ "backbone.blocks.34.attn.proj.weight": "model-00004-of-00004.safetensors",
544
+ "backbone.blocks.34.attn.q_norm.weight": "model-00004-of-00004.safetensors",
545
+ "backbone.blocks.34.attn.qkv.weight": "model-00004-of-00004.safetensors",
546
+ "backbone.blocks.34.ls1.gamma": "model-00004-of-00004.safetensors",
547
+ "backbone.blocks.34.ls2.gamma": "model-00004-of-00004.safetensors",
548
+ "backbone.blocks.34.mlp.w1.bias": "model-00004-of-00004.safetensors",
549
+ "backbone.blocks.34.mlp.w1.weight": "model-00004-of-00004.safetensors",
550
+ "backbone.blocks.34.mlp.w2.bias": "model-00004-of-00004.safetensors",
551
+ "backbone.blocks.34.mlp.w2.weight": "model-00004-of-00004.safetensors",
552
+ "backbone.blocks.34.mlp.w3.bias": "model-00004-of-00004.safetensors",
553
+ "backbone.blocks.34.mlp.w3.weight": "model-00004-of-00004.safetensors",
554
+ "backbone.blocks.34.norm1.bias": "model-00004-of-00004.safetensors",
555
+ "backbone.blocks.34.norm1.weight": "model-00004-of-00004.safetensors",
556
+ "backbone.blocks.34.norm2.bias": "model-00004-of-00004.safetensors",
557
+ "backbone.blocks.34.norm2.weight": "model-00004-of-00004.safetensors",
558
+ "backbone.blocks.35.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
559
+ "backbone.blocks.35.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
560
+ "backbone.blocks.35.attn.k_norm.weight": "model-00004-of-00004.safetensors",
561
+ "backbone.blocks.35.attn.proj.bias": "model-00004-of-00004.safetensors",
562
+ "backbone.blocks.35.attn.proj.weight": "model-00004-of-00004.safetensors",
563
+ "backbone.blocks.35.attn.q_norm.weight": "model-00004-of-00004.safetensors",
564
+ "backbone.blocks.35.attn.qkv.weight": "model-00004-of-00004.safetensors",
565
+ "backbone.blocks.35.ls1.gamma": "model-00004-of-00004.safetensors",
566
+ "backbone.blocks.35.ls2.gamma": "model-00004-of-00004.safetensors",
567
+ "backbone.blocks.35.mlp.w1.bias": "model-00004-of-00004.safetensors",
568
+ "backbone.blocks.35.mlp.w1.weight": "model-00004-of-00004.safetensors",
569
+ "backbone.blocks.35.mlp.w2.bias": "model-00004-of-00004.safetensors",
570
+ "backbone.blocks.35.mlp.w2.weight": "model-00004-of-00004.safetensors",
571
+ "backbone.blocks.35.mlp.w3.bias": "model-00004-of-00004.safetensors",
572
+ "backbone.blocks.35.mlp.w3.weight": "model-00004-of-00004.safetensors",
573
+ "backbone.blocks.35.norm1.bias": "model-00004-of-00004.safetensors",
574
+ "backbone.blocks.35.norm1.weight": "model-00004-of-00004.safetensors",
575
+ "backbone.blocks.35.norm2.bias": "model-00004-of-00004.safetensors",
576
+ "backbone.blocks.35.norm2.weight": "model-00004-of-00004.safetensors",
577
+ "backbone.blocks.36.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
578
+ "backbone.blocks.36.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
579
+ "backbone.blocks.36.attn.k_norm.weight": "model-00004-of-00004.safetensors",
580
+ "backbone.blocks.36.attn.proj.bias": "model-00004-of-00004.safetensors",
581
+ "backbone.blocks.36.attn.proj.weight": "model-00004-of-00004.safetensors",
582
+ "backbone.blocks.36.attn.q_norm.weight": "model-00004-of-00004.safetensors",
583
+ "backbone.blocks.36.attn.qkv.weight": "model-00004-of-00004.safetensors",
584
+ "backbone.blocks.36.ls1.gamma": "model-00004-of-00004.safetensors",
585
+ "backbone.blocks.36.ls2.gamma": "model-00004-of-00004.safetensors",
586
+ "backbone.blocks.36.mlp.w1.bias": "model-00004-of-00004.safetensors",
587
+ "backbone.blocks.36.mlp.w1.weight": "model-00004-of-00004.safetensors",
588
+ "backbone.blocks.36.mlp.w2.bias": "model-00004-of-00004.safetensors",
589
+ "backbone.blocks.36.mlp.w2.weight": "model-00004-of-00004.safetensors",
590
+ "backbone.blocks.36.mlp.w3.bias": "model-00004-of-00004.safetensors",
591
+ "backbone.blocks.36.mlp.w3.weight": "model-00004-of-00004.safetensors",
592
+ "backbone.blocks.36.norm1.bias": "model-00004-of-00004.safetensors",
593
+ "backbone.blocks.36.norm1.weight": "model-00004-of-00004.safetensors",
594
+ "backbone.blocks.36.norm2.bias": "model-00004-of-00004.safetensors",
595
+ "backbone.blocks.36.norm2.weight": "model-00004-of-00004.safetensors",
596
+ "backbone.blocks.37.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
597
+ "backbone.blocks.37.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
598
+ "backbone.blocks.37.attn.k_norm.weight": "model-00004-of-00004.safetensors",
599
+ "backbone.blocks.37.attn.proj.bias": "model-00004-of-00004.safetensors",
600
+ "backbone.blocks.37.attn.proj.weight": "model-00004-of-00004.safetensors",
601
+ "backbone.blocks.37.attn.q_norm.weight": "model-00004-of-00004.safetensors",
602
+ "backbone.blocks.37.attn.qkv.weight": "model-00004-of-00004.safetensors",
603
+ "backbone.blocks.37.ls1.gamma": "model-00004-of-00004.safetensors",
604
+ "backbone.blocks.37.ls2.gamma": "model-00004-of-00004.safetensors",
605
+ "backbone.blocks.37.mlp.w1.bias": "model-00004-of-00004.safetensors",
606
+ "backbone.blocks.37.mlp.w1.weight": "model-00004-of-00004.safetensors",
607
+ "backbone.blocks.37.mlp.w2.bias": "model-00004-of-00004.safetensors",
608
+ "backbone.blocks.37.mlp.w2.weight": "model-00004-of-00004.safetensors",
609
+ "backbone.blocks.37.mlp.w3.bias": "model-00004-of-00004.safetensors",
610
+ "backbone.blocks.37.mlp.w3.weight": "model-00004-of-00004.safetensors",
611
+ "backbone.blocks.37.norm1.bias": "model-00004-of-00004.safetensors",
612
+ "backbone.blocks.37.norm1.weight": "model-00004-of-00004.safetensors",
613
+ "backbone.blocks.37.norm2.bias": "model-00004-of-00004.safetensors",
614
+ "backbone.blocks.37.norm2.weight": "model-00004-of-00004.safetensors",
615
+ "backbone.blocks.38.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
616
+ "backbone.blocks.38.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
617
+ "backbone.blocks.38.attn.k_norm.weight": "model-00004-of-00004.safetensors",
618
+ "backbone.blocks.38.attn.proj.bias": "model-00004-of-00004.safetensors",
619
+ "backbone.blocks.38.attn.proj.weight": "model-00004-of-00004.safetensors",
620
+ "backbone.blocks.38.attn.q_norm.weight": "model-00004-of-00004.safetensors",
621
+ "backbone.blocks.38.attn.qkv.weight": "model-00004-of-00004.safetensors",
622
+ "backbone.blocks.38.ls1.gamma": "model-00004-of-00004.safetensors",
623
+ "backbone.blocks.38.ls2.gamma": "model-00004-of-00004.safetensors",
624
+ "backbone.blocks.38.mlp.w1.bias": "model-00004-of-00004.safetensors",
625
+ "backbone.blocks.38.mlp.w1.weight": "model-00004-of-00004.safetensors",
626
+ "backbone.blocks.38.mlp.w2.bias": "model-00004-of-00004.safetensors",
627
+ "backbone.blocks.38.mlp.w2.weight": "model-00004-of-00004.safetensors",
628
+ "backbone.blocks.38.mlp.w3.bias": "model-00004-of-00004.safetensors",
629
+ "backbone.blocks.38.mlp.w3.weight": "model-00004-of-00004.safetensors",
630
+ "backbone.blocks.38.norm1.bias": "model-00004-of-00004.safetensors",
631
+ "backbone.blocks.38.norm1.weight": "model-00004-of-00004.safetensors",
632
+ "backbone.blocks.38.norm2.bias": "model-00004-of-00004.safetensors",
633
+ "backbone.blocks.38.norm2.weight": "model-00004-of-00004.safetensors",
634
+ "backbone.blocks.39.attn.gate_proj.bias": "model-00004-of-00004.safetensors",
635
+ "backbone.blocks.39.attn.gate_proj.weight": "model-00004-of-00004.safetensors",
636
+ "backbone.blocks.39.attn.k_norm.weight": "model-00004-of-00004.safetensors",
637
+ "backbone.blocks.39.attn.proj.bias": "model-00004-of-00004.safetensors",
638
+ "backbone.blocks.39.attn.proj.weight": "model-00004-of-00004.safetensors",
639
+ "backbone.blocks.39.attn.q_norm.weight": "model-00004-of-00004.safetensors",
640
+ "backbone.blocks.39.attn.qkv.weight": "model-00004-of-00004.safetensors",
641
+ "backbone.blocks.39.ls1.gamma": "model-00004-of-00004.safetensors",
642
+ "backbone.blocks.39.ls2.gamma": "model-00004-of-00004.safetensors",
643
+ "backbone.blocks.39.mlp.w1.bias": "model-00004-of-00004.safetensors",
644
+ "backbone.blocks.39.mlp.w1.weight": "model-00004-of-00004.safetensors",
645
+ "backbone.blocks.39.mlp.w2.bias": "model-00004-of-00004.safetensors",
646
+ "backbone.blocks.39.mlp.w2.weight": "model-00004-of-00004.safetensors",
647
+ "backbone.blocks.39.mlp.w3.bias": "model-00004-of-00004.safetensors",
648
+ "backbone.blocks.39.mlp.w3.weight": "model-00004-of-00004.safetensors",
649
+ "backbone.blocks.39.norm1.bias": "model-00004-of-00004.safetensors",
650
+ "backbone.blocks.39.norm1.weight": "model-00004-of-00004.safetensors",
651
+ "backbone.blocks.39.norm2.bias": "model-00004-of-00004.safetensors",
652
+ "backbone.blocks.39.norm2.weight": "model-00004-of-00004.safetensors",
653
+ "backbone.blocks.4.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
654
+ "backbone.blocks.4.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
655
+ "backbone.blocks.4.attn.k_norm.weight": "model-00001-of-00004.safetensors",
656
+ "backbone.blocks.4.attn.proj.bias": "model-00001-of-00004.safetensors",
657
+ "backbone.blocks.4.attn.proj.weight": "model-00001-of-00004.safetensors",
658
+ "backbone.blocks.4.attn.q_norm.weight": "model-00001-of-00004.safetensors",
659
+ "backbone.blocks.4.attn.qkv.weight": "model-00001-of-00004.safetensors",
660
+ "backbone.blocks.4.ls1.gamma": "model-00001-of-00004.safetensors",
661
+ "backbone.blocks.4.ls2.gamma": "model-00001-of-00004.safetensors",
662
+ "backbone.blocks.4.mlp.w1.bias": "model-00001-of-00004.safetensors",
663
+ "backbone.blocks.4.mlp.w1.weight": "model-00001-of-00004.safetensors",
664
+ "backbone.blocks.4.mlp.w2.bias": "model-00001-of-00004.safetensors",
665
+ "backbone.blocks.4.mlp.w2.weight": "model-00001-of-00004.safetensors",
666
+ "backbone.blocks.4.mlp.w3.bias": "model-00001-of-00004.safetensors",
667
+ "backbone.blocks.4.mlp.w3.weight": "model-00001-of-00004.safetensors",
668
+ "backbone.blocks.4.norm1.bias": "model-00001-of-00004.safetensors",
669
+ "backbone.blocks.4.norm1.weight": "model-00001-of-00004.safetensors",
670
+ "backbone.blocks.4.norm2.bias": "model-00001-of-00004.safetensors",
671
+ "backbone.blocks.4.norm2.weight": "model-00001-of-00004.safetensors",
672
+ "backbone.blocks.5.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
673
+ "backbone.blocks.5.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
674
+ "backbone.blocks.5.attn.k_norm.weight": "model-00001-of-00004.safetensors",
675
+ "backbone.blocks.5.attn.proj.bias": "model-00001-of-00004.safetensors",
676
+ "backbone.blocks.5.attn.proj.weight": "model-00001-of-00004.safetensors",
677
+ "backbone.blocks.5.attn.q_norm.weight": "model-00001-of-00004.safetensors",
678
+ "backbone.blocks.5.attn.qkv.weight": "model-00001-of-00004.safetensors",
679
+ "backbone.blocks.5.ls1.gamma": "model-00001-of-00004.safetensors",
680
+ "backbone.blocks.5.ls2.gamma": "model-00001-of-00004.safetensors",
681
+ "backbone.blocks.5.mlp.w1.bias": "model-00001-of-00004.safetensors",
682
+ "backbone.blocks.5.mlp.w1.weight": "model-00001-of-00004.safetensors",
683
+ "backbone.blocks.5.mlp.w2.bias": "model-00001-of-00004.safetensors",
684
+ "backbone.blocks.5.mlp.w2.weight": "model-00001-of-00004.safetensors",
685
+ "backbone.blocks.5.mlp.w3.bias": "model-00001-of-00004.safetensors",
686
+ "backbone.blocks.5.mlp.w3.weight": "model-00001-of-00004.safetensors",
687
+ "backbone.blocks.5.norm1.bias": "model-00001-of-00004.safetensors",
688
+ "backbone.blocks.5.norm1.weight": "model-00001-of-00004.safetensors",
689
+ "backbone.blocks.5.norm2.bias": "model-00001-of-00004.safetensors",
690
+ "backbone.blocks.5.norm2.weight": "model-00001-of-00004.safetensors",
691
+ "backbone.blocks.6.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
692
+ "backbone.blocks.6.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
693
+ "backbone.blocks.6.attn.k_norm.weight": "model-00001-of-00004.safetensors",
694
+ "backbone.blocks.6.attn.proj.bias": "model-00001-of-00004.safetensors",
695
+ "backbone.blocks.6.attn.proj.weight": "model-00001-of-00004.safetensors",
696
+ "backbone.blocks.6.attn.q_norm.weight": "model-00001-of-00004.safetensors",
697
+ "backbone.blocks.6.attn.qkv.weight": "model-00001-of-00004.safetensors",
698
+ "backbone.blocks.6.ls1.gamma": "model-00001-of-00004.safetensors",
699
+ "backbone.blocks.6.ls2.gamma": "model-00001-of-00004.safetensors",
700
+ "backbone.blocks.6.mlp.w1.bias": "model-00001-of-00004.safetensors",
701
+ "backbone.blocks.6.mlp.w1.weight": "model-00001-of-00004.safetensors",
702
+ "backbone.blocks.6.mlp.w2.bias": "model-00001-of-00004.safetensors",
703
+ "backbone.blocks.6.mlp.w2.weight": "model-00001-of-00004.safetensors",
704
+ "backbone.blocks.6.mlp.w3.bias": "model-00001-of-00004.safetensors",
705
+ "backbone.blocks.6.mlp.w3.weight": "model-00001-of-00004.safetensors",
706
+ "backbone.blocks.6.norm1.bias": "model-00001-of-00004.safetensors",
707
+ "backbone.blocks.6.norm1.weight": "model-00001-of-00004.safetensors",
708
+ "backbone.blocks.6.norm2.bias": "model-00001-of-00004.safetensors",
709
+ "backbone.blocks.6.norm2.weight": "model-00001-of-00004.safetensors",
710
+ "backbone.blocks.7.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
711
+ "backbone.blocks.7.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
712
+ "backbone.blocks.7.attn.k_norm.weight": "model-00001-of-00004.safetensors",
713
+ "backbone.blocks.7.attn.proj.bias": "model-00001-of-00004.safetensors",
714
+ "backbone.blocks.7.attn.proj.weight": "model-00001-of-00004.safetensors",
715
+ "backbone.blocks.7.attn.q_norm.weight": "model-00001-of-00004.safetensors",
716
+ "backbone.blocks.7.attn.qkv.weight": "model-00001-of-00004.safetensors",
717
+ "backbone.blocks.7.ls1.gamma": "model-00001-of-00004.safetensors",
718
+ "backbone.blocks.7.ls2.gamma": "model-00001-of-00004.safetensors",
719
+ "backbone.blocks.7.mlp.w1.bias": "model-00001-of-00004.safetensors",
720
+ "backbone.blocks.7.mlp.w1.weight": "model-00001-of-00004.safetensors",
721
+ "backbone.blocks.7.mlp.w2.bias": "model-00001-of-00004.safetensors",
722
+ "backbone.blocks.7.mlp.w2.weight": "model-00001-of-00004.safetensors",
723
+ "backbone.blocks.7.mlp.w3.bias": "model-00001-of-00004.safetensors",
724
+ "backbone.blocks.7.mlp.w3.weight": "model-00001-of-00004.safetensors",
725
+ "backbone.blocks.7.norm1.bias": "model-00001-of-00004.safetensors",
726
+ "backbone.blocks.7.norm1.weight": "model-00001-of-00004.safetensors",
727
+ "backbone.blocks.7.norm2.bias": "model-00001-of-00004.safetensors",
728
+ "backbone.blocks.7.norm2.weight": "model-00001-of-00004.safetensors",
729
+ "backbone.blocks.8.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
730
+ "backbone.blocks.8.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
731
+ "backbone.blocks.8.attn.k_norm.weight": "model-00001-of-00004.safetensors",
732
+ "backbone.blocks.8.attn.proj.bias": "model-00001-of-00004.safetensors",
733
+ "backbone.blocks.8.attn.proj.weight": "model-00001-of-00004.safetensors",
734
+ "backbone.blocks.8.attn.q_norm.weight": "model-00001-of-00004.safetensors",
735
+ "backbone.blocks.8.attn.qkv.weight": "model-00001-of-00004.safetensors",
736
+ "backbone.blocks.8.ls1.gamma": "model-00001-of-00004.safetensors",
737
+ "backbone.blocks.8.ls2.gamma": "model-00001-of-00004.safetensors",
738
+ "backbone.blocks.8.mlp.w1.bias": "model-00001-of-00004.safetensors",
739
+ "backbone.blocks.8.mlp.w1.weight": "model-00001-of-00004.safetensors",
740
+ "backbone.blocks.8.mlp.w2.bias": "model-00001-of-00004.safetensors",
741
+ "backbone.blocks.8.mlp.w2.weight": "model-00001-of-00004.safetensors",
742
+ "backbone.blocks.8.mlp.w3.bias": "model-00001-of-00004.safetensors",
743
+ "backbone.blocks.8.mlp.w3.weight": "model-00001-of-00004.safetensors",
744
+ "backbone.blocks.8.norm1.bias": "model-00001-of-00004.safetensors",
745
+ "backbone.blocks.8.norm1.weight": "model-00001-of-00004.safetensors",
746
+ "backbone.blocks.8.norm2.bias": "model-00001-of-00004.safetensors",
747
+ "backbone.blocks.8.norm2.weight": "model-00001-of-00004.safetensors",
748
+ "backbone.blocks.9.attn.gate_proj.bias": "model-00001-of-00004.safetensors",
749
+ "backbone.blocks.9.attn.gate_proj.weight": "model-00001-of-00004.safetensors",
750
+ "backbone.blocks.9.attn.k_norm.weight": "model-00001-of-00004.safetensors",
751
+ "backbone.blocks.9.attn.proj.bias": "model-00001-of-00004.safetensors",
752
+ "backbone.blocks.9.attn.proj.weight": "model-00001-of-00004.safetensors",
753
+ "backbone.blocks.9.attn.q_norm.weight": "model-00001-of-00004.safetensors",
754
+ "backbone.blocks.9.attn.qkv.weight": "model-00001-of-00004.safetensors",
755
+ "backbone.blocks.9.ls1.gamma": "model-00001-of-00004.safetensors",
756
+ "backbone.blocks.9.ls2.gamma": "model-00001-of-00004.safetensors",
757
+ "backbone.blocks.9.mlp.w1.bias": "model-00001-of-00004.safetensors",
758
+ "backbone.blocks.9.mlp.w1.weight": "model-00001-of-00004.safetensors",
759
+ "backbone.blocks.9.mlp.w2.bias": "model-00001-of-00004.safetensors",
760
+ "backbone.blocks.9.mlp.w2.weight": "model-00001-of-00004.safetensors",
761
+ "backbone.blocks.9.mlp.w3.bias": "model-00001-of-00004.safetensors",
762
+ "backbone.blocks.9.mlp.w3.weight": "model-00001-of-00004.safetensors",
763
+ "backbone.blocks.9.norm1.bias": "model-00001-of-00004.safetensors",
764
+ "backbone.blocks.9.norm1.weight": "model-00001-of-00004.safetensors",
765
+ "backbone.blocks.9.norm2.bias": "model-00001-of-00004.safetensors",
766
+ "backbone.blocks.9.norm2.weight": "model-00001-of-00004.safetensors",
767
+ "backbone.cls_token": "model-00001-of-00004.safetensors",
768
+ "backbone.local_cls_norm.bias": "model-00004-of-00004.safetensors",
769
+ "backbone.local_cls_norm.weight": "model-00004-of-00004.safetensors",
770
+ "backbone.mask_token": "model-00001-of-00004.safetensors",
771
+ "backbone.norm.bias": "model-00004-of-00004.safetensors",
772
+ "backbone.norm.weight": "model-00004-of-00004.safetensors",
773
+ "backbone.patch_embed.proj.bias": "model-00001-of-00004.safetensors",
774
+ "backbone.patch_embed.proj.weight": "model-00001-of-00004.safetensors",
775
+ "backbone.rope_embed.periods_h": "model-00001-of-00004.safetensors",
776
+ "backbone.rope_embed.periods_t": "model-00001-of-00004.safetensors",
777
+ "backbone.rope_embed.periods_w": "model-00001-of-00004.safetensors",
778
+ "backbone.storage_tokens": "model-00001-of-00004.safetensors"
779
+ }
780
+ }
modeling_motif_vision_encoder.py ADDED
@@ -0,0 +1,1468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) Motif Technologies.
2
+ # Self-contained inference model for Motif Vision Encoder (image + video).
3
+ # Auto-assembled from the training repo's inference path; NO training code.
4
+ """Motif Vision Encoder — unified image/video ViT backbone (inference-only).
5
+
6
+ Usage:
7
+ from transformers import AutoModel
8
+ import torch
9
+ model = AutoModel.from_pretrained("Motif-Technologies/motif-vision-encoder",
10
+ trust_remote_code=True).eval()
11
+ # image: (B, 3, H, W) video: (B, T, 3, H, W) (H,W multiples of 16)
12
+ out = model(pixel_values=torch.randn(1, 3, 224, 224))
13
+ out.last_hidden_state # (B, 1+num_register+N, D)
14
+ out.pooler_output # (B, D) CLS token
15
+ """
16
+ import logging
17
+ import math
18
+ from functools import partial
19
+ from typing import Any, Callable, Literal
20
+
21
+ import numpy as np
22
+ import torch
23
+ import torch.nn as nn
24
+ import torch.nn.functional as F
25
+ from torch import Tensor
26
+
27
+ from transformers import PreTrainedModel, PretrainedConfig
28
+ from transformers.modeling_outputs import BaseModelOutputWithPooling
29
+
30
+
31
+
32
+ # ---- utils ----
33
+
34
+
35
+ def cat_keep_shapes(x_list: list[Tensor]) -> tuple[Tensor, list[tuple[int]], list[int]]:
36
+ """Concatenate list of tensors while preserving their shapes for later reconstruction."""
37
+ shapes = [x.shape for x in x_list]
38
+ num_tokens = [x.select(dim=-1, index=0).numel() for x in x_list]
39
+ flattened = torch.cat([x.flatten(0, -2) for x in x_list])
40
+ return flattened, shapes, num_tokens
41
+
42
+
43
+
44
+ def uncat_with_shapes(flattened: Tensor, shapes: list[tuple[int]], num_tokens: list[int]) -> list[Tensor]:
45
+ """Reverse of cat_keep_shapes: split and reshape flattened tensor back to original shapes."""
46
+ outputs_splitted = torch.split_with_sizes(flattened, num_tokens, dim=0)
47
+ shapes_adjusted = [shape[:-1] + torch.Size([flattened.shape[-1]]) for shape in shapes]
48
+ outputs_reshaped = [o.reshape(shape) for o, shape in zip(outputs_splitted, shapes_adjusted)]
49
+ return outputs_reshaped
50
+
51
+
52
+
53
+ # ---- rms_norm ----
54
+
55
+
56
+ class RMSNorm(nn.Module):
57
+ """Root Mean Square Layer Normalization.
58
+
59
+ A simpler alternative to LayerNorm that normalizes by RMS without centering.
60
+
61
+ Args:
62
+ dim: Number of features.
63
+ eps: Small constant for numerical stability.
64
+ """
65
+
66
+ def __init__(
67
+ self,
68
+ dim: int,
69
+ eps: float = 1e-6,
70
+ device: torch.device | str | None = None,
71
+ ) -> None:
72
+ super().__init__()
73
+ self.eps = eps
74
+ self.weight = nn.Parameter(torch.ones(dim, device=device))
75
+
76
+ def forward(self, x: Tensor) -> Tensor:
77
+ """Apply RMS normalization."""
78
+ rms = torch.sqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
79
+ return x / rms * self.weight
80
+
81
+
82
+ # ---- layer_scale ----
83
+
84
+
85
+ class LayerScale(nn.Module):
86
+ """Per-channel scaling that allows gradual incorporation of each layer's contribution.
87
+
88
+ Initializes to a small value (e.g., 1e-5) so that early in training, each layer's
89
+ contribution is nearly zero, stabilizing deep network training.
90
+
91
+ Args:
92
+ dim: Number of channels.
93
+ init_values: Initial value for all channels.
94
+ inplace: Whether to apply scaling in-place.
95
+ device: Device for parameter allocation.
96
+ """
97
+
98
+ def __init__(
99
+ self,
100
+ dim: int,
101
+ init_values: float | Tensor = 1e-5,
102
+ inplace: bool = False,
103
+ device: torch.device | None = None,
104
+ ) -> None:
105
+ super().__init__()
106
+ self.inplace = inplace
107
+ self.gamma = nn.Parameter(torch.empty(dim, device=device))
108
+ self.init_values = init_values
109
+
110
+ def forward(self, x: Tensor) -> Tensor:
111
+ """Apply per-channel scaling."""
112
+ return x.mul_(self.gamma) if self.inplace else x * self.gamma
113
+
114
+
115
+ # ---- patch_embed ----
116
+
117
+
118
+ class PatchEmbed(nn.Module):
119
+ """Video (5D) or Image (4D) to Patch Embedding via 3D Convolution.
120
+
121
+ Handles both modalities through a single Conv3d projection:
122
+ - Image (B, C, H, W): unsqueeze temporal dim -> (B, C, 1, H, W) -> Conv3d
123
+ - Video (B, T, C, H, W): transpose -> (B, C, T, H, W) -> Conv3d
124
+
125
+ Output: (B, N_total, embed_dim)
126
+ N_total = (T // tubelet_size) * (H // patch_size) * (W // patch_size)
127
+
128
+ Args:
129
+ img_size: Input image size (used for reference only).
130
+ patch_size: Spatial patch size in pixels.
131
+ in_chans: Number of input channels.
132
+ embed_dim: Output embedding dimension.
133
+ tubelet_size: Temporal patch size (number of frames per temporal token).
134
+ flatten_embedding: Whether to flatten spatial dimensions.
135
+ """
136
+
137
+ def __init__(
138
+ self,
139
+ img_size: int = 224,
140
+ patch_size: int = 16,
141
+ in_chans: int = 3,
142
+ embed_dim: int = 768,
143
+ tubelet_size: int = 1,
144
+ flatten_embedding: bool = True,
145
+ ) -> None:
146
+ super().__init__()
147
+ self.img_size = img_size
148
+ self.patch_size = (patch_size, patch_size) if isinstance(patch_size, int) else patch_size
149
+ self.tubelet_size = tubelet_size
150
+ self.flatten_embedding = flatten_embedding
151
+ self.in_chans = in_chans
152
+
153
+ # 3D Convolution: kernel and stride = (tubelet_size, patch_h, patch_w)
154
+ self.proj = nn.Conv3d(
155
+ in_chans,
156
+ embed_dim,
157
+ kernel_size=(tubelet_size, self.patch_size[0], self.patch_size[1]),
158
+ stride=(tubelet_size, self.patch_size[0], self.patch_size[1]),
159
+ )
160
+
161
+ def forward(self, x: Tensor) -> Tensor:
162
+ """Tokenize input images or videos.
163
+
164
+ Args:
165
+ x: Input tensor.
166
+ Image: (B, C, H, W) or Video: (B, T, C, H, W)
167
+
168
+ Returns:
169
+ Patch tokens of shape (B, N_total, embed_dim).
170
+ """
171
+ if x.ndim == 4:
172
+ # Image: (B, C, H, W) -> (B, C, 1, H, W)
173
+ x = x.unsqueeze(2)
174
+ # If tubelet_size > 1, repeat the single frame to match kernel size
175
+ if self.tubelet_size > 1:
176
+ x = x.expand(-1, -1, self.tubelet_size, -1, -1)
177
+ elif x.ndim == 5:
178
+ # Video: (B, T, C, H, W) -> (B, C, T, H, W)
179
+ x = x.transpose(1, 2)
180
+
181
+ # Conv3d Projection -> (B, embed_dim, T', H', W')
182
+ x = self.proj(x)
183
+
184
+ if self.flatten_embedding:
185
+ # Flatten spatial+temporal: (B, embed_dim, N) -> (B, N, embed_dim)
186
+ x = x.flatten(2).transpose(1, 2)
187
+
188
+ return x
189
+
190
+
191
+ # ---- rope ----
192
+
193
+
194
+ class RopePositionEmbedding3D(nn.Module):
195
+ """Full 3D axial RoPE with independent T/H/W frequency bands.
196
+
197
+ Unlike the original Motif implementation which simply repeats 2D spatial angles
198
+ across temporal frames (making temporal positions indistinguishable), this
199
+ implementation partitions the head dimension into three axis groups:
200
+
201
+ D_head = D_T + D_H + D_W (no spare dimensions)
202
+
203
+ By default, the split is spatial-heavy for SSL (spatial quality is priority):
204
+ D_T = D_head // 4 (25% temporal)
205
+ D_H = (D_head - D_T) // 2 (37.5% height)
206
+ D_W = D_head - D_T - D_H (37.5% width)
207
+ e.g., D_head=64 → T=16, H=24, W=24
208
+
209
+ This can be overridden via ``fhw_dim=(D_T, D_H, D_W)`` for full control.
210
+
211
+ For images (T=1): t=0 for all tokens, making temporal angles constant
212
+ and the output is equivalent to spatial-only RoPE.
213
+
214
+ Args:
215
+ embed_dim: Total embedding dimension.
216
+ num_heads: Number of attention heads.
217
+ fhw_dim: Optional explicit (D_T, D_H, D_W) partition. Each must be even.
218
+ If None, uses the spatial-heavy default described above.
219
+ base: Frequency base (100.0 for spatial vision convention).
220
+ min_period: Minimum period (alternative to base).
221
+ max_period: Maximum period (alternative to base).
222
+ normalize_coords: How to normalize coordinates.
223
+ shift_coords: Random shift range during training.
224
+ jitter_coords: Random jitter multiplier during training.
225
+ rescale_coords: Random rescale multiplier during training.
226
+ dtype: Data type for computation.
227
+ device: Device for parameter allocation.
228
+ """
229
+
230
+ def __init__(
231
+ self,
232
+ embed_dim: int,
233
+ *,
234
+ num_heads: int,
235
+ fhw_dim: tuple[int, int, int] | None = None,
236
+ base: float | None = 100.0,
237
+ min_period: float | None = None,
238
+ max_period: float | None = None,
239
+ normalize_coords: Literal["min", "max", "separate"] = "separate",
240
+ shift_coords: float | None = None,
241
+ jitter_coords: float | None = None,
242
+ rescale_coords: float | None = None,
243
+ dtype: torch.dtype | None = None,
244
+ device: torch.device | None = None,
245
+ ) -> None:
246
+ super().__init__()
247
+ both_periods = min_period is not None and max_period is not None
248
+ if (base is None and not both_periods) or (base is not None and both_periods):
249
+ raise ValueError("Either `base` or `min_period`+`max_period` must be provided.")
250
+
251
+ D_head = embed_dim // num_heads
252
+ self.base = base
253
+ self.min_period = min_period
254
+ self.max_period = max_period
255
+ self.D_head = D_head
256
+ self.normalize_coords = normalize_coords
257
+ self.shift_coords = shift_coords
258
+ self.jitter_coords = jitter_coords
259
+ self.rescale_coords = rescale_coords
260
+
261
+ # Partition head dimension into 3 groups: T, H, W (no spare)
262
+ if fhw_dim is not None:
263
+ self.D_T, self.D_H, self.D_W = fhw_dim
264
+ assert self.D_T + self.D_H + self.D_W == D_head, (
265
+ f"fhw_dim must sum to D_head={D_head}, got {sum(fhw_dim)}"
266
+ )
267
+ else:
268
+ # Default: spatial-heavy split (SSL prioritizes spatial quality)
269
+ self.D_T = D_head // 4 # 25% temporal
270
+ self.D_H = (D_head - self.D_T) // 2 # 37.5% height
271
+ self.D_W = D_head - self.D_T - self.D_H # 37.5% width
272
+ assert self.D_T % 2 == 0 and self.D_H % 2 == 0 and self.D_W % 2 == 0, (
273
+ f"All axis dims must be even, got T={self.D_T}, H={self.D_H}, W={self.D_W}"
274
+ )
275
+
276
+ self.dtype = dtype
277
+ # Separate period buffers for each axis (n_freqs = D_axis // 2)
278
+ self.register_buffer(
279
+ "periods_t",
280
+ torch.empty(self.D_T // 2, device=device, dtype=dtype),
281
+ persistent=True,
282
+ )
283
+ self.register_buffer(
284
+ "periods_h",
285
+ torch.empty(self.D_H // 2, device=device, dtype=dtype),
286
+ persistent=True,
287
+ )
288
+ self.register_buffer(
289
+ "periods_w",
290
+ torch.empty(self.D_W // 2, device=device, dtype=dtype),
291
+ persistent=True,
292
+ )
293
+ self._init_weights()
294
+
295
+ def forward(self, *, T: int = 1, H: int, W: int) -> tuple[Tensor, Tensor]:
296
+ """Compute 3D axial RoPE sin/cos for (T, H, W) grid.
297
+
298
+ The head dimension is partitioned as [D_T | D_H | D_W]:
299
+ - D_T: temporal frequency bands (angles vary with t)
300
+ - D_H: height frequency bands (angles vary with h)
301
+ - D_W: width frequency bands (angles vary with w)
302
+
303
+ For images (T=1), all tokens get t=0, so temporal angles are constant
304
+ and the output is equivalent to spatial-only RoPE.
305
+
306
+ Args:
307
+ T: Number of temporal positions (T_grid = num_frames // tubelet_size).
308
+ H: Height in patches.
309
+ W: Width in patches.
310
+
311
+ Returns:
312
+ Tuple of (sin, cos), each of shape (T*H*W, D_head).
313
+ """
314
+ device = self.periods_t.device
315
+ dtype = self.dtype
316
+ dd = {"device": device, "dtype": dtype}
317
+
318
+ # 1. Compute normalized coordinates for each axis
319
+ if T > 1:
320
+ coords_t = torch.arange(0.5, T, **dd) / T # [T]
321
+ else:
322
+ coords_t = torch.tensor([0.5], **dd) # [1] - constant for images
323
+
324
+ coords_h, coords_w = self._compute_spatial_coords(H, W, **dd)
325
+
326
+ # Shift to [-1, +1] range
327
+ coords_t = 2.0 * coords_t - 1.0 # [T]
328
+ coords_h = 2.0 * coords_h - 1.0 # [H]
329
+ coords_w = 2.0 * coords_w - 1.0 # [W]
330
+
331
+ # Apply training-time augmentations to spatial coords only
332
+ if self.training:
333
+ coords_h, coords_w = self._augment_spatial_coords(coords_h, coords_w, dd)
334
+
335
+ # 2. Compute raw angles for each axis (n_freqs = D_axis // 2)
336
+ angles_t = 2 * math.pi * coords_t[:, None] / self.periods_t[None, :] # [T, D_T//2]
337
+ angles_h = 2 * math.pi * coords_h[:, None] / self.periods_h[None, :] # [H, D_H//2]
338
+ angles_w = 2 * math.pi * coords_w[:, None] / self.periods_w[None, :] # [W, D_W//2]
339
+
340
+ # 3. Build full 3D grid: create (T*H*W, D_head) angle tensor
341
+ t_idx, h_idx, w_idx = torch.meshgrid(
342
+ torch.arange(T, device=device),
343
+ torch.arange(H, device=device),
344
+ torch.arange(W, device=device),
345
+ indexing="ij",
346
+ )
347
+ t_idx = t_idx.flatten() # [T*H*W]
348
+ h_idx = h_idx.flatten() # [T*H*W]
349
+ w_idx = w_idx.flatten() # [T*H*W]
350
+
351
+ # Gather per-token raw angles and concatenate to D_head//2
352
+ token_angles_t = angles_t[t_idx] # [T*H*W, D_T//2]
353
+ token_angles_h = angles_h[h_idx] # [T*H*W, D_H//2]
354
+ token_angles_w = angles_w[w_idx] # [T*H*W, D_W//2]
355
+ angles_half = torch.cat([token_angles_t, token_angles_h, token_angles_w], dim=-1) # [T*H*W, D_head//2]
356
+
357
+ # tile(2) on full concat — matches Motif 2D RoPE pattern
358
+ # This ensures rotate_half pairs (dim i ↔ dim i+D//2) have identical angles,
359
+ # making the rotation orthogonal (preserves dot products in attention).
360
+ angles = angles_half.tile(2) # [T*H*W, D_head]
361
+
362
+ cos = torch.cos(angles)
363
+ sin = torch.sin(angles)
364
+
365
+ return (sin, cos)
366
+
367
+ def _compute_spatial_coords(self, H: int, W: int, **dd) -> tuple[Tensor, Tensor]:
368
+ """Compute normalized spatial coordinates."""
369
+ if self.normalize_coords == "max":
370
+ max_HW = max(H, W)
371
+ coords_h = torch.arange(0.5, H, **dd) / max_HW
372
+ coords_w = torch.arange(0.5, W, **dd) / max_HW
373
+ elif self.normalize_coords == "min":
374
+ min_HW = min(H, W)
375
+ coords_h = torch.arange(0.5, H, **dd) / min_HW
376
+ coords_w = torch.arange(0.5, W, **dd) / min_HW
377
+ elif self.normalize_coords == "separate":
378
+ coords_h = torch.arange(0.5, H, **dd) / H
379
+ coords_w = torch.arange(0.5, W, **dd) / W
380
+ else:
381
+ raise ValueError(f"Unknown normalize_coords: {self.normalize_coords}")
382
+ return coords_h, coords_w
383
+
384
+ def _augment_spatial_coords(
385
+ self,
386
+ coords_h: Tensor,
387
+ coords_w: Tensor,
388
+ dd: dict,
389
+ ) -> tuple[Tensor, Tensor]:
390
+ """Apply training-time coordinate augmentations to spatial coords."""
391
+ if self.shift_coords is not None:
392
+ shift = torch.empty(2, **dd).uniform_(-self.shift_coords, self.shift_coords)
393
+ coords_h = coords_h + shift[0]
394
+ coords_w = coords_w + shift[1]
395
+ if self.jitter_coords is not None:
396
+ jitter_max = np.log(self.jitter_coords)
397
+ jitter = torch.empty(2, **dd).uniform_(-jitter_max, jitter_max).exp()
398
+ coords_h = coords_h * jitter[0]
399
+ coords_w = coords_w * jitter[1]
400
+ if self.rescale_coords is not None:
401
+ rescale_max = np.log(self.rescale_coords)
402
+ rescale = torch.empty(1, **dd).uniform_(-rescale_max, rescale_max).exp()
403
+ coords_h = coords_h * rescale
404
+ coords_w = coords_w * rescale
405
+ return coords_h, coords_w
406
+
407
+ def _compute_periods(self, n_freqs: int, device: torch.device, dtype: torch.dtype | None) -> Tensor:
408
+ """Compute frequency periods for a single axis.
409
+
410
+ Args:
411
+ n_freqs: Number of frequency bands (D_axis // 2).
412
+ device: Device for tensor allocation.
413
+ dtype: Data type for computation.
414
+
415
+ Returns:
416
+ Tensor of shape (n_freqs,) with logarithmically spaced periods.
417
+ """
418
+ if self.base is not None:
419
+ return self.base ** (
420
+ 2 * torch.arange(n_freqs, device=device, dtype=dtype) / (2 * n_freqs)
421
+ )
422
+ else:
423
+ base = self.max_period / self.min_period
424
+ exponents = torch.linspace(0, 1, n_freqs, device=device, dtype=dtype)
425
+ periods = base**exponents
426
+ periods = periods / base
427
+ return periods * self.max_period
428
+
429
+ def _init_weights(self) -> None:
430
+ """Initialize frequency periods for all three axes.
431
+
432
+ Each axis gets its own frequency schedule based on its dimension size:
433
+ periods[i] = base^(2i / D_axis)
434
+
435
+ This produces logarithmically spaced periods from 1.0 to base,
436
+ with more frequencies for axes with more allocated dimensions.
437
+ """
438
+ device = self.periods_t.device
439
+ dtype = self.dtype
440
+
441
+ self.periods_t.data = self._compute_periods(self.D_T // 2, device, dtype)
442
+ self.periods_h.data = self._compute_periods(self.D_H // 2, device, dtype)
443
+ self.periods_w.data = self._compute_periods(self.D_W // 2, device, dtype)
444
+
445
+
446
+ # ---- attention ----
447
+
448
+
449
+ def rope_rotate_half(x: Tensor) -> Tensor:
450
+ """Rotate half of the dimensions: [-x2, x1] from [x1, x2].
451
+
452
+ Args:
453
+ x: Input tensor of shape (..., D).
454
+
455
+ Returns:
456
+ Rotated tensor of shape (..., D).
457
+ """
458
+ x1, x2 = x.chunk(2, dim=-1)
459
+ return torch.cat([-x2, x1], dim=-1)
460
+
461
+
462
+ def rope_apply(x: Tensor, sin: Tensor, cos: Tensor) -> Tensor:
463
+ """Apply rotary position embedding to input tensor.
464
+
465
+ Args:
466
+ x: Input tensor of shape (..., D).
467
+ sin: Sine angles of shape (..., D).
468
+ cos: Cosine angles of shape (..., D).
469
+
470
+ Returns:
471
+ Rotated tensor of shape (..., D).
472
+ """
473
+ return (x * cos) + (rope_rotate_half(x) * sin)
474
+
475
+
476
+ class LinearKMaskedBias(nn.Linear):
477
+ """Linear layer with masked bias for the K component of QKV.
478
+
479
+ Zeroes out the bias for the K component (middle third of output)
480
+ to avoid interference with RoPE positional encoding.
481
+ """
482
+
483
+ def __init__(self, *args, **kwargs) -> None:
484
+ super().__init__(*args, **kwargs)
485
+ o = self.out_features
486
+ assert o % 3 == 0
487
+ if self.bias is not None:
488
+ self.register_buffer("bias_mask", torch.full_like(self.bias, fill_value=math.nan))
489
+
490
+ def forward(self, input: Tensor) -> Tensor:
491
+ """Forward pass with masked bias."""
492
+ masked_bias = self.bias * self.bias_mask.to(self.bias.dtype) if self.bias is not None else None
493
+ return F.linear(input, self.weight, masked_bias)
494
+
495
+
496
+ class SelfAttention(nn.Module):
497
+ """Multi-head self-attention with RoPE support.
498
+
499
+ Uses torch.nn.functional.scaled_dot_product_attention for FlashAttention
500
+ compatibility. RoPE is applied to Q and K on patch tokens only (not CLS/register).
501
+
502
+ Args:
503
+ dim: Model dimension.
504
+ num_heads: Number of attention heads.
505
+ qkv_bias: Whether to use bias in QKV projection.
506
+ proj_bias: Whether to use bias in output projection.
507
+ attn_drop: Attention dropout probability.
508
+ proj_drop: Output projection dropout probability.
509
+ mask_k_bias: Whether to mask K bias (for RoPE compatibility).
510
+ device: Device for parameter allocation.
511
+ gated_attention: Gated attention variant. None disables gating,
512
+ "headwise" applies a per-head scalar gate, "elementwise" applies
513
+ a per-element gate. Gate scores are query-dependent (derived from
514
+ input) and applied as sigmoid after SDPA.
515
+ Reference: https://arxiv.org/abs/2505.06708
516
+ """
517
+
518
+ def __init__(
519
+ self,
520
+ dim: int,
521
+ num_heads: int = 8,
522
+ qkv_bias: bool = False,
523
+ proj_bias: bool = True,
524
+ attn_drop: float = 0.0,
525
+ proj_drop: float = 0.0,
526
+ mask_k_bias: bool = False,
527
+ device: str | None = None,
528
+ gated_attention: str | None = None,
529
+ qk_norm: bool = False,
530
+ ) -> None:
531
+ super().__init__()
532
+ self.num_heads = num_heads
533
+ self.head_dim = dim // num_heads
534
+ self.scale = self.head_dim**-0.5
535
+
536
+ linear_class = LinearKMaskedBias if mask_k_bias else nn.Linear
537
+ self.qkv = linear_class(dim, dim * 3, bias=qkv_bias, device=device)
538
+ self.attn_drop = nn.Dropout(attn_drop)
539
+ self.proj = nn.Linear(dim, dim, bias=proj_bias, device=device)
540
+ self.proj_drop = nn.Dropout(proj_drop)
541
+
542
+ self.qk_norm = qk_norm
543
+ if qk_norm:
544
+ self.q_norm = RMSNorm(self.head_dim, device=device)
545
+ self.k_norm = RMSNorm(self.head_dim, device=device)
546
+
547
+ self.gated_attention = gated_attention
548
+ if gated_attention == "headwise":
549
+ self.gate_proj = nn.Linear(dim, num_heads, bias=True, device=device)
550
+ elif gated_attention == "elementwise":
551
+ self.gate_proj = nn.Linear(dim, dim, bias=True, device=device)
552
+ elif gated_attention is not None:
553
+ raise ValueError(f"Unknown gated_attention mode: {gated_attention!r}. Use 'headwise' or 'elementwise'.")
554
+
555
+ def apply_rope(
556
+ self,
557
+ q: Tensor,
558
+ k: Tensor,
559
+ rope: tuple[Tensor, Tensor],
560
+ ) -> tuple[Tensor, Tensor]:
561
+ """Apply RoPE to query and key tensors.
562
+
563
+ RoPE is applied only to patch tokens (prefix tokens like CLS and register
564
+ are excluded based on the difference between sequence length and rope length).
565
+
566
+ Args:
567
+ q: Query tensor of shape (B, heads, N, D_head).
568
+ k: Key tensor of shape (B, heads, N, D_head).
569
+ rope: Tuple of (sin, cos), each of shape (N_patches, D_head).
570
+
571
+ Returns:
572
+ Tuple of rotated (q, k) tensors.
573
+ """
574
+ q_dtype = q.dtype
575
+ k_dtype = k.dtype
576
+ sin, cos = rope
577
+ rope_dtype = sin.dtype
578
+ q = q.to(dtype=rope_dtype)
579
+ k = k.to(dtype=rope_dtype)
580
+ N = q.shape[-2]
581
+ prefix = N - sin.shape[-2]
582
+ assert prefix >= 0
583
+ q_prefix = q[:, :, :prefix, :]
584
+ q = rope_apply(q[:, :, prefix:, :], sin, cos)
585
+ q = torch.cat((q_prefix, q), dim=-2)
586
+ k_prefix = k[:, :, :prefix, :]
587
+ k = rope_apply(k[:, :, prefix:, :], sin, cos)
588
+ k = torch.cat((k_prefix, k), dim=-2)
589
+ q = q.to(dtype=q_dtype)
590
+ k = k.to(dtype=k_dtype)
591
+ return q, k
592
+
593
+ def forward(self, x: Tensor, attn_bias: Tensor | None = None, rope: Tensor | None = None) -> Tensor:
594
+ """Forward pass for single tensor input.
595
+
596
+ Args:
597
+ x: Input tensor of shape (B, N, D).
598
+ attn_bias: Unused (kept for interface compatibility).
599
+ rope: Optional RoPE (sin, cos) tuple.
600
+
601
+ Returns:
602
+ Output tensor of shape (B, N, D).
603
+ """
604
+ gate_score = self._compute_gate(x) if self.gated_attention else None
605
+ qkv = self.qkv(x)
606
+ attn_v = self.compute_attention(qkv=qkv, attn_bias=attn_bias, rope=rope, gate_score=gate_score)
607
+ x = self.proj(attn_v)
608
+ x = self.proj_drop(x)
609
+ return x
610
+
611
+ def forward_list(
612
+ self,
613
+ x_list: list[Tensor],
614
+ attn_bias: Tensor | None = None,
615
+ rope_list: list[tuple[Tensor, Tensor]] | None = None,
616
+ ) -> list[Tensor]:
617
+ """Forward pass for list of tensors (multi-crop efficiency).
618
+
619
+ Concatenates inputs for a single QKV projection, then splits for per-crop
620
+ attention computation (needed because different crops have different RoPE).
621
+
622
+ Args:
623
+ x_list: List of input tensors.
624
+ attn_bias: Unused.
625
+ rope_list: List of RoPE (sin, cos) tuples, one per input.
626
+
627
+ Returns:
628
+ List of output tensors.
629
+ """
630
+ assert len(x_list) == len(rope_list)
631
+ x_flat, shapes, num_tokens = cat_keep_shapes(x_list)
632
+ qkv_flat = self.qkv(x_flat)
633
+ qkv_list = uncat_with_shapes(qkv_flat, shapes, num_tokens)
634
+
635
+ if self.gated_attention:
636
+ gate_flat = self._compute_gate(x_flat)
637
+ gate_list = uncat_with_shapes(gate_flat, shapes, num_tokens)
638
+ else:
639
+ gate_list = [None] * len(x_list)
640
+
641
+ att_out = []
642
+ for qkv, _, rope, gate_score in zip(qkv_list, shapes, rope_list, gate_list):
643
+ att_out.append(self.compute_attention(qkv, attn_bias=attn_bias, rope=rope, gate_score=gate_score))
644
+ x_flat, shapes, num_tokens = cat_keep_shapes(att_out)
645
+ x_flat = self.proj(x_flat)
646
+ return uncat_with_shapes(x_flat, shapes, num_tokens)
647
+
648
+ def _compute_gate(self, x: Tensor) -> Tensor:
649
+ """Compute raw gate scores from input.
650
+
651
+ Returns the raw projection without reshaping so that the output keeps
652
+ the same number of leading dimensions as ``x``. This is critical for
653
+ ``forward_list`` where ``uncat_with_shapes`` must split a 2-D flat
654
+ tensor back to per-crop 3-D tensors — adding extra dims here would
655
+ break that reshape. The per-head unflatten happens later inside
656
+ ``compute_attention`` where B and N are known.
657
+
658
+ Args:
659
+ x: Input tensor of shape (..., D). Supports both 2D (flat) and 3D (batched).
660
+
661
+ Returns:
662
+ Raw gate projection. Headwise: (..., num_heads). Elementwise: (..., D).
663
+ """
664
+ return self.gate_proj(x)
665
+
666
+ def compute_attention(
667
+ self,
668
+ qkv: Tensor,
669
+ attn_bias: Tensor | None = None,
670
+ rope: tuple[Tensor, Tensor] | None = None,
671
+ gate_score: Tensor | None = None,
672
+ ) -> Tensor:
673
+ """Compute scaled dot-product attention.
674
+
675
+ Args:
676
+ qkv: Combined QKV tensor of shape (B, N, 3*D).
677
+ attn_bias: Unused.
678
+ rope: Optional RoPE (sin, cos) tuple.
679
+ gate_score: Optional gate tensor from _compute_gate.
680
+
681
+ Returns:
682
+ Attention output of shape (B, N, D).
683
+ """
684
+ assert attn_bias is None
685
+ B, N, _ = qkv.shape
686
+ C = self.qkv.in_features
687
+
688
+ qkv = qkv.reshape(B, N, 3, self.num_heads, self.head_dim)
689
+ q, k, v = torch.unbind(qkv, 2)
690
+ q, k, v = [t.transpose(1, 2) for t in [q, k, v]]
691
+ if self.qk_norm:
692
+ q = self.q_norm(q)
693
+ k = self.k_norm(k)
694
+ if rope is not None:
695
+ q, k = self.apply_rope(q, k, rope)
696
+ x = torch.nn.functional.scaled_dot_product_attention(q, k, v)
697
+ x = x.transpose(1, 2) # (B, N, num_heads, head_dim)
698
+ if gate_score is not None:
699
+ # _compute_gate returns raw projection: (..., num_heads) or (..., D).
700
+ # Reshape to (B, N, num_heads, 1) or (B, N, num_heads, head_dim) here.
701
+ if self.gated_attention == "headwise":
702
+ gate_score = gate_score.unflatten(-1, (self.num_heads, 1))
703
+ else: # elementwise
704
+ gate_score = gate_score.unflatten(-1, (self.num_heads, self.head_dim))
705
+ x = x * torch.sigmoid(gate_score)
706
+ return x.reshape([B, N, C])
707
+
708
+
709
+ # ---- ffn ----
710
+
711
+
712
+ class ListForwardMixin:
713
+ """Mixin providing forward_list for efficient multi-crop processing."""
714
+
715
+ def forward(self, x: Tensor) -> Tensor:
716
+ """Forward pass for a single tensor."""
717
+ raise NotImplementedError
718
+
719
+ def forward_list(self, x_list: list[Tensor]) -> list[Tensor]:
720
+ """Forward pass for a list of tensors, concatenated for efficiency."""
721
+ x_flat, shapes, num_tokens = cat_keep_shapes(x_list)
722
+ x_flat = self.forward(x_flat)
723
+ return uncat_with_shapes(x_flat, shapes, num_tokens)
724
+
725
+
726
+ class SwiGLUFFN(nn.Module, ListForwardMixin):
727
+ """SwiGLU Feed-Forward Network: w3(silu(w1(x)) * w2(x)).
728
+
729
+ Used for larger ViT models (SO400M+) due to better gradient flow.
730
+ Hidden dimension is aligned to a multiple of `align_to` for GPU efficiency.
731
+
732
+ Args:
733
+ in_features: Input dimension.
734
+ hidden_features: Hidden dimension before alignment.
735
+ out_features: Output dimension (default: same as in_features).
736
+ act_layer: Unused (SwiGLU has built-in SiLU activation).
737
+ drop: Unused (no dropout in SwiGLU).
738
+ bias: Whether to use bias in linear layers.
739
+ align_to: Align hidden dimension to this multiple.
740
+ device: Device for parameter allocation.
741
+ """
742
+
743
+ def __init__(
744
+ self,
745
+ in_features: int,
746
+ hidden_features: int | None = None,
747
+ out_features: int | None = None,
748
+ act_layer: Callable[..., nn.Module] | None = None,
749
+ drop: float = 0.0,
750
+ bias: bool = True,
751
+ align_to: int = 8,
752
+ device: str | None = None,
753
+ ) -> None:
754
+ super().__init__()
755
+ out_features = out_features or in_features
756
+ hidden_features = hidden_features or in_features
757
+ d = int(hidden_features * 2 / 3)
758
+ swiglu_hidden_features = d + (-d % align_to)
759
+ self.w1 = nn.Linear(in_features, swiglu_hidden_features, bias=bias, device=device)
760
+ self.w2 = nn.Linear(in_features, swiglu_hidden_features, bias=bias, device=device)
761
+ self.w3 = nn.Linear(swiglu_hidden_features, out_features, bias=bias, device=device)
762
+
763
+ def forward(self, x: Tensor) -> Tensor:
764
+ """Forward pass: w3(silu(w1(x)) * w2(x))."""
765
+ x1 = self.w1(x)
766
+ x2 = self.w2(x)
767
+ hidden = F.silu(x1) * x2
768
+ return self.w3(hidden)
769
+
770
+
771
+ # ---- block ----
772
+
773
+
774
+ class SelfAttentionBlock(nn.Module):
775
+ """Pre-norm transformer block: Norm -> Attention -> LayerScale -> Residual (x2).
776
+
777
+ Supports both single-tensor and list-of-tensors forward for efficient multi-crop
778
+ processing.
779
+
780
+ Args:
781
+ dim: Model dimension.
782
+ num_heads: Number of attention heads.
783
+ ffn_ratio: FFN hidden dimension ratio.
784
+ qkv_bias: Whether to use bias in QKV projection.
785
+ proj_bias: Whether to use bias in output projection.
786
+ ffn_bias: Whether to use bias in FFN layers.
787
+ drop: Dropout probability.
788
+ attn_drop: Attention dropout probability.
789
+ init_values: LayerScale initial values (None disables LayerScale).
790
+ drop_path: Stochastic depth drop probability.
791
+ act_layer: Activation function class.
792
+ norm_layer: Normalization layer class.
793
+ attn_class: Attention class.
794
+ ffn_layer: FFN class.
795
+ mask_k_bias: Whether to mask K bias.
796
+ device: Device for parameter allocation.
797
+ """
798
+
799
+ def __init__(
800
+ self,
801
+ dim: int,
802
+ num_heads: int,
803
+ ffn_ratio: float = 4.0,
804
+ qkv_bias: bool = False,
805
+ proj_bias: bool = True,
806
+ ffn_bias: bool = True,
807
+ drop: float = 0.0,
808
+ attn_drop: float = 0.0,
809
+ init_values: float | None = None,
810
+ drop_path: float = 0.0,
811
+ act_layer: Callable[..., nn.Module] = nn.GELU,
812
+ norm_layer: Callable[..., nn.Module] = nn.LayerNorm,
813
+ attn_class: Callable[..., nn.Module] = SelfAttention,
814
+ ffn_layer: Callable[..., nn.Module] = SwiGLUFFN,
815
+ mask_k_bias: bool = False,
816
+ device: str | None = None,
817
+ gated_attention: str | None = None,
818
+ qk_norm: bool = False,
819
+ ) -> None:
820
+ super().__init__()
821
+ self.norm1 = norm_layer(dim)
822
+ self.attn = attn_class(
823
+ dim,
824
+ num_heads=num_heads,
825
+ qkv_bias=qkv_bias,
826
+ proj_bias=proj_bias,
827
+ attn_drop=attn_drop,
828
+ proj_drop=drop,
829
+ mask_k_bias=mask_k_bias,
830
+ device=device,
831
+ gated_attention=gated_attention,
832
+ qk_norm=qk_norm,
833
+ )
834
+ self.ls1 = LayerScale(dim, init_values=init_values, device=device) if init_values else nn.Identity()
835
+
836
+ self.norm2 = norm_layer(dim)
837
+ mlp_hidden_dim = int(dim * ffn_ratio)
838
+ self.mlp = ffn_layer(
839
+ in_features=dim,
840
+ hidden_features=mlp_hidden_dim,
841
+ act_layer=act_layer,
842
+ drop=drop,
843
+ bias=ffn_bias,
844
+ device=device,
845
+ )
846
+ self.ls2 = LayerScale(dim, init_values=init_values, device=device) if init_values else nn.Identity()
847
+
848
+ def _forward_list(self, x_list: list[Tensor], rope_list: list | None = None) -> list[Tensor]:
849
+ """Forward pass for a list of tensors (one per crop), each with its own RoPE.
850
+
851
+ Pre-norm residual: Norm -> Attention -> LayerScale -> Residual, twice (attn, ffn).
852
+ """
853
+ x_out = []
854
+ for x, rope in zip(x_list, rope_list):
855
+ x_attn = x + self.ls1(self.attn(self.norm1(x), rope=rope))
856
+ x_ffn_item = x_attn + self.ls2(self.mlp(self.norm2(x_attn)))
857
+ x_out.append(x_ffn_item)
858
+ return x_out
859
+
860
+ def forward(
861
+ self,
862
+ x_or_x_list: Tensor | list[Tensor],
863
+ rope_or_rope_list: tuple | list | None = None,
864
+ ) -> Tensor | list[Tensor]:
865
+ """Forward pass accepting either a single tensor or list of tensors.
866
+
867
+ Args:
868
+ x_or_x_list: Single tensor (B, N, D) or list of tensors.
869
+ rope_or_rope_list: Single RoPE tuple or list of RoPE tuples.
870
+
871
+ Returns:
872
+ Output tensor(s) matching input format.
873
+ """
874
+ if isinstance(x_or_x_list, Tensor):
875
+ return self._forward_list([x_or_x_list], rope_list=[rope_or_rope_list])[0]
876
+ elif isinstance(x_or_x_list, list):
877
+ if rope_or_rope_list is None:
878
+ rope_or_rope_list = [None for _ in x_or_x_list]
879
+ return self._forward_list(x_or_x_list, rope_list=rope_or_rope_list)
880
+ else:
881
+ raise AssertionError(f"Unexpected input type: {type(x_or_x_list)}")
882
+
883
+
884
+ # ---- vision_transformer ----
885
+
886
+
887
+ logger = logging.getLogger("motif")
888
+
889
+ ffn_layer_dict: dict[str, type] = {
890
+ "swiglu": SwiGLUFFN,
891
+ "swiglu32": partial(SwiGLUFFN, align_to=32),
892
+ "swiglu64": partial(SwiGLUFFN, align_to=64),
893
+ "swiglu128": partial(SwiGLUFFN, align_to=128),
894
+ }
895
+
896
+ norm_layer_dict: dict[str, type] = {
897
+ "layernorm": partial(nn.LayerNorm, eps=1e-6),
898
+ "layernormbf16": partial(nn.LayerNorm, eps=1e-5),
899
+ "rmsnorm": RMSNorm,
900
+ }
901
+
902
+ dtype_dict: dict[str, torch.dtype] = {
903
+ "fp32": torch.float32,
904
+ "fp16": torch.float16,
905
+ "bf16": torch.bfloat16,
906
+ }
907
+
908
+
909
+ class MotifVisionTransformer(nn.Module):
910
+ """Vision Transformer backbone with 3D RoPE for unified image/video processing.
911
+
912
+ Key features:
913
+ - PatchEmbed (Conv3d) for unified image/video tokenization
914
+ - Full 3D axial RoPE positional encoding (T/H/W)
915
+ - CLS token + register (storage) tokens
916
+ - LayerScale
917
+ - MLP or SwiGLU FFN variants
918
+
919
+ Token sequence layout: [CLS] + [Register x n_storage_tokens] + [Patch x N_total]
920
+
921
+ Args:
922
+ img_size: Input image size.
923
+ patch_size: Spatial patch size.
924
+ in_chans: Number of input channels.
925
+ embed_dim: Embedding dimension.
926
+ depth: Number of transformer blocks.
927
+ num_heads: Number of attention heads.
928
+ ffn_ratio: FFN hidden dimension ratio.
929
+ qkv_bias: Whether to use bias in QKV.
930
+ drop_path_rate: Stochastic depth rate.
931
+ layerscale_init: LayerScale initial value (None to disable).
932
+ norm_layer: Normalization layer name.
933
+ ffn_layer: FFN layer name.
934
+ ffn_bias: Whether to use bias in FFN.
935
+ proj_bias: Whether to use bias in attention output projection.
936
+ n_storage_tokens: Number of register tokens.
937
+ mask_k_bias: Whether to mask K bias in attention.
938
+ untie_cls_and_patch_norms: Use separate norms for CLS and patch tokens.
939
+ untie_global_and_local_cls_norm: Use separate norm for local CLS tokens.
940
+ device: Device for parameter allocation.
941
+ num_frames: Number of input video frames.
942
+ tubelet_size: Temporal patch size for Conv3d.
943
+ pos_embed_rope_base: RoPE frequency base (100.0 for vision).
944
+ gated_attention: Gated attention variant (None, "headwise", "elementwise").
945
+ See https://arxiv.org/abs/2505.06708.
946
+ """
947
+
948
+ def __init__(
949
+ self,
950
+ *,
951
+ img_size: int = 224,
952
+ patch_size: int = 16,
953
+ in_chans: int = 3,
954
+ embed_dim: int = 768,
955
+ depth: int = 12,
956
+ num_heads: int = 12,
957
+ ffn_ratio: float = 4.0,
958
+ qkv_bias: bool = True,
959
+ drop_path_rate: float = 0.0,
960
+ layerscale_init: float | None = None,
961
+ norm_layer: str = "layernorm",
962
+ ffn_layer: str = "mlp",
963
+ ffn_bias: bool = True,
964
+ proj_bias: bool = True,
965
+ n_storage_tokens: int = 0,
966
+ mask_k_bias: bool = False,
967
+ untie_cls_and_patch_norms: bool = False,
968
+ untie_global_and_local_cls_norm: bool = False,
969
+ device: Any | None = None,
970
+ num_frames: int = 1,
971
+ tubelet_size: int = 1,
972
+ pos_embed_rope_base: float = 100.0,
973
+ pos_embed_rope_rescale_coords: float | None = None,
974
+ pos_embed_rope_shift_coords: float | None = None,
975
+ pos_embed_rope_jitter_coords: float | None = None,
976
+ pos_embed_rope_fhw_dim: tuple[int, int, int] | None = None,
977
+ gated_attention: str | None = None,
978
+ qk_norm: bool = False,
979
+ **ignored_kwargs,
980
+ ) -> None:
981
+ super().__init__()
982
+ if len(ignored_kwargs) > 0:
983
+ logger.warning(f"Ignored kwargs: {ignored_kwargs}")
984
+
985
+ norm_layer_cls = norm_layer_dict[norm_layer]
986
+
987
+ self.num_features = self.embed_dim = embed_dim
988
+ self.n_blocks = depth
989
+ self.num_heads = num_heads
990
+ self.patch_size = patch_size
991
+
992
+ self.patch_embed = PatchEmbed(
993
+ img_size=img_size,
994
+ patch_size=patch_size,
995
+ in_chans=in_chans,
996
+ embed_dim=embed_dim,
997
+ tubelet_size=tubelet_size,
998
+ flatten_embedding=True,
999
+ )
1000
+
1001
+ self.cls_token = nn.Parameter(torch.empty(1, 1, embed_dim, device=device))
1002
+ self.n_storage_tokens = n_storage_tokens
1003
+ if self.n_storage_tokens > 0:
1004
+ self.storage_tokens = nn.Parameter(torch.empty(1, n_storage_tokens, embed_dim, device=device))
1005
+
1006
+ # Convert 0.0 to None for backward compat (0.0 means disabled)
1007
+ _rescale = pos_embed_rope_rescale_coords if pos_embed_rope_rescale_coords else None
1008
+ _shift = pos_embed_rope_shift_coords if pos_embed_rope_shift_coords else None
1009
+ _jitter = pos_embed_rope_jitter_coords if pos_embed_rope_jitter_coords else None
1010
+ self.rope_embed = RopePositionEmbedding3D(
1011
+ embed_dim=embed_dim,
1012
+ num_heads=num_heads,
1013
+ fhw_dim=pos_embed_rope_fhw_dim,
1014
+ base=pos_embed_rope_base,
1015
+ rescale_coords=_rescale,
1016
+ shift_coords=_shift,
1017
+ jitter_coords=_jitter,
1018
+ )
1019
+
1020
+ logger.info(f"using {ffn_layer} layer as FFN")
1021
+ ffn_layer_cls = ffn_layer_dict[ffn_layer]
1022
+ ffn_ratio_sequence = [ffn_ratio] * depth
1023
+
1024
+ blocks_list = [
1025
+ SelfAttentionBlock(
1026
+ dim=embed_dim,
1027
+ num_heads=num_heads,
1028
+ ffn_ratio=ffn_ratio_sequence[i],
1029
+ qkv_bias=qkv_bias,
1030
+ proj_bias=proj_bias,
1031
+ ffn_bias=ffn_bias,
1032
+ drop_path=drop_path_rate,
1033
+ norm_layer=norm_layer_cls,
1034
+ act_layer=nn.GELU,
1035
+ ffn_layer=ffn_layer_cls,
1036
+ init_values=layerscale_init,
1037
+ mask_k_bias=mask_k_bias,
1038
+ device=device,
1039
+ gated_attention=gated_attention,
1040
+ qk_norm=qk_norm,
1041
+ )
1042
+ for i in range(depth)
1043
+ ]
1044
+
1045
+ self.chunked_blocks = False
1046
+ self.blocks = nn.ModuleList(blocks_list)
1047
+
1048
+ self.norm = norm_layer_cls(embed_dim)
1049
+
1050
+ self.untie_cls_and_patch_norms = untie_cls_and_patch_norms
1051
+ if untie_cls_and_patch_norms:
1052
+ self.cls_norm = norm_layer_cls(embed_dim)
1053
+ else:
1054
+ self.cls_norm = None
1055
+
1056
+ self.untie_global_and_local_cls_norm = untie_global_and_local_cls_norm
1057
+ if untie_global_and_local_cls_norm:
1058
+ self.local_cls_norm = norm_layer_cls(embed_dim)
1059
+ else:
1060
+ self.local_cls_norm = None
1061
+ self.head = nn.Identity()
1062
+ self.mask_token = nn.Parameter(torch.empty(1, embed_dim, device=device))
1063
+
1064
+ def prepare_tokens_with_masks(
1065
+ self,
1066
+ x: Tensor,
1067
+ masks: Tensor | None = None,
1068
+ ) -> tuple[Tensor, tuple[int, int, int]]:
1069
+ """Tokenize input and assemble token sequence with CLS + register + patches.
1070
+
1071
+ Args:
1072
+ x: Input tensor. Image: (B, C, H, W) or Video: (B, T, C, H, W).
1073
+ masks: Boolean mask of shape (B, N_spatial) indicating which patches to mask.
1074
+
1075
+ Returns:
1076
+ Tuple of:
1077
+ - Token sequence: (B, 1 + n_storage + N_total, embed_dim)
1078
+ - Grid dimensions: (T_grid, H_grid, W_grid)
1079
+ """
1080
+ if x.ndim == 5:
1081
+ B, T, C, H, W = x.shape
1082
+ # Video: Conv3d kernel=stride=tubelet downsamples raw T to T // tubelet.
1083
+ T_grid = T // self.patch_embed.tubelet_size
1084
+ else:
1085
+ B, C, H, W = x.shape
1086
+ # Image (4D): PatchEmbed expands raw T=1 to tubelet then Conv3d(stride=tubelet)
1087
+ # produces a single temporal token (output T_out = (tubelet - tubelet)/tubelet + 1 = 1).
1088
+ # vjepa2 vision_transformer.py:171-173 passes T=1 (no division) for the same reason.
1089
+ T_grid = 1
1090
+
1091
+ x = self.patch_embed(x) # (B, N_total, D)
1092
+
1093
+ # Grid dimensions for RoPE computation
1094
+ H_grid = H // self.patch_embed.patch_size[0]
1095
+ W_grid = W // self.patch_embed.patch_size[1]
1096
+
1097
+ if masks is not None:
1098
+ # Expand spatial mask to spatio-temporal if needed (tube masking)
1099
+ if masks.shape[1] != x.shape[1]:
1100
+ ratio = x.shape[1] // masks.shape[1]
1101
+ masks = masks.unsqueeze(1).repeat(1, ratio, 1).flatten(1)
1102
+
1103
+ # Replace masked positions with mask_token
1104
+ x = torch.where(masks.unsqueeze(-1), self.mask_token.to(x.dtype).unsqueeze(0), x)
1105
+ cls_token = self.cls_token
1106
+ else:
1107
+ # Include mask_token in computation graph even when not masking
1108
+ cls_token = self.cls_token + 0 * self.mask_token
1109
+
1110
+ if self.n_storage_tokens > 0:
1111
+ storage_tokens = self.storage_tokens
1112
+ else:
1113
+ storage_tokens = torch.empty(
1114
+ 1, 0, cls_token.shape[-1],
1115
+ dtype=cls_token.dtype, device=cls_token.device,
1116
+ )
1117
+
1118
+ x = torch.cat(
1119
+ [
1120
+ cls_token.expand(B, -1, -1),
1121
+ storage_tokens.expand(B, -1, -1),
1122
+ x,
1123
+ ],
1124
+ dim=1,
1125
+ )
1126
+
1127
+ return x, (T_grid, H_grid, W_grid)
1128
+
1129
+ def forward_features_list(
1130
+ self,
1131
+ x_list: list[Tensor],
1132
+ masks_list: list[Tensor | None],
1133
+ ) -> list[dict[str, Tensor]]:
1134
+ """Forward pass for a list of inputs (multi-crop).
1135
+
1136
+ Args:
1137
+ x_list: List of input tensors (global crops, local crops).
1138
+ masks_list: List of corresponding masks (None for unmasked).
1139
+
1140
+ Returns:
1141
+ List of output dictionaries, one per input, containing:
1142
+ - x_norm_clstoken: Normalized CLS token (B, D)
1143
+ - x_storage_tokens: Normalized register tokens (B, n_storage, D)
1144
+ - x_norm_patchtokens: Normalized patch tokens (B, N, D)
1145
+ - x_prenorm: Pre-normalization features (B, 1+n_storage+N, D)
1146
+ - masks: Original masks
1147
+ """
1148
+ x = []
1149
+ rope_params = []
1150
+ for t_x, t_masks in zip(x_list, masks_list):
1151
+ t2_x, grid_tuple = self.prepare_tokens_with_masks(t_x, t_masks)
1152
+ x.append(t2_x)
1153
+ rope_params.append(grid_tuple)
1154
+
1155
+ # Pre-compute RoPE sin/cos once — identical across all blocks.
1156
+ # Hoisting this out of the loop avoids breaking FSDP2's forward prefetch
1157
+ # chain (rope_embed is part of the outer FSDP unit, calling it between
1158
+ # block forwards disrupts the prefetch scheduling).
1159
+ if self.rope_embed is not None:
1160
+ rope_sincos = [self.rope_embed(T=t, H=h, W=w) for t, h, w in rope_params]
1161
+ else:
1162
+ rope_sincos = [None for _ in rope_params]
1163
+
1164
+ for _, blk in enumerate(self.blocks):
1165
+ x = blk(x, rope_sincos)
1166
+
1167
+ all_x = x
1168
+ output = []
1169
+ for idx, (x, masks) in enumerate(zip(all_x, masks_list)):
1170
+ if self.untie_cls_and_patch_norms or self.untie_global_and_local_cls_norm:
1171
+ if self.untie_global_and_local_cls_norm and self.training and idx == 1:
1172
+ x_norm_cls_reg = self.local_cls_norm(x[:, : self.n_storage_tokens + 1])
1173
+ elif self.untie_cls_and_patch_norms:
1174
+ x_norm_cls_reg = self.cls_norm(x[:, : self.n_storage_tokens + 1])
1175
+ else:
1176
+ x_norm_cls_reg = self.norm(x[:, : self.n_storage_tokens + 1])
1177
+ x_norm_patch = self.norm(x[:, self.n_storage_tokens + 1 :])
1178
+ else:
1179
+ x_norm = self.norm(x)
1180
+ x_norm_cls_reg = x_norm[:, : self.n_storage_tokens + 1]
1181
+ x_norm_patch = x_norm[:, self.n_storage_tokens + 1 :]
1182
+ output.append(
1183
+ {
1184
+ "x_norm_clstoken": x_norm_cls_reg[:, 0],
1185
+ "x_storage_tokens": x_norm_cls_reg[:, 1:],
1186
+ "x_norm_patchtokens": x_norm_patch,
1187
+ "x_prenorm": x,
1188
+ "masks": masks,
1189
+ }
1190
+ )
1191
+ return output
1192
+
1193
+ def forward_features(
1194
+ self,
1195
+ x: Tensor | list[Tensor],
1196
+ masks: Tensor | list[Tensor | None] | None = None,
1197
+ ) -> dict[str, Tensor] | list[dict[str, Tensor]]:
1198
+ """Forward pass for single or multiple inputs.
1199
+
1200
+ Args:
1201
+ x: Single tensor or list of tensors.
1202
+ masks: Single mask or list of masks.
1203
+
1204
+ Returns:
1205
+ Output dict (single input) or list of output dicts (multiple inputs).
1206
+ """
1207
+ if isinstance(x, torch.Tensor):
1208
+ return self.forward_features_list([x], [masks])[0]
1209
+ else:
1210
+ return self.forward_features_list(x, masks)
1211
+
1212
+ def _get_intermediate_layers_not_chunked(
1213
+ self,
1214
+ x: Tensor,
1215
+ n: int | list[int] = 1,
1216
+ ) -> list[Tensor]:
1217
+ """Run forward pass and collect intermediate block outputs.
1218
+
1219
+ Args:
1220
+ x: Input tensor (B, C, H, W) or (B, T, C, H, W).
1221
+ n: If int, return last n layers. If list, return specific layer indices.
1222
+
1223
+ Returns:
1224
+ List of intermediate outputs, each (B, 1+n_storage+N, D).
1225
+ """
1226
+ x, grid_tuple = self.prepare_tokens_with_masks(x, masks=None)
1227
+ T, H, W = grid_tuple
1228
+
1229
+ output, total_block_len = [], len(self.blocks)
1230
+ blocks_to_take = range(total_block_len - n, total_block_len) if isinstance(n, int) else n
1231
+
1232
+ if self.rope_embed is not None:
1233
+ rope_sincos = self.rope_embed(T=T, H=H, W=W)
1234
+ else:
1235
+ rope_sincos = None
1236
+
1237
+ for i, blk in enumerate(self.blocks):
1238
+ x = blk([x], [rope_sincos])[0]
1239
+ if i in blocks_to_take:
1240
+ output.append(x)
1241
+
1242
+ assert len(output) == len(blocks_to_take), (
1243
+ f"only {len(output)} / {len(blocks_to_take)} blocks found"
1244
+ )
1245
+ return output
1246
+
1247
+ def get_intermediate_layers(
1248
+ self,
1249
+ x: Tensor,
1250
+ n: int | list[int] = 1,
1251
+ reshape: bool = False,
1252
+ return_class_token: bool = False,
1253
+ norm: bool = True,
1254
+ ) -> tuple[Tensor, ...]:
1255
+ """Extract intermediate layer outputs for downstream evaluation.
1256
+
1257
+ This method is critical for dense prediction tasks (segmentation, depth)
1258
+ that need multi-scale features from different transformer blocks.
1259
+
1260
+ Args:
1261
+ x: Input image (B, C, H, W) or video (B, T, C, H, W).
1262
+ n: If int, return outputs from last n layers.
1263
+ If list[int], return outputs from specific layer indices.
1264
+ reshape: If True, reshape patch tokens to spatial form (B, D, H_grid, W_grid).
1265
+ return_class_token: If True, return (patch_tokens, cls_token) tuples.
1266
+ norm: If True, apply final LayerNorm to outputs.
1267
+
1268
+ Returns:
1269
+ If return_class_token is False:
1270
+ Tuple of patch token tensors, one per requested layer.
1271
+ Each tensor is (B, N, D) or (B, D, H_grid, W_grid) if reshape=True.
1272
+ If return_class_token is True:
1273
+ Tuple of (patch_tokens, cls_token) pairs.
1274
+ """
1275
+ # Determine spatial dims for reshape
1276
+ if x.ndim == 5:
1277
+ B, T_in, C, H, W = x.shape
1278
+ else:
1279
+ B, C, H, W = x.shape
1280
+ T_in = 1
1281
+
1282
+ outputs = self._get_intermediate_layers_not_chunked(x, n)
1283
+
1284
+ if norm:
1285
+ outputs_normed = []
1286
+ for out in outputs:
1287
+ if self.untie_cls_and_patch_norms:
1288
+ x_norm_cls_reg = self.cls_norm(out[:, : self.n_storage_tokens + 1])
1289
+ x_norm_patch = self.norm(out[:, self.n_storage_tokens + 1 :])
1290
+ outputs_normed.append(torch.cat((x_norm_cls_reg, x_norm_patch), dim=1))
1291
+ else:
1292
+ outputs_normed.append(self.norm(out))
1293
+ outputs = outputs_normed
1294
+
1295
+ class_tokens = [out[:, 0] for out in outputs]
1296
+ outputs = [out[:, self.n_storage_tokens + 1 :] for out in outputs]
1297
+
1298
+ if reshape:
1299
+ # Image (T_in=1): PatchEmbed expands to tubelet then Conv3d(stride=tubelet) → T_out=1.
1300
+ # Video: Conv3d downsamples T_in → T_in // tubelet. Matches prepare_tokens_with_masks
1301
+ # and vjepa2 vision_transformer.py:171-177.
1302
+ if x.ndim == 5:
1303
+ T_grid = T_in // self.patch_embed.tubelet_size
1304
+ else:
1305
+ T_grid = 1
1306
+ H_grid = H // self.patch_size
1307
+ W_grid = W // self.patch_size
1308
+ if T_grid > 1:
1309
+ # Video: reshape to (B, D, T_grid, H_grid, W_grid)
1310
+ outputs = [
1311
+ out.reshape(B, T_grid, H_grid, W_grid, -1).permute(0, 4, 1, 2, 3).contiguous()
1312
+ for out in outputs
1313
+ ]
1314
+ else:
1315
+ # Image: reshape to (B, D, H_grid, W_grid)
1316
+ outputs = [
1317
+ out.reshape(B, H_grid, W_grid, -1).permute(0, 3, 1, 2).contiguous()
1318
+ for out in outputs
1319
+ ]
1320
+
1321
+ if return_class_token:
1322
+ return tuple(zip(outputs, class_tokens))
1323
+ return tuple(outputs)
1324
+
1325
+ def forward(
1326
+ self,
1327
+ *args,
1328
+ is_training: bool = False,
1329
+ **kwargs,
1330
+ ) -> dict[str, Tensor] | list[dict[str, Tensor]] | Tensor:
1331
+ """High-level forward: training returns feature dict, inference returns CLS logits.
1332
+
1333
+ Args:
1334
+ is_training: If True, return full feature dictionary.
1335
+
1336
+ Returns:
1337
+ Feature dict(s) if training, CLS token logits if inference.
1338
+ """
1339
+ ret = self.forward_features(*args, **kwargs)
1340
+ if is_training:
1341
+ return ret
1342
+ else:
1343
+ return self.head(ret["x_norm_clstoken"])
1344
+
1345
+
1346
+ # ============================================================================
1347
+ # HuggingFace transformers wrapper (inference-only)
1348
+ # ============================================================================
1349
+ class MotifVisionConfig(PretrainedConfig):
1350
+ """Config for the Motif Vision Encoder backbone (image + video)."""
1351
+
1352
+ model_type = "motif_vision"
1353
+
1354
+ def __init__(
1355
+ self,
1356
+ img_size: int = 224,
1357
+ patch_size: int = 16,
1358
+ in_chans: int = 3,
1359
+ embed_dim: int = 4096,
1360
+ depth: int = 40,
1361
+ num_heads: int = 32,
1362
+ ffn_ratio: float = 3.0,
1363
+ qkv_bias: bool = False,
1364
+ drop_path_rate: float = 0.0,
1365
+ layerscale_init: float | None = 1.0e-5,
1366
+ norm_layer: str = "layernormbf16",
1367
+ ffn_layer: str = "swiglu64",
1368
+ ffn_bias: bool = True,
1369
+ proj_bias: bool = True,
1370
+ n_storage_tokens: int = 4,
1371
+ mask_k_bias: bool = True,
1372
+ untie_cls_and_patch_norms: bool = False,
1373
+ untie_global_and_local_cls_norm: bool = True,
1374
+ num_frames: int = 1,
1375
+ tubelet_size: int = 2,
1376
+ pos_embed_rope_base: float = 100.0,
1377
+ pos_embed_rope_rescale_coords: float | None = 2.0,
1378
+ gated_attention: str | None = "elementwise",
1379
+ qk_norm: bool = True,
1380
+ **kwargs,
1381
+ ):
1382
+ self.img_size = img_size
1383
+ self.patch_size = patch_size
1384
+ self.in_chans = in_chans
1385
+ self.embed_dim = embed_dim
1386
+ self.depth = depth
1387
+ self.num_heads = num_heads
1388
+ self.ffn_ratio = ffn_ratio
1389
+ self.qkv_bias = qkv_bias
1390
+ self.drop_path_rate = drop_path_rate
1391
+ self.layerscale_init = layerscale_init
1392
+ self.norm_layer = norm_layer
1393
+ self.ffn_layer = ffn_layer
1394
+ self.ffn_bias = ffn_bias
1395
+ self.proj_bias = proj_bias
1396
+ self.n_storage_tokens = n_storage_tokens
1397
+ self.mask_k_bias = mask_k_bias
1398
+ self.untie_cls_and_patch_norms = untie_cls_and_patch_norms
1399
+ self.untie_global_and_local_cls_norm = untie_global_and_local_cls_norm
1400
+ self.num_frames = num_frames
1401
+ self.tubelet_size = tubelet_size
1402
+ self.pos_embed_rope_base = pos_embed_rope_base
1403
+ self.pos_embed_rope_rescale_coords = pos_embed_rope_rescale_coords
1404
+ self.gated_attention = gated_attention
1405
+ self.qk_norm = qk_norm
1406
+ super().__init__(**kwargs)
1407
+
1408
+
1409
+ class MotifVisionModel(PreTrainedModel):
1410
+ """Motif Vision Encoder for HF `AutoModel` (inference). Returns dense + CLS features."""
1411
+
1412
+ config_class = MotifVisionConfig
1413
+ base_model_prefix = "motif"
1414
+ main_input_name = "pixel_values"
1415
+ _no_split_modules = ["SelfAttentionBlock"]
1416
+ supports_gradient_checkpointing = False
1417
+
1418
+ def __init__(self, config: MotifVisionConfig):
1419
+ super().__init__(config)
1420
+ self.backbone = MotifVisionTransformer(
1421
+ img_size=config.img_size,
1422
+ patch_size=config.patch_size,
1423
+ in_chans=config.in_chans,
1424
+ embed_dim=config.embed_dim,
1425
+ depth=config.depth,
1426
+ num_heads=config.num_heads,
1427
+ ffn_ratio=config.ffn_ratio,
1428
+ qkv_bias=config.qkv_bias,
1429
+ drop_path_rate=config.drop_path_rate,
1430
+ layerscale_init=config.layerscale_init,
1431
+ norm_layer=config.norm_layer,
1432
+ ffn_layer=config.ffn_layer,
1433
+ ffn_bias=config.ffn_bias,
1434
+ proj_bias=config.proj_bias,
1435
+ n_storage_tokens=config.n_storage_tokens,
1436
+ mask_k_bias=config.mask_k_bias,
1437
+ untie_cls_and_patch_norms=config.untie_cls_and_patch_norms,
1438
+ untie_global_and_local_cls_norm=config.untie_global_and_local_cls_norm,
1439
+ num_frames=config.num_frames,
1440
+ tubelet_size=config.tubelet_size,
1441
+ pos_embed_rope_base=config.pos_embed_rope_base,
1442
+ pos_embed_rope_rescale_coords=config.pos_embed_rope_rescale_coords,
1443
+ gated_attention=config.gated_attention,
1444
+ qk_norm=config.qk_norm,
1445
+ )
1446
+ self.post_init()
1447
+
1448
+ @torch.no_grad()
1449
+ def forward(self, pixel_values: Tensor, return_dict: bool = True, **kwargs):
1450
+ """pixel_values: image (B,3,H,W) or video (B,T,3,H,W). H,W multiples of patch_size."""
1451
+ out = self.backbone.forward_features(pixel_values)
1452
+ cls = out["x_norm_clstoken"]
1453
+ reg = out["x_storage_tokens"]
1454
+ patch = out["x_norm_patchtokens"]
1455
+ last_hidden = torch.cat([cls.unsqueeze(1), reg, patch], dim=1)
1456
+ if not return_dict:
1457
+ return (last_hidden, cls)
1458
+ return BaseModelOutputWithPooling(last_hidden_state=last_hidden, pooler_output=cls)
1459
+
1460
+
1461
+ AutoConfig_registered = False
1462
+ try:
1463
+ from transformers import AutoConfig, AutoModel
1464
+ AutoConfig.register("motif_vision", MotifVisionConfig)
1465
+ AutoModel.register(MotifVisionConfig, MotifVisionModel)
1466
+ AutoConfig_registered = True
1467
+ except Exception:
1468
+ pass
preprocessor_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor_type": "BitImageProcessor",
3
+ "do_resize": true,
4
+ "size": {
5
+ "shortest_edge": 512
6
+ },
7
+ "do_center_crop": true,
8
+ "crop_size": {
9
+ "height": 512,
10
+ "width": 512
11
+ },
12
+ "do_rescale": true,
13
+ "rescale_factor": 0.00392156862745098,
14
+ "do_normalize": true,
15
+ "image_mean": [
16
+ 0.485,
17
+ 0.456,
18
+ 0.406
19
+ ],
20
+ "image_std": [
21
+ 0.229,
22
+ 0.224,
23
+ 0.225
24
+ ],
25
+ "resample": 3,
26
+ "do_convert_rgb": true
27
+ }