loopback-kr commited on
Commit
de2749f
1 Parent(s): 55f1387

Added Solution 2

Browse files
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<im_patch>": 128256
3
+ }
config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/workspace/0.Challenge/MICCAI2024_AMOSMM/M3D/pretrained_weight/Meta-Llama-3.1-8B-Instruct",
3
+ "architectures": [
4
+ "LamedLlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "auto_map": {
9
+ "AutoConfig": "configuration_m3d_lamed.LamedConfig",
10
+ "AutoModelForCausalLM": "modeling_m3d_lamed.LamedLlamaForCausalLM"
11
+ },
12
+ "bos_token_id": 128000,
13
+ "eos_token_id": [
14
+ 128001,
15
+ 128008,
16
+ 128009
17
+ ],
18
+ "hidden_act": "silu",
19
+ "hidden_size": 4096,
20
+ "image_channel": 1,
21
+ "image_size": [
22
+ 32,
23
+ 256,
24
+ 256
25
+ ],
26
+ "initializer_range": 0.02,
27
+ "intermediate_size": 14336,
28
+ "max_position_embeddings": 131072,
29
+ "mlp_bias": false,
30
+ "mm_hidden_size": 768,
31
+ "mm_projector_type": "spp",
32
+ "model_type": "lamed_llama",
33
+ "num_attention_heads": 32,
34
+ "num_hidden_layers": 32,
35
+ "num_key_value_heads": 8,
36
+ "patch_size": [
37
+ 4,
38
+ 16,
39
+ 16
40
+ ],
41
+ "pretraining_tp": 1,
42
+ "proj_layer_num": 2,
43
+ "proj_layer_type": "mlp",
44
+ "proj_pooling_size": 2,
45
+ "proj_pooling_type": "spatial",
46
+ "rms_norm_eps": 1e-05,
47
+ "rope_scaling": {
48
+ "factor": 8.0,
49
+ "high_freq_factor": 4.0,
50
+ "low_freq_factor": 1.0,
51
+ "original_max_position_embeddings": 8192,
52
+ "rope_type": "llama3"
53
+ },
54
+ "rope_theta": 500000.0,
55
+ "tie_word_embeddings": false,
56
+ "torch_dtype": "float32",
57
+ "transformers_version": "4.43.4",
58
+ "use_cache": true,
59
+ "vision_select_feature": "patch",
60
+ "vision_select_layer": -1,
61
+ "vision_tower": "vit3d",
62
+ "vocab_size": 128257
63
+ }
configuration_m3d_lamed.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from transformers import LlamaConfig
2
+
3
+
4
+ class LamedConfig(LlamaConfig):
5
+ model_type = "lamed_llama"
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 128000,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 128001,
6
+ 128008,
7
+ 128009
8
+ ],
9
+ "temperature": 0.6,
10
+ "top_p": 0.9,
11
+ "transformers_version": "4.43.4"
12
+ }
merged_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c35811e99d05e5968c8d4d3287c5a01778282df5c6cfc9151f37385508b257f0
3
+ size 32550545077
model-00001-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:234103ef69286eb1baf30520825f20db593f5d137ddba261f8d96605b920510b
3
+ size 4886482552
model-00002-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73502d81fa073678f57715175b1585cd4c94d720f6db488f983f8ea437801292
3
+ size 4832007448
model-00003-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f9704c3df75c185dc2829acfc32fbb98ca83d41d186d4be4c700ab4d755aea8
3
+ size 4999813112
model-00004-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2da458d47ecfbffc700d3c107cd8fb60de98df5ab9be245cf080794b744ea281
3
+ size 4999813128
model-00005-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7f28120aa52c7e913fe7f2e2593a909cc4e4cab6f9e861c6997a13dbf9b5254
3
+ size 4832007496
model-00006-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb62cb4ca2a4855f387b8b667e6c37a3c54675535769841dd6d6a2b083f25e6a
3
+ size 4999813120
model-00007-of-00007.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11a83cd08ed3b932007141248395ae54bc84ddd9f58951546e49d51afc607b1a
3
+ size 3000474232
model.safetensors.index.json ADDED
@@ -0,0 +1,440 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 32550359040
4
+ },
5
+ "weight_map": {
6
+ "lm_head.weight": "model-00007-of-00007.safetensors",
7
+ "model.embed_tokens.weight": "model-00001-of-00007.safetensors",
8
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00007.safetensors",
9
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00007.safetensors",
10
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00007.safetensors",
11
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00007.safetensors",
12
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00007.safetensors",
13
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00007.safetensors",
14
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00007.safetensors",
15
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00007.safetensors",
16
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00007.safetensors",
17
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00007.safetensors",
18
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00007.safetensors",
19
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00007.safetensors",
20
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00007.safetensors",
21
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00007.safetensors",
22
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00007.safetensors",
23
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00007.safetensors",
24
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00007.safetensors",
25
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00007.safetensors",
26
+ "model.layers.10.input_layernorm.weight": "model-00003-of-00007.safetensors",
27
+ "model.layers.10.mlp.down_proj.weight": "model-00003-of-00007.safetensors",
28
+ "model.layers.10.mlp.gate_proj.weight": "model-00003-of-00007.safetensors",
29
+ "model.layers.10.mlp.up_proj.weight": "model-00003-of-00007.safetensors",
30
+ "model.layers.10.post_attention_layernorm.weight": "model-00003-of-00007.safetensors",
31
+ "model.layers.10.self_attn.k_proj.weight": "model-00003-of-00007.safetensors",
32
+ "model.layers.10.self_attn.o_proj.weight": "model-00003-of-00007.safetensors",
33
+ "model.layers.10.self_attn.q_proj.weight": "model-00003-of-00007.safetensors",
34
+ "model.layers.10.self_attn.v_proj.weight": "model-00003-of-00007.safetensors",
35
+ "model.layers.11.input_layernorm.weight": "model-00003-of-00007.safetensors",
36
+ "model.layers.11.mlp.down_proj.weight": "model-00003-of-00007.safetensors",
37
+ "model.layers.11.mlp.gate_proj.weight": "model-00003-of-00007.safetensors",
38
+ "model.layers.11.mlp.up_proj.weight": "model-00003-of-00007.safetensors",
39
+ "model.layers.11.post_attention_layernorm.weight": "model-00003-of-00007.safetensors",
40
+ "model.layers.11.self_attn.k_proj.weight": "model-00003-of-00007.safetensors",
41
+ "model.layers.11.self_attn.o_proj.weight": "model-00003-of-00007.safetensors",
42
+ "model.layers.11.self_attn.q_proj.weight": "model-00003-of-00007.safetensors",
43
+ "model.layers.11.self_attn.v_proj.weight": "model-00003-of-00007.safetensors",
44
+ "model.layers.12.input_layernorm.weight": "model-00003-of-00007.safetensors",
45
+ "model.layers.12.mlp.down_proj.weight": "model-00003-of-00007.safetensors",
46
+ "model.layers.12.mlp.gate_proj.weight": "model-00003-of-00007.safetensors",
47
+ "model.layers.12.mlp.up_proj.weight": "model-00003-of-00007.safetensors",
48
+ "model.layers.12.post_attention_layernorm.weight": "model-00003-of-00007.safetensors",
49
+ "model.layers.12.self_attn.k_proj.weight": "model-00003-of-00007.safetensors",
50
+ "model.layers.12.self_attn.o_proj.weight": "model-00003-of-00007.safetensors",
51
+ "model.layers.12.self_attn.q_proj.weight": "model-00003-of-00007.safetensors",
52
+ "model.layers.12.self_attn.v_proj.weight": "model-00003-of-00007.safetensors",
53
+ "model.layers.13.input_layernorm.weight": "model-00003-of-00007.safetensors",
54
+ "model.layers.13.mlp.down_proj.weight": "model-00003-of-00007.safetensors",
55
+ "model.layers.13.mlp.gate_proj.weight": "model-00003-of-00007.safetensors",
56
+ "model.layers.13.mlp.up_proj.weight": "model-00003-of-00007.safetensors",
57
+ "model.layers.13.post_attention_layernorm.weight": "model-00003-of-00007.safetensors",
58
+ "model.layers.13.self_attn.k_proj.weight": "model-00003-of-00007.safetensors",
59
+ "model.layers.13.self_attn.o_proj.weight": "model-00003-of-00007.safetensors",
60
+ "model.layers.13.self_attn.q_proj.weight": "model-00003-of-00007.safetensors",
61
+ "model.layers.13.self_attn.v_proj.weight": "model-00003-of-00007.safetensors",
62
+ "model.layers.14.input_layernorm.weight": "model-00004-of-00007.safetensors",
63
+ "model.layers.14.mlp.down_proj.weight": "model-00004-of-00007.safetensors",
64
+ "model.layers.14.mlp.gate_proj.weight": "model-00003-of-00007.safetensors",
65
+ "model.layers.14.mlp.up_proj.weight": "model-00004-of-00007.safetensors",
66
+ "model.layers.14.post_attention_layernorm.weight": "model-00004-of-00007.safetensors",
67
+ "model.layers.14.self_attn.k_proj.weight": "model-00003-of-00007.safetensors",
68
+ "model.layers.14.self_attn.o_proj.weight": "model-00003-of-00007.safetensors",
69
+ "model.layers.14.self_attn.q_proj.weight": "model-00003-of-00007.safetensors",
70
+ "model.layers.14.self_attn.v_proj.weight": "model-00003-of-00007.safetensors",
71
+ "model.layers.15.input_layernorm.weight": "model-00004-of-00007.safetensors",
72
+ "model.layers.15.mlp.down_proj.weight": "model-00004-of-00007.safetensors",
73
+ "model.layers.15.mlp.gate_proj.weight": "model-00004-of-00007.safetensors",
74
+ "model.layers.15.mlp.up_proj.weight": "model-00004-of-00007.safetensors",
75
+ "model.layers.15.post_attention_layernorm.weight": "model-00004-of-00007.safetensors",
76
+ "model.layers.15.self_attn.k_proj.weight": "model-00004-of-00007.safetensors",
77
+ "model.layers.15.self_attn.o_proj.weight": "model-00004-of-00007.safetensors",
78
+ "model.layers.15.self_attn.q_proj.weight": "model-00004-of-00007.safetensors",
79
+ "model.layers.15.self_attn.v_proj.weight": "model-00004-of-00007.safetensors",
80
+ "model.layers.16.input_layernorm.weight": "model-00004-of-00007.safetensors",
81
+ "model.layers.16.mlp.down_proj.weight": "model-00004-of-00007.safetensors",
82
+ "model.layers.16.mlp.gate_proj.weight": "model-00004-of-00007.safetensors",
83
+ "model.layers.16.mlp.up_proj.weight": "model-00004-of-00007.safetensors",
84
+ "model.layers.16.post_attention_layernorm.weight": "model-00004-of-00007.safetensors",
85
+ "model.layers.16.self_attn.k_proj.weight": "model-00004-of-00007.safetensors",
86
+ "model.layers.16.self_attn.o_proj.weight": "model-00004-of-00007.safetensors",
87
+ "model.layers.16.self_attn.q_proj.weight": "model-00004-of-00007.safetensors",
88
+ "model.layers.16.self_attn.v_proj.weight": "model-00004-of-00007.safetensors",
89
+ "model.layers.17.input_layernorm.weight": "model-00004-of-00007.safetensors",
90
+ "model.layers.17.mlp.down_proj.weight": "model-00004-of-00007.safetensors",
91
+ "model.layers.17.mlp.gate_proj.weight": "model-00004-of-00007.safetensors",
92
+ "model.layers.17.mlp.up_proj.weight": "model-00004-of-00007.safetensors",
93
+ "model.layers.17.post_attention_layernorm.weight": "model-00004-of-00007.safetensors",
94
+ "model.layers.17.self_attn.k_proj.weight": "model-00004-of-00007.safetensors",
95
+ "model.layers.17.self_attn.o_proj.weight": "model-00004-of-00007.safetensors",
96
+ "model.layers.17.self_attn.q_proj.weight": "model-00004-of-00007.safetensors",
97
+ "model.layers.17.self_attn.v_proj.weight": "model-00004-of-00007.safetensors",
98
+ "model.layers.18.input_layernorm.weight": "model-00004-of-00007.safetensors",
99
+ "model.layers.18.mlp.down_proj.weight": "model-00004-of-00007.safetensors",
100
+ "model.layers.18.mlp.gate_proj.weight": "model-00004-of-00007.safetensors",
101
+ "model.layers.18.mlp.up_proj.weight": "model-00004-of-00007.safetensors",
102
+ "model.layers.18.post_attention_layernorm.weight": "model-00004-of-00007.safetensors",
103
+ "model.layers.18.self_attn.k_proj.weight": "model-00004-of-00007.safetensors",
104
+ "model.layers.18.self_attn.o_proj.weight": "model-00004-of-00007.safetensors",
105
+ "model.layers.18.self_attn.q_proj.weight": "model-00004-of-00007.safetensors",
106
+ "model.layers.18.self_attn.v_proj.weight": "model-00004-of-00007.safetensors",
107
+ "model.layers.19.input_layernorm.weight": "model-00004-of-00007.safetensors",
108
+ "model.layers.19.mlp.down_proj.weight": "model-00004-of-00007.safetensors",
109
+ "model.layers.19.mlp.gate_proj.weight": "model-00004-of-00007.safetensors",
110
+ "model.layers.19.mlp.up_proj.weight": "model-00004-of-00007.safetensors",
111
+ "model.layers.19.post_attention_layernorm.weight": "model-00004-of-00007.safetensors",
112
+ "model.layers.19.self_attn.k_proj.weight": "model-00004-of-00007.safetensors",
113
+ "model.layers.19.self_attn.o_proj.weight": "model-00004-of-00007.safetensors",
114
+ "model.layers.19.self_attn.q_proj.weight": "model-00004-of-00007.safetensors",
115
+ "model.layers.19.self_attn.v_proj.weight": "model-00004-of-00007.safetensors",
116
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00007.safetensors",
117
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00007.safetensors",
118
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00007.safetensors",
119
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00007.safetensors",
120
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00007.safetensors",
121
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00007.safetensors",
122
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00007.safetensors",
123
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00007.safetensors",
124
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00007.safetensors",
125
+ "model.layers.20.input_layernorm.weight": "model-00005-of-00007.safetensors",
126
+ "model.layers.20.mlp.down_proj.weight": "model-00005-of-00007.safetensors",
127
+ "model.layers.20.mlp.gate_proj.weight": "model-00005-of-00007.safetensors",
128
+ "model.layers.20.mlp.up_proj.weight": "model-00005-of-00007.safetensors",
129
+ "model.layers.20.post_attention_layernorm.weight": "model-00005-of-00007.safetensors",
130
+ "model.layers.20.self_attn.k_proj.weight": "model-00004-of-00007.safetensors",
131
+ "model.layers.20.self_attn.o_proj.weight": "model-00004-of-00007.safetensors",
132
+ "model.layers.20.self_attn.q_proj.weight": "model-00004-of-00007.safetensors",
133
+ "model.layers.20.self_attn.v_proj.weight": "model-00004-of-00007.safetensors",
134
+ "model.layers.21.input_layernorm.weight": "model-00005-of-00007.safetensors",
135
+ "model.layers.21.mlp.down_proj.weight": "model-00005-of-00007.safetensors",
136
+ "model.layers.21.mlp.gate_proj.weight": "model-00005-of-00007.safetensors",
137
+ "model.layers.21.mlp.up_proj.weight": "model-00005-of-00007.safetensors",
138
+ "model.layers.21.post_attention_layernorm.weight": "model-00005-of-00007.safetensors",
139
+ "model.layers.21.self_attn.k_proj.weight": "model-00005-of-00007.safetensors",
140
+ "model.layers.21.self_attn.o_proj.weight": "model-00005-of-00007.safetensors",
141
+ "model.layers.21.self_attn.q_proj.weight": "model-00005-of-00007.safetensors",
142
+ "model.layers.21.self_attn.v_proj.weight": "model-00005-of-00007.safetensors",
143
+ "model.layers.22.input_layernorm.weight": "model-00005-of-00007.safetensors",
144
+ "model.layers.22.mlp.down_proj.weight": "model-00005-of-00007.safetensors",
145
+ "model.layers.22.mlp.gate_proj.weight": "model-00005-of-00007.safetensors",
146
+ "model.layers.22.mlp.up_proj.weight": "model-00005-of-00007.safetensors",
147
+ "model.layers.22.post_attention_layernorm.weight": "model-00005-of-00007.safetensors",
148
+ "model.layers.22.self_attn.k_proj.weight": "model-00005-of-00007.safetensors",
149
+ "model.layers.22.self_attn.o_proj.weight": "model-00005-of-00007.safetensors",
150
+ "model.layers.22.self_attn.q_proj.weight": "model-00005-of-00007.safetensors",
151
+ "model.layers.22.self_attn.v_proj.weight": "model-00005-of-00007.safetensors",
152
+ "model.layers.23.input_layernorm.weight": "model-00005-of-00007.safetensors",
153
+ "model.layers.23.mlp.down_proj.weight": "model-00005-of-00007.safetensors",
154
+ "model.layers.23.mlp.gate_proj.weight": "model-00005-of-00007.safetensors",
155
+ "model.layers.23.mlp.up_proj.weight": "model-00005-of-00007.safetensors",
156
+ "model.layers.23.post_attention_layernorm.weight": "model-00005-of-00007.safetensors",
157
+ "model.layers.23.self_attn.k_proj.weight": "model-00005-of-00007.safetensors",
158
+ "model.layers.23.self_attn.o_proj.weight": "model-00005-of-00007.safetensors",
159
+ "model.layers.23.self_attn.q_proj.weight": "model-00005-of-00007.safetensors",
160
+ "model.layers.23.self_attn.v_proj.weight": "model-00005-of-00007.safetensors",
161
+ "model.layers.24.input_layernorm.weight": "model-00005-of-00007.safetensors",
162
+ "model.layers.24.mlp.down_proj.weight": "model-00005-of-00007.safetensors",
163
+ "model.layers.24.mlp.gate_proj.weight": "model-00005-of-00007.safetensors",
164
+ "model.layers.24.mlp.up_proj.weight": "model-00005-of-00007.safetensors",
165
+ "model.layers.24.post_attention_layernorm.weight": "model-00005-of-00007.safetensors",
166
+ "model.layers.24.self_attn.k_proj.weight": "model-00005-of-00007.safetensors",
167
+ "model.layers.24.self_attn.o_proj.weight": "model-00005-of-00007.safetensors",
168
+ "model.layers.24.self_attn.q_proj.weight": "model-00005-of-00007.safetensors",
169
+ "model.layers.24.self_attn.v_proj.weight": "model-00005-of-00007.safetensors",
170
+ "model.layers.25.input_layernorm.weight": "model-00006-of-00007.safetensors",
171
+ "model.layers.25.mlp.down_proj.weight": "model-00006-of-00007.safetensors",
172
+ "model.layers.25.mlp.gate_proj.weight": "model-00005-of-00007.safetensors",
173
+ "model.layers.25.mlp.up_proj.weight": "model-00005-of-00007.safetensors",
174
+ "model.layers.25.post_attention_layernorm.weight": "model-00006-of-00007.safetensors",
175
+ "model.layers.25.self_attn.k_proj.weight": "model-00005-of-00007.safetensors",
176
+ "model.layers.25.self_attn.o_proj.weight": "model-00005-of-00007.safetensors",
177
+ "model.layers.25.self_attn.q_proj.weight": "model-00005-of-00007.safetensors",
178
+ "model.layers.25.self_attn.v_proj.weight": "model-00005-of-00007.safetensors",
179
+ "model.layers.26.input_layernorm.weight": "model-00006-of-00007.safetensors",
180
+ "model.layers.26.mlp.down_proj.weight": "model-00006-of-00007.safetensors",
181
+ "model.layers.26.mlp.gate_proj.weight": "model-00006-of-00007.safetensors",
182
+ "model.layers.26.mlp.up_proj.weight": "model-00006-of-00007.safetensors",
183
+ "model.layers.26.post_attention_layernorm.weight": "model-00006-of-00007.safetensors",
184
+ "model.layers.26.self_attn.k_proj.weight": "model-00006-of-00007.safetensors",
185
+ "model.layers.26.self_attn.o_proj.weight": "model-00006-of-00007.safetensors",
186
+ "model.layers.26.self_attn.q_proj.weight": "model-00006-of-00007.safetensors",
187
+ "model.layers.26.self_attn.v_proj.weight": "model-00006-of-00007.safetensors",
188
+ "model.layers.27.input_layernorm.weight": "model-00006-of-00007.safetensors",
189
+ "model.layers.27.mlp.down_proj.weight": "model-00006-of-00007.safetensors",
190
+ "model.layers.27.mlp.gate_proj.weight": "model-00006-of-00007.safetensors",
191
+ "model.layers.27.mlp.up_proj.weight": "model-00006-of-00007.safetensors",
192
+ "model.layers.27.post_attention_layernorm.weight": "model-00006-of-00007.safetensors",
193
+ "model.layers.27.self_attn.k_proj.weight": "model-00006-of-00007.safetensors",
194
+ "model.layers.27.self_attn.o_proj.weight": "model-00006-of-00007.safetensors",
195
+ "model.layers.27.self_attn.q_proj.weight": "model-00006-of-00007.safetensors",
196
+ "model.layers.27.self_attn.v_proj.weight": "model-00006-of-00007.safetensors",
197
+ "model.layers.28.input_layernorm.weight": "model-00006-of-00007.safetensors",
198
+ "model.layers.28.mlp.down_proj.weight": "model-00006-of-00007.safetensors",
199
+ "model.layers.28.mlp.gate_proj.weight": "model-00006-of-00007.safetensors",
200
+ "model.layers.28.mlp.up_proj.weight": "model-00006-of-00007.safetensors",
201
+ "model.layers.28.post_attention_layernorm.weight": "model-00006-of-00007.safetensors",
202
+ "model.layers.28.self_attn.k_proj.weight": "model-00006-of-00007.safetensors",
203
+ "model.layers.28.self_attn.o_proj.weight": "model-00006-of-00007.safetensors",
204
+ "model.layers.28.self_attn.q_proj.weight": "model-00006-of-00007.safetensors",
205
+ "model.layers.28.self_attn.v_proj.weight": "model-00006-of-00007.safetensors",
206
+ "model.layers.29.input_layernorm.weight": "model-00006-of-00007.safetensors",
207
+ "model.layers.29.mlp.down_proj.weight": "model-00006-of-00007.safetensors",
208
+ "model.layers.29.mlp.gate_proj.weight": "model-00006-of-00007.safetensors",
209
+ "model.layers.29.mlp.up_proj.weight": "model-00006-of-00007.safetensors",
210
+ "model.layers.29.post_attention_layernorm.weight": "model-00006-of-00007.safetensors",
211
+ "model.layers.29.self_attn.k_proj.weight": "model-00006-of-00007.safetensors",
212
+ "model.layers.29.self_attn.o_proj.weight": "model-00006-of-00007.safetensors",
213
+ "model.layers.29.self_attn.q_proj.weight": "model-00006-of-00007.safetensors",
214
+ "model.layers.29.self_attn.v_proj.weight": "model-00006-of-00007.safetensors",
215
+ "model.layers.3.input_layernorm.weight": "model-00002-of-00007.safetensors",
216
+ "model.layers.3.mlp.down_proj.weight": "model-00002-of-00007.safetensors",
217
+ "model.layers.3.mlp.gate_proj.weight": "model-00002-of-00007.safetensors",
218
+ "model.layers.3.mlp.up_proj.weight": "model-00002-of-00007.safetensors",
219
+ "model.layers.3.post_attention_layernorm.weight": "model-00002-of-00007.safetensors",
220
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00007.safetensors",
221
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00007.safetensors",
222
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00007.safetensors",
223
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00007.safetensors",
224
+ "model.layers.30.input_layernorm.weight": "model-00006-of-00007.safetensors",
225
+ "model.layers.30.mlp.down_proj.weight": "model-00006-of-00007.safetensors",
226
+ "model.layers.30.mlp.gate_proj.weight": "model-00006-of-00007.safetensors",
227
+ "model.layers.30.mlp.up_proj.weight": "model-00006-of-00007.safetensors",
228
+ "model.layers.30.post_attention_layernorm.weight": "model-00006-of-00007.safetensors",
229
+ "model.layers.30.self_attn.k_proj.weight": "model-00006-of-00007.safetensors",
230
+ "model.layers.30.self_attn.o_proj.weight": "model-00006-of-00007.safetensors",
231
+ "model.layers.30.self_attn.q_proj.weight": "model-00006-of-00007.safetensors",
232
+ "model.layers.30.self_attn.v_proj.weight": "model-00006-of-00007.safetensors",
233
+ "model.layers.31.input_layernorm.weight": "model-00007-of-00007.safetensors",
234
+ "model.layers.31.mlp.down_proj.weight": "model-00007-of-00007.safetensors",
235
+ "model.layers.31.mlp.gate_proj.weight": "model-00006-of-00007.safetensors",
236
+ "model.layers.31.mlp.up_proj.weight": "model-00007-of-00007.safetensors",
237
+ "model.layers.31.post_attention_layernorm.weight": "model-00007-of-00007.safetensors",
238
+ "model.layers.31.self_attn.k_proj.weight": "model-00006-of-00007.safetensors",
239
+ "model.layers.31.self_attn.o_proj.weight": "model-00006-of-00007.safetensors",
240
+ "model.layers.31.self_attn.q_proj.weight": "model-00006-of-00007.safetensors",
241
+ "model.layers.31.self_attn.v_proj.weight": "model-00006-of-00007.safetensors",
242
+ "model.layers.4.input_layernorm.weight": "model-00002-of-00007.safetensors",
243
+ "model.layers.4.mlp.down_proj.weight": "model-00002-of-00007.safetensors",
244
+ "model.layers.4.mlp.gate_proj.weight": "model-00002-of-00007.safetensors",
245
+ "model.layers.4.mlp.up_proj.weight": "model-00002-of-00007.safetensors",
246
+ "model.layers.4.post_attention_layernorm.weight": "model-00002-of-00007.safetensors",
247
+ "model.layers.4.self_attn.k_proj.weight": "model-00002-of-00007.safetensors",
248
+ "model.layers.4.self_attn.o_proj.weight": "model-00002-of-00007.safetensors",
249
+ "model.layers.4.self_attn.q_proj.weight": "model-00002-of-00007.safetensors",
250
+ "model.layers.4.self_attn.v_proj.weight": "model-00002-of-00007.safetensors",
251
+ "model.layers.5.input_layernorm.weight": "model-00002-of-00007.safetensors",
252
+ "model.layers.5.mlp.down_proj.weight": "model-00002-of-00007.safetensors",
253
+ "model.layers.5.mlp.gate_proj.weight": "model-00002-of-00007.safetensors",
254
+ "model.layers.5.mlp.up_proj.weight": "model-00002-of-00007.safetensors",
255
+ "model.layers.5.post_attention_layernorm.weight": "model-00002-of-00007.safetensors",
256
+ "model.layers.5.self_attn.k_proj.weight": "model-00002-of-00007.safetensors",
257
+ "model.layers.5.self_attn.o_proj.weight": "model-00002-of-00007.safetensors",
258
+ "model.layers.5.self_attn.q_proj.weight": "model-00002-of-00007.safetensors",
259
+ "model.layers.5.self_attn.v_proj.weight": "model-00002-of-00007.safetensors",
260
+ "model.layers.6.input_layernorm.weight": "model-00002-of-00007.safetensors",
261
+ "model.layers.6.mlp.down_proj.weight": "model-00002-of-00007.safetensors",
262
+ "model.layers.6.mlp.gate_proj.weight": "model-00002-of-00007.safetensors",
263
+ "model.layers.6.mlp.up_proj.weight": "model-00002-of-00007.safetensors",
264
+ "model.layers.6.post_attention_layernorm.weight": "model-00002-of-00007.safetensors",
265
+ "model.layers.6.self_attn.k_proj.weight": "model-00002-of-00007.safetensors",
266
+ "model.layers.6.self_attn.o_proj.weight": "model-00002-of-00007.safetensors",
267
+ "model.layers.6.self_attn.q_proj.weight": "model-00002-of-00007.safetensors",
268
+ "model.layers.6.self_attn.v_proj.weight": "model-00002-of-00007.safetensors",
269
+ "model.layers.7.input_layernorm.weight": "model-00002-of-00007.safetensors",
270
+ "model.layers.7.mlp.down_proj.weight": "model-00002-of-00007.safetensors",
271
+ "model.layers.7.mlp.gate_proj.weight": "model-00002-of-00007.safetensors",
272
+ "model.layers.7.mlp.up_proj.weight": "model-00002-of-00007.safetensors",
273
+ "model.layers.7.post_attention_layernorm.weight": "model-00002-of-00007.safetensors",
274
+ "model.layers.7.self_attn.k_proj.weight": "model-00002-of-00007.safetensors",
275
+ "model.layers.7.self_attn.o_proj.weight": "model-00002-of-00007.safetensors",
276
+ "model.layers.7.self_attn.q_proj.weight": "model-00002-of-00007.safetensors",
277
+ "model.layers.7.self_attn.v_proj.weight": "model-00002-of-00007.safetensors",
278
+ "model.layers.8.input_layernorm.weight": "model-00003-of-00007.safetensors",
279
+ "model.layers.8.mlp.down_proj.weight": "model-00003-of-00007.safetensors",
280
+ "model.layers.8.mlp.gate_proj.weight": "model-00002-of-00007.safetensors",
281
+ "model.layers.8.mlp.up_proj.weight": "model-00002-of-00007.safetensors",
282
+ "model.layers.8.post_attention_layernorm.weight": "model-00003-of-00007.safetensors",
283
+ "model.layers.8.self_attn.k_proj.weight": "model-00002-of-00007.safetensors",
284
+ "model.layers.8.self_attn.o_proj.weight": "model-00002-of-00007.safetensors",
285
+ "model.layers.8.self_attn.q_proj.weight": "model-00002-of-00007.safetensors",
286
+ "model.layers.8.self_attn.v_proj.weight": "model-00002-of-00007.safetensors",
287
+ "model.layers.9.input_layernorm.weight": "model-00003-of-00007.safetensors",
288
+ "model.layers.9.mlp.down_proj.weight": "model-00003-of-00007.safetensors",
289
+ "model.layers.9.mlp.gate_proj.weight": "model-00003-of-00007.safetensors",
290
+ "model.layers.9.mlp.up_proj.weight": "model-00003-of-00007.safetensors",
291
+ "model.layers.9.post_attention_layernorm.weight": "model-00003-of-00007.safetensors",
292
+ "model.layers.9.self_attn.k_proj.weight": "model-00003-of-00007.safetensors",
293
+ "model.layers.9.self_attn.o_proj.weight": "model-00003-of-00007.safetensors",
294
+ "model.layers.9.self_attn.q_proj.weight": "model-00003-of-00007.safetensors",
295
+ "model.layers.9.self_attn.v_proj.weight": "model-00003-of-00007.safetensors",
296
+ "model.mm_projector.projector.0.bias": "model-00007-of-00007.safetensors",
297
+ "model.mm_projector.projector.0.weight": "model-00007-of-00007.safetensors",
298
+ "model.mm_projector.projector.2.bias": "model-00007-of-00007.safetensors",
299
+ "model.mm_projector.projector.2.weight": "model-00007-of-00007.safetensors",
300
+ "model.norm.weight": "model-00007-of-00007.safetensors",
301
+ "model.vision_tower.vision_tower.blocks.0.attn.out_proj.bias": "model-00007-of-00007.safetensors",
302
+ "model.vision_tower.vision_tower.blocks.0.attn.out_proj.weight": "model-00007-of-00007.safetensors",
303
+ "model.vision_tower.vision_tower.blocks.0.attn.qkv.weight": "model-00007-of-00007.safetensors",
304
+ "model.vision_tower.vision_tower.blocks.0.mlp.linear1.bias": "model-00007-of-00007.safetensors",
305
+ "model.vision_tower.vision_tower.blocks.0.mlp.linear1.weight": "model-00007-of-00007.safetensors",
306
+ "model.vision_tower.vision_tower.blocks.0.mlp.linear2.bias": "model-00007-of-00007.safetensors",
307
+ "model.vision_tower.vision_tower.blocks.0.mlp.linear2.weight": "model-00007-of-00007.safetensors",
308
+ "model.vision_tower.vision_tower.blocks.0.norm1.bias": "model-00007-of-00007.safetensors",
309
+ "model.vision_tower.vision_tower.blocks.0.norm1.weight": "model-00007-of-00007.safetensors",
310
+ "model.vision_tower.vision_tower.blocks.0.norm2.bias": "model-00007-of-00007.safetensors",
311
+ "model.vision_tower.vision_tower.blocks.0.norm2.weight": "model-00007-of-00007.safetensors",
312
+ "model.vision_tower.vision_tower.blocks.1.attn.out_proj.bias": "model-00007-of-00007.safetensors",
313
+ "model.vision_tower.vision_tower.blocks.1.attn.out_proj.weight": "model-00007-of-00007.safetensors",
314
+ "model.vision_tower.vision_tower.blocks.1.attn.qkv.weight": "model-00007-of-00007.safetensors",
315
+ "model.vision_tower.vision_tower.blocks.1.mlp.linear1.bias": "model-00007-of-00007.safetensors",
316
+ "model.vision_tower.vision_tower.blocks.1.mlp.linear1.weight": "model-00007-of-00007.safetensors",
317
+ "model.vision_tower.vision_tower.blocks.1.mlp.linear2.bias": "model-00007-of-00007.safetensors",
318
+ "model.vision_tower.vision_tower.blocks.1.mlp.linear2.weight": "model-00007-of-00007.safetensors",
319
+ "model.vision_tower.vision_tower.blocks.1.norm1.bias": "model-00007-of-00007.safetensors",
320
+ "model.vision_tower.vision_tower.blocks.1.norm1.weight": "model-00007-of-00007.safetensors",
321
+ "model.vision_tower.vision_tower.blocks.1.norm2.bias": "model-00007-of-00007.safetensors",
322
+ "model.vision_tower.vision_tower.blocks.1.norm2.weight": "model-00007-of-00007.safetensors",
323
+ "model.vision_tower.vision_tower.blocks.10.attn.out_proj.bias": "model-00007-of-00007.safetensors",
324
+ "model.vision_tower.vision_tower.blocks.10.attn.out_proj.weight": "model-00007-of-00007.safetensors",
325
+ "model.vision_tower.vision_tower.blocks.10.attn.qkv.weight": "model-00007-of-00007.safetensors",
326
+ "model.vision_tower.vision_tower.blocks.10.mlp.linear1.bias": "model-00007-of-00007.safetensors",
327
+ "model.vision_tower.vision_tower.blocks.10.mlp.linear1.weight": "model-00007-of-00007.safetensors",
328
+ "model.vision_tower.vision_tower.blocks.10.mlp.linear2.bias": "model-00007-of-00007.safetensors",
329
+ "model.vision_tower.vision_tower.blocks.10.mlp.linear2.weight": "model-00007-of-00007.safetensors",
330
+ "model.vision_tower.vision_tower.blocks.10.norm1.bias": "model-00007-of-00007.safetensors",
331
+ "model.vision_tower.vision_tower.blocks.10.norm1.weight": "model-00007-of-00007.safetensors",
332
+ "model.vision_tower.vision_tower.blocks.10.norm2.bias": "model-00007-of-00007.safetensors",
333
+ "model.vision_tower.vision_tower.blocks.10.norm2.weight": "model-00007-of-00007.safetensors",
334
+ "model.vision_tower.vision_tower.blocks.11.attn.out_proj.bias": "model-00007-of-00007.safetensors",
335
+ "model.vision_tower.vision_tower.blocks.11.attn.out_proj.weight": "model-00007-of-00007.safetensors",
336
+ "model.vision_tower.vision_tower.blocks.11.attn.qkv.weight": "model-00007-of-00007.safetensors",
337
+ "model.vision_tower.vision_tower.blocks.11.mlp.linear1.bias": "model-00007-of-00007.safetensors",
338
+ "model.vision_tower.vision_tower.blocks.11.mlp.linear1.weight": "model-00007-of-00007.safetensors",
339
+ "model.vision_tower.vision_tower.blocks.11.mlp.linear2.bias": "model-00007-of-00007.safetensors",
340
+ "model.vision_tower.vision_tower.blocks.11.mlp.linear2.weight": "model-00007-of-00007.safetensors",
341
+ "model.vision_tower.vision_tower.blocks.11.norm1.bias": "model-00007-of-00007.safetensors",
342
+ "model.vision_tower.vision_tower.blocks.11.norm1.weight": "model-00007-of-00007.safetensors",
343
+ "model.vision_tower.vision_tower.blocks.11.norm2.bias": "model-00007-of-00007.safetensors",
344
+ "model.vision_tower.vision_tower.blocks.11.norm2.weight": "model-00007-of-00007.safetensors",
345
+ "model.vision_tower.vision_tower.blocks.2.attn.out_proj.bias": "model-00007-of-00007.safetensors",
346
+ "model.vision_tower.vision_tower.blocks.2.attn.out_proj.weight": "model-00007-of-00007.safetensors",
347
+ "model.vision_tower.vision_tower.blocks.2.attn.qkv.weight": "model-00007-of-00007.safetensors",
348
+ "model.vision_tower.vision_tower.blocks.2.mlp.linear1.bias": "model-00007-of-00007.safetensors",
349
+ "model.vision_tower.vision_tower.blocks.2.mlp.linear1.weight": "model-00007-of-00007.safetensors",
350
+ "model.vision_tower.vision_tower.blocks.2.mlp.linear2.bias": "model-00007-of-00007.safetensors",
351
+ "model.vision_tower.vision_tower.blocks.2.mlp.linear2.weight": "model-00007-of-00007.safetensors",
352
+ "model.vision_tower.vision_tower.blocks.2.norm1.bias": "model-00007-of-00007.safetensors",
353
+ "model.vision_tower.vision_tower.blocks.2.norm1.weight": "model-00007-of-00007.safetensors",
354
+ "model.vision_tower.vision_tower.blocks.2.norm2.bias": "model-00007-of-00007.safetensors",
355
+ "model.vision_tower.vision_tower.blocks.2.norm2.weight": "model-00007-of-00007.safetensors",
356
+ "model.vision_tower.vision_tower.blocks.3.attn.out_proj.bias": "model-00007-of-00007.safetensors",
357
+ "model.vision_tower.vision_tower.blocks.3.attn.out_proj.weight": "model-00007-of-00007.safetensors",
358
+ "model.vision_tower.vision_tower.blocks.3.attn.qkv.weight": "model-00007-of-00007.safetensors",
359
+ "model.vision_tower.vision_tower.blocks.3.mlp.linear1.bias": "model-00007-of-00007.safetensors",
360
+ "model.vision_tower.vision_tower.blocks.3.mlp.linear1.weight": "model-00007-of-00007.safetensors",
361
+ "model.vision_tower.vision_tower.blocks.3.mlp.linear2.bias": "model-00007-of-00007.safetensors",
362
+ "model.vision_tower.vision_tower.blocks.3.mlp.linear2.weight": "model-00007-of-00007.safetensors",
363
+ "model.vision_tower.vision_tower.blocks.3.norm1.bias": "model-00007-of-00007.safetensors",
364
+ "model.vision_tower.vision_tower.blocks.3.norm1.weight": "model-00007-of-00007.safetensors",
365
+ "model.vision_tower.vision_tower.blocks.3.norm2.bias": "model-00007-of-00007.safetensors",
366
+ "model.vision_tower.vision_tower.blocks.3.norm2.weight": "model-00007-of-00007.safetensors",
367
+ "model.vision_tower.vision_tower.blocks.4.attn.out_proj.bias": "model-00007-of-00007.safetensors",
368
+ "model.vision_tower.vision_tower.blocks.4.attn.out_proj.weight": "model-00007-of-00007.safetensors",
369
+ "model.vision_tower.vision_tower.blocks.4.attn.qkv.weight": "model-00007-of-00007.safetensors",
370
+ "model.vision_tower.vision_tower.blocks.4.mlp.linear1.bias": "model-00007-of-00007.safetensors",
371
+ "model.vision_tower.vision_tower.blocks.4.mlp.linear1.weight": "model-00007-of-00007.safetensors",
372
+ "model.vision_tower.vision_tower.blocks.4.mlp.linear2.bias": "model-00007-of-00007.safetensors",
373
+ "model.vision_tower.vision_tower.blocks.4.mlp.linear2.weight": "model-00007-of-00007.safetensors",
374
+ "model.vision_tower.vision_tower.blocks.4.norm1.bias": "model-00007-of-00007.safetensors",
375
+ "model.vision_tower.vision_tower.blocks.4.norm1.weight": "model-00007-of-00007.safetensors",
376
+ "model.vision_tower.vision_tower.blocks.4.norm2.bias": "model-00007-of-00007.safetensors",
377
+ "model.vision_tower.vision_tower.blocks.4.norm2.weight": "model-00007-of-00007.safetensors",
378
+ "model.vision_tower.vision_tower.blocks.5.attn.out_proj.bias": "model-00007-of-00007.safetensors",
379
+ "model.vision_tower.vision_tower.blocks.5.attn.out_proj.weight": "model-00007-of-00007.safetensors",
380
+ "model.vision_tower.vision_tower.blocks.5.attn.qkv.weight": "model-00007-of-00007.safetensors",
381
+ "model.vision_tower.vision_tower.blocks.5.mlp.linear1.bias": "model-00007-of-00007.safetensors",
382
+ "model.vision_tower.vision_tower.blocks.5.mlp.linear1.weight": "model-00007-of-00007.safetensors",
383
+ "model.vision_tower.vision_tower.blocks.5.mlp.linear2.bias": "model-00007-of-00007.safetensors",
384
+ "model.vision_tower.vision_tower.blocks.5.mlp.linear2.weight": "model-00007-of-00007.safetensors",
385
+ "model.vision_tower.vision_tower.blocks.5.norm1.bias": "model-00007-of-00007.safetensors",
386
+ "model.vision_tower.vision_tower.blocks.5.norm1.weight": "model-00007-of-00007.safetensors",
387
+ "model.vision_tower.vision_tower.blocks.5.norm2.bias": "model-00007-of-00007.safetensors",
388
+ "model.vision_tower.vision_tower.blocks.5.norm2.weight": "model-00007-of-00007.safetensors",
389
+ "model.vision_tower.vision_tower.blocks.6.attn.out_proj.bias": "model-00007-of-00007.safetensors",
390
+ "model.vision_tower.vision_tower.blocks.6.attn.out_proj.weight": "model-00007-of-00007.safetensors",
391
+ "model.vision_tower.vision_tower.blocks.6.attn.qkv.weight": "model-00007-of-00007.safetensors",
392
+ "model.vision_tower.vision_tower.blocks.6.mlp.linear1.bias": "model-00007-of-00007.safetensors",
393
+ "model.vision_tower.vision_tower.blocks.6.mlp.linear1.weight": "model-00007-of-00007.safetensors",
394
+ "model.vision_tower.vision_tower.blocks.6.mlp.linear2.bias": "model-00007-of-00007.safetensors",
395
+ "model.vision_tower.vision_tower.blocks.6.mlp.linear2.weight": "model-00007-of-00007.safetensors",
396
+ "model.vision_tower.vision_tower.blocks.6.norm1.bias": "model-00007-of-00007.safetensors",
397
+ "model.vision_tower.vision_tower.blocks.6.norm1.weight": "model-00007-of-00007.safetensors",
398
+ "model.vision_tower.vision_tower.blocks.6.norm2.bias": "model-00007-of-00007.safetensors",
399
+ "model.vision_tower.vision_tower.blocks.6.norm2.weight": "model-00007-of-00007.safetensors",
400
+ "model.vision_tower.vision_tower.blocks.7.attn.out_proj.bias": "model-00007-of-00007.safetensors",
401
+ "model.vision_tower.vision_tower.blocks.7.attn.out_proj.weight": "model-00007-of-00007.safetensors",
402
+ "model.vision_tower.vision_tower.blocks.7.attn.qkv.weight": "model-00007-of-00007.safetensors",
403
+ "model.vision_tower.vision_tower.blocks.7.mlp.linear1.bias": "model-00007-of-00007.safetensors",
404
+ "model.vision_tower.vision_tower.blocks.7.mlp.linear1.weight": "model-00007-of-00007.safetensors",
405
+ "model.vision_tower.vision_tower.blocks.7.mlp.linear2.bias": "model-00007-of-00007.safetensors",
406
+ "model.vision_tower.vision_tower.blocks.7.mlp.linear2.weight": "model-00007-of-00007.safetensors",
407
+ "model.vision_tower.vision_tower.blocks.7.norm1.bias": "model-00007-of-00007.safetensors",
408
+ "model.vision_tower.vision_tower.blocks.7.norm1.weight": "model-00007-of-00007.safetensors",
409
+ "model.vision_tower.vision_tower.blocks.7.norm2.bias": "model-00007-of-00007.safetensors",
410
+ "model.vision_tower.vision_tower.blocks.7.norm2.weight": "model-00007-of-00007.safetensors",
411
+ "model.vision_tower.vision_tower.blocks.8.attn.out_proj.bias": "model-00007-of-00007.safetensors",
412
+ "model.vision_tower.vision_tower.blocks.8.attn.out_proj.weight": "model-00007-of-00007.safetensors",
413
+ "model.vision_tower.vision_tower.blocks.8.attn.qkv.weight": "model-00007-of-00007.safetensors",
414
+ "model.vision_tower.vision_tower.blocks.8.mlp.linear1.bias": "model-00007-of-00007.safetensors",
415
+ "model.vision_tower.vision_tower.blocks.8.mlp.linear1.weight": "model-00007-of-00007.safetensors",
416
+ "model.vision_tower.vision_tower.blocks.8.mlp.linear2.bias": "model-00007-of-00007.safetensors",
417
+ "model.vision_tower.vision_tower.blocks.8.mlp.linear2.weight": "model-00007-of-00007.safetensors",
418
+ "model.vision_tower.vision_tower.blocks.8.norm1.bias": "model-00007-of-00007.safetensors",
419
+ "model.vision_tower.vision_tower.blocks.8.norm1.weight": "model-00007-of-00007.safetensors",
420
+ "model.vision_tower.vision_tower.blocks.8.norm2.bias": "model-00007-of-00007.safetensors",
421
+ "model.vision_tower.vision_tower.blocks.8.norm2.weight": "model-00007-of-00007.safetensors",
422
+ "model.vision_tower.vision_tower.blocks.9.attn.out_proj.bias": "model-00007-of-00007.safetensors",
423
+ "model.vision_tower.vision_tower.blocks.9.attn.out_proj.weight": "model-00007-of-00007.safetensors",
424
+ "model.vision_tower.vision_tower.blocks.9.attn.qkv.weight": "model-00007-of-00007.safetensors",
425
+ "model.vision_tower.vision_tower.blocks.9.mlp.linear1.bias": "model-00007-of-00007.safetensors",
426
+ "model.vision_tower.vision_tower.blocks.9.mlp.linear1.weight": "model-00007-of-00007.safetensors",
427
+ "model.vision_tower.vision_tower.blocks.9.mlp.linear2.bias": "model-00007-of-00007.safetensors",
428
+ "model.vision_tower.vision_tower.blocks.9.mlp.linear2.weight": "model-00007-of-00007.safetensors",
429
+ "model.vision_tower.vision_tower.blocks.9.norm1.bias": "model-00007-of-00007.safetensors",
430
+ "model.vision_tower.vision_tower.blocks.9.norm1.weight": "model-00007-of-00007.safetensors",
431
+ "model.vision_tower.vision_tower.blocks.9.norm2.bias": "model-00007-of-00007.safetensors",
432
+ "model.vision_tower.vision_tower.blocks.9.norm2.weight": "model-00007-of-00007.safetensors",
433
+ "model.vision_tower.vision_tower.cls_token": "model-00007-of-00007.safetensors",
434
+ "model.vision_tower.vision_tower.norm.bias": "model-00007-of-00007.safetensors",
435
+ "model.vision_tower.vision_tower.norm.weight": "model-00007-of-00007.safetensors",
436
+ "model.vision_tower.vision_tower.patch_embedding.patch_embeddings.1.bias": "model-00007-of-00007.safetensors",
437
+ "model.vision_tower.vision_tower.patch_embedding.patch_embeddings.1.weight": "model-00007-of-00007.safetensors",
438
+ "model.vision_tower.vision_tower.patch_embedding.position_embeddings": "model-00007-of-00007.safetensors"
439
+ }
440
+ }
modeling_m3d_lamed.py ADDED
@@ -0,0 +1,1188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+ from typing import Union
3
+ from transformers import LlamaConfig, LlamaModel, LlamaForCausalLM
4
+ from transformers.modeling_outputs import CausalLMOutputWithPast
5
+ from transformers.generation.utils import GenerateOutput
6
+ from .configuration_m3d_lamed import LamedConfig
7
+ from abc import ABC, abstractmethod
8
+ from torch import Tensor
9
+ import math
10
+ from typing import Any, Dict, List
11
+ import torch
12
+ import torch.nn as nn
13
+ from typing import Optional, Tuple, Type
14
+ from monai.networks.blocks import PatchEmbed
15
+ import numpy as np
16
+ import torch.nn.functional as F
17
+
18
+ from einops import rearrange
19
+ from einops.layers.torch import Rearrange
20
+ from collections.abc import Sequence
21
+ from monai.networks.blocks.patchembedding import PatchEmbeddingBlock
22
+ from monai.networks.blocks.transformerblock import TransformerBlock
23
+ from monai.networks.nets import ViT
24
+
25
+
26
+
27
+
28
+
29
+ class LayerNorm2d(nn.Module):
30
+ def __init__(self, num_channels: int, eps: float = 1e-6) -> None:
31
+ super().__init__()
32
+ self.weight = nn.Parameter(torch.ones(num_channels))
33
+ self.bias = nn.Parameter(torch.zeros(num_channels))
34
+ self.eps = eps
35
+
36
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
37
+ u = x.mean(1, keepdim=True)
38
+ s = (x - u).pow(2).mean(1, keepdim=True)
39
+ x = (x - u) / torch.sqrt(s + self.eps)
40
+ x = self.weight[:, None, None] * x + self.bias[:, None, None]
41
+ return x
42
+
43
+
44
+ class MLPBlock(nn.Module):
45
+ def __init__(
46
+ self,
47
+ embedding_dim: int,
48
+ mlp_dim: int,
49
+ act: Type[nn.Module] = nn.GELU,
50
+ ) -> None:
51
+ super().__init__()
52
+ self.lin1 = nn.Linear(embedding_dim, mlp_dim)
53
+ self.lin2 = nn.Linear(mlp_dim, embedding_dim)
54
+ self.act = act()
55
+
56
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
57
+ return self.lin2(self.act(self.lin1(x)))
58
+
59
+
60
+ class TwoWayTransformer(nn.Module):
61
+ def __init__(
62
+ self,
63
+ depth: int,
64
+ embedding_dim: int,
65
+ num_heads: int,
66
+ mlp_dim: int,
67
+ activation: Type[nn.Module] = nn.ReLU,
68
+ attention_downsample_rate: int = 2,
69
+ ) -> None:
70
+ """
71
+ A transformer decoder that attends to an input image using
72
+ queries whose positional embedding is supplied.
73
+
74
+ Args:
75
+ depth (int): number of layers in the transformer
76
+ embedding_dim (int): the channel dimension for the input embeddings
77
+ num_heads (int): the number of heads for multihead attention. Must
78
+ divide embedding_dim
79
+ mlp_dim (int): the channel dimension internal to the MLP block
80
+ activation (nn.Module): the activation to use in the MLP block
81
+ """
82
+ super().__init__()
83
+ self.depth = depth
84
+ self.embedding_dim = embedding_dim
85
+ self.num_heads = num_heads
86
+ self.mlp_dim = mlp_dim
87
+ self.layers = nn.ModuleList()
88
+
89
+ for i in range(depth):
90
+ self.layers.append(
91
+ TwoWayAttentionBlock(
92
+ embedding_dim=embedding_dim,
93
+ num_heads=num_heads,
94
+ mlp_dim=mlp_dim,
95
+ activation=activation,
96
+ attention_downsample_rate=attention_downsample_rate,
97
+ skip_first_layer_pe=(i == 0),
98
+ )
99
+ )
100
+
101
+ self.final_attn_token_to_image = Attention(
102
+ embedding_dim, num_heads, downsample_rate=attention_downsample_rate
103
+ )
104
+ self.norm_final_attn = nn.LayerNorm(embedding_dim)
105
+
106
+ def forward(
107
+ self,
108
+ image_embedding: Tensor,
109
+ image_pe: Tensor,
110
+ point_embedding: Tensor,
111
+ ) -> Tuple[Tensor, Tensor]:
112
+ """
113
+ Args:
114
+ image_embedding (torch.Tensor): image to attend to. Should be shape
115
+ B x embedding_dim x h x w for any h and w.
116
+ image_pe (torch.Tensor): the positional encoding to add to the image. Must
117
+ have the same shape as image_embedding.
118
+ point_embedding (torch.Tensor): the embedding to add to the query points.
119
+ Must have shape B x N_points x embedding_dim for any N_points.
120
+
121
+ Returns:
122
+ torch.Tensor: the processed point_embedding
123
+ torch.Tensor: the processed image_embedding
124
+ """
125
+ # BxCxHxW -> BxHWxC == B x N_image_tokens x C
126
+ bs, c, h, w, d = image_embedding.shape
127
+ image_embedding = image_embedding.flatten(2).permute(0, 2, 1)
128
+ image_pe = image_pe.flatten(2).permute(0, 2, 1)
129
+
130
+ # Prepare queries
131
+ queries = point_embedding
132
+ keys = image_embedding
133
+
134
+ # Apply transformer blocks and final layernorm
135
+ for layer in self.layers:
136
+ queries, keys = layer(
137
+ queries=queries,
138
+ keys=keys,
139
+ query_pe=point_embedding,
140
+ key_pe=image_pe,
141
+ )
142
+
143
+ # Apply the final attention layer from the points to the image
144
+ q = queries + point_embedding
145
+ k = keys + image_pe
146
+ attn_out = self.final_attn_token_to_image(q=q, k=k, v=keys)
147
+ queries = queries + attn_out
148
+ queries = self.norm_final_attn(queries)
149
+
150
+ return queries, keys
151
+
152
+
153
+ class TwoWayAttentionBlock(nn.Module):
154
+ def __init__(
155
+ self,
156
+ embedding_dim: int,
157
+ num_heads: int,
158
+ mlp_dim: int = 2048,
159
+ activation: Type[nn.Module] = nn.ReLU,
160
+ attention_downsample_rate: int = 2,
161
+ skip_first_layer_pe: bool = False,
162
+ ) -> None:
163
+ """
164
+ A transformer block with four layers: (1) self-attention of sparse
165
+ inputs, (2) cross attention of sparse inputs to dense inputs, (3) mlp
166
+ block on sparse inputs, and (4) cross attention of dense inputs to sparse
167
+ inputs.
168
+
169
+ Arguments:
170
+ embedding_dim (int): the channel dimension of the embeddings
171
+ num_heads (int): the number of heads in the attention layers
172
+ mlp_dim (int): the hidden dimension of the mlp block
173
+ activation (nn.Module): the activation of the mlp block
174
+ skip_first_layer_pe (bool): skip the PE on the first layer
175
+ """
176
+ super().__init__()
177
+ self.self_attn = Attention(embedding_dim, num_heads)
178
+ self.norm1 = nn.LayerNorm(embedding_dim)
179
+
180
+ self.cross_attn_token_to_image = Attention(
181
+ embedding_dim, num_heads, downsample_rate=attention_downsample_rate
182
+ )
183
+ self.norm2 = nn.LayerNorm(embedding_dim)
184
+
185
+ self.mlp = MLPBlock(embedding_dim, mlp_dim, activation)
186
+ self.norm3 = nn.LayerNorm(embedding_dim)
187
+
188
+ self.norm4 = nn.LayerNorm(embedding_dim)
189
+ self.cross_attn_image_to_token = Attention(
190
+ embedding_dim, num_heads, downsample_rate=attention_downsample_rate
191
+ )
192
+
193
+ self.skip_first_layer_pe = skip_first_layer_pe
194
+
195
+ def forward(
196
+ self, queries: Tensor, keys: Tensor, query_pe: Tensor, key_pe: Tensor
197
+ ) -> Tuple[Tensor, Tensor]:
198
+ # Self attention block
199
+ if self.skip_first_layer_pe:
200
+ queries = self.self_attn(q=queries, k=queries, v=queries)
201
+ else:
202
+ q = queries + query_pe
203
+ attn_out = self.self_attn(q=q, k=q, v=queries)
204
+ queries = queries + attn_out
205
+ queries = self.norm1(queries)
206
+
207
+ # Cross attention block, tokens attending to image embedding
208
+ q = queries + query_pe
209
+ k = keys + key_pe
210
+ attn_out = self.cross_attn_token_to_image(q=q, k=k, v=keys)
211
+ queries = queries + attn_out
212
+ queries = self.norm2(queries)
213
+
214
+ # MLP block
215
+ mlp_out = self.mlp(queries)
216
+ queries = queries + mlp_out
217
+ queries = self.norm3(queries)
218
+
219
+ # Cross attention block, image embedding attending to tokens
220
+ q = queries + query_pe
221
+ k = keys + key_pe
222
+ attn_out = self.cross_attn_image_to_token(q=k, k=q, v=queries)
223
+ keys = keys + attn_out
224
+ keys = self.norm4(keys)
225
+
226
+ return queries, keys
227
+
228
+
229
+ class Attention(nn.Module):
230
+ """
231
+ An attention layer that allows for downscaling the size of the embedding
232
+ after projection to queries, keys, and values.
233
+ """
234
+
235
+ def __init__(
236
+ self,
237
+ embedding_dim: int,
238
+ num_heads: int,
239
+ downsample_rate: int = 1,
240
+ ) -> None:
241
+ super().__init__()
242
+ self.embedding_dim = embedding_dim
243
+ self.internal_dim = embedding_dim // downsample_rate
244
+ self.num_heads = num_heads
245
+ assert self.internal_dim % num_heads == 0, "num_heads must divide embedding_dim."
246
+
247
+ self.q_proj = nn.Linear(embedding_dim, self.internal_dim)
248
+ self.k_proj = nn.Linear(embedding_dim, self.internal_dim)
249
+ self.v_proj = nn.Linear(embedding_dim, self.internal_dim)
250
+ self.out_proj = nn.Linear(self.internal_dim, embedding_dim)
251
+
252
+ def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor:
253
+ b, n, c = x.shape
254
+ x = x.reshape(b, n, num_heads, c // num_heads)
255
+ return x.transpose(1, 2) # B x N_heads x N_tokens x C_per_head
256
+
257
+ def _recombine_heads(self, x: Tensor) -> Tensor:
258
+ b, n_heads, n_tokens, c_per_head = x.shape
259
+ x = x.transpose(1, 2)
260
+ return x.reshape(b, n_tokens, n_heads * c_per_head) # B x N_tokens x C
261
+
262
+ def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor:
263
+ # Input projections
264
+ q = self.q_proj(q)
265
+ k = self.k_proj(k)
266
+ v = self.v_proj(v)
267
+
268
+ # Separate into heads
269
+ q = self._separate_heads(q, self.num_heads)
270
+ k = self._separate_heads(k, self.num_heads)
271
+ v = self._separate_heads(v, self.num_heads)
272
+
273
+ # Attention
274
+ _, _, _, c_per_head = q.shape
275
+ attn = q @ k.permute(0, 1, 3, 2) # B x N_heads x N_tokens x N_tokens
276
+ attn = attn / math.sqrt(c_per_head)
277
+ attn = torch.softmax(attn, dim=-1)
278
+
279
+ # Get output
280
+ out = attn @ v
281
+ out = self._recombine_heads(out)
282
+ out = self.out_proj(out)
283
+
284
+ return out
285
+
286
+
287
+
288
+ # This class and its supporting functions below lightly adapted from the ViTDet backbone available at: https://github.com/facebookresearch/detectron2/blob/main/detectron2/modeling/backbone/vit.py # noqa
289
+ class ImageEncoderViT(nn.Module):
290
+ def __init__(
291
+ self,
292
+ img_size: int = 1024,
293
+ patch_size: int = 16,
294
+ in_chans: int = 1,
295
+ embed_dim: int = 768,
296
+ depth: int = 12,
297
+ num_heads: int = 12,
298
+ mlp_ratio: float = 4.0,
299
+ out_chans: int = 256,
300
+ qkv_bias: bool = True,
301
+ norm_layer: Type[nn.Module] = nn.LayerNorm,
302
+ act_layer: Type[nn.Module] = nn.GELU,
303
+ use_abs_pos: bool = True,
304
+ use_rel_pos: bool = False,
305
+ rel_pos_zero_init: bool = True,
306
+ window_size: int = 0,
307
+ global_attn_indexes: Tuple[int, ...] = (),
308
+ ) -> None:
309
+ """
310
+ Args:
311
+ img_size (int): Input image size.
312
+ patch_size (int): Patch size.
313
+ in_chans (int): Number of input image channels.
314
+ embed_dim (int): Patch embedding dimension.
315
+ depth (int): Depth of ViT.
316
+ num_heads (int): Number of attention heads in each ViT block.
317
+ mlp_ratio (float): Ratio of mlp hidden dim to embedding dim.
318
+ qkv_bias (bool): If True, add a learnable bias to query, key, value.
319
+ norm_layer (nn.Module): Normalization layer.
320
+ act_layer (nn.Module): Activation layer.
321
+ use_abs_pos (bool): If True, use absolute positional embeddings.
322
+ use_rel_pos (bool): If True, add relative positional embeddings to the attention map.
323
+ rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
324
+ window_size (int): Window size for window attention blocks.
325
+ global_attn_indexes (list): Indexes for blocks using global attention.
326
+ """
327
+ super().__init__()
328
+ self.img_size = img_size
329
+
330
+ # self.patch_embed = PatchEmbed(
331
+ # kernel_size=(patch_size, patch_size),
332
+ # stride=(patch_size, patch_size),
333
+ # in_chans=in_chans,
334
+ # embed_dim=embed_dim,
335
+ # )
336
+
337
+ self.patch_embed = PatchEmbed(
338
+ patch_size=patch_size,
339
+ in_chans=in_chans,
340
+ embed_dim=embed_dim,
341
+ spatial_dims=3,
342
+ )
343
+
344
+ self.pos_embed: Optional[nn.Parameter] = None
345
+ if use_abs_pos:
346
+ # Initialize absolute positional embedding with pretrain image size.
347
+ self.pos_embed = nn.Parameter(
348
+ torch.zeros(1, img_size // patch_size, img_size // patch_size, img_size // patch_size, embed_dim)
349
+ )
350
+
351
+ self.blocks = nn.ModuleList()
352
+ for i in range(depth):
353
+ block = Block(
354
+ dim=embed_dim,
355
+ num_heads=num_heads,
356
+ mlp_ratio=mlp_ratio,
357
+ qkv_bias=qkv_bias,
358
+ norm_layer=norm_layer,
359
+ act_layer=act_layer,
360
+ use_rel_pos=use_rel_pos,
361
+ rel_pos_zero_init=rel_pos_zero_init,
362
+ window_size=window_size if i not in global_attn_indexes else 0,
363
+ input_size=(img_size // patch_size, img_size // patch_size),
364
+ )
365
+ self.blocks.append(block)
366
+
367
+ self.neck = nn.Sequential(
368
+ nn.Conv2d(
369
+ embed_dim,
370
+ out_chans,
371
+ kernel_size=1,
372
+ bias=False,
373
+ ),
374
+ LayerNorm2d(out_chans),
375
+ nn.Conv2d(
376
+ out_chans,
377
+ out_chans,
378
+ kernel_size=3,
379
+ padding=1,
380
+ bias=False,
381
+ ),
382
+ LayerNorm2d(out_chans),
383
+ )
384
+
385
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
386
+ x = self.patch_embed(x)
387
+ print('patch embedded shape: ', x.shape) # embedded: [8, 768, 6, 6, 6]
388
+ if self.pos_embed is not None:
389
+ x = x + self.pos_embed
390
+
391
+ for blk in self.blocks:
392
+ x = blk(x)
393
+
394
+ x = self.neck(x.permute(0, 3, 1, 2))
395
+
396
+ return x
397
+
398
+
399
+ class Block(nn.Module):
400
+ """Transformer blocks with support of window attention and residual propagation blocks"""
401
+
402
+ def __init__(
403
+ self,
404
+ dim: int,
405
+ num_heads: int,
406
+ mlp_ratio: float = 4.0,
407
+ qkv_bias: bool = True,
408
+ norm_layer: Type[nn.Module] = nn.LayerNorm,
409
+ act_layer: Type[nn.Module] = nn.GELU,
410
+ use_rel_pos: bool = False,
411
+ rel_pos_zero_init: bool = True,
412
+ window_size: int = 0,
413
+ input_size: Optional[Tuple[int, int]] = None,
414
+ ) -> None:
415
+ """
416
+ Args:
417
+ dim (int): Number of input channels.
418
+ num_heads (int): Number of attention heads in each ViT block.
419
+ mlp_ratio (float): Ratio of mlp hidden dim to embedding dim.
420
+ qkv_bias (bool): If True, add a learnable bias to query, key, value.
421
+ norm_layer (nn.Module): Normalization layer.
422
+ act_layer (nn.Module): Activation layer.
423
+ use_rel_pos (bool): If True, add relative positional embeddings to the attention map.
424
+ rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
425
+ window_size (int): Window size for window attention blocks. If it equals 0, then
426
+ use global attention.
427
+ input_size (tuple(int, int) or None): Input resolution for calculating the relative
428
+ positional parameter size.
429
+ """
430
+ super().__init__()
431
+ self.norm1 = norm_layer(dim)
432
+ self.attn = Attention2(
433
+ dim,
434
+ num_heads=num_heads,
435
+ qkv_bias=qkv_bias,
436
+ use_rel_pos=use_rel_pos,
437
+ rel_pos_zero_init=rel_pos_zero_init,
438
+ input_size=input_size if window_size == 0 else (window_size, window_size),
439
+ )
440
+
441
+ self.norm2 = norm_layer(dim)
442
+ self.mlp = MLPBlock(embedding_dim=dim, mlp_dim=int(dim * mlp_ratio), act=act_layer)
443
+
444
+ self.window_size = window_size
445
+
446
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
447
+ shortcut = x
448
+ x = self.norm1(x)
449
+ # Window partition
450
+ if self.window_size > 0:
451
+ H, W = x.shape[1], x.shape[2]
452
+ x, pad_hw = window_partition(x, self.window_size)
453
+
454
+ x = self.attn(x)
455
+ # Reverse window partition
456
+ if self.window_size > 0:
457
+ x = window_unpartition(x, self.window_size, pad_hw, (H, W))
458
+
459
+ x = shortcut + x
460
+ x = x + self.mlp(self.norm2(x))
461
+
462
+ return x
463
+
464
+
465
+ class Attention2(nn.Module):
466
+ """Multi-head Attention block with relative position embeddings."""
467
+
468
+ def __init__(
469
+ self,
470
+ dim: int,
471
+ num_heads: int = 8,
472
+ qkv_bias: bool = True,
473
+ use_rel_pos: bool = False,
474
+ rel_pos_zero_init: bool = True,
475
+ input_size: Optional[Tuple[int, int]] = None,
476
+ ) -> None:
477
+ """
478
+ Args:
479
+ dim (int): Number of input channels.
480
+ num_heads (int): Number of attention heads.
481
+ qkv_bias (bool): If True, add a learnable bias to query, key, value.
482
+ rel_pos (bool): If True, add relative positional embeddings to the attention map.
483
+ rel_pos_zero_init (bool): If True, zero initialize relative positional parameters.
484
+ input_size (tuple(int, int) or None): Input resolution for calculating the relative
485
+ positional parameter size.
486
+ """
487
+ super().__init__()
488
+ self.num_heads = num_heads
489
+ head_dim = dim // num_heads
490
+ self.scale = head_dim ** -0.5
491
+
492
+ self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
493
+ self.proj = nn.Linear(dim, dim)
494
+
495
+ self.use_rel_pos = use_rel_pos
496
+ if self.use_rel_pos:
497
+ assert (
498
+ input_size is not None
499
+ ), "Input size must be provided if using relative positional encoding."
500
+ # initialize relative positional embeddings
501
+ self.rel_pos_h = nn.Parameter(torch.zeros(2 * input_size[0] - 1, head_dim))
502
+ self.rel_pos_w = nn.Parameter(torch.zeros(2 * input_size[1] - 1, head_dim))
503
+
504
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
505
+ B, H, W, _ = x.shape
506
+ # qkv with shape (3, B, nHead, H * W, C)
507
+ qkv = self.qkv(x).reshape(B, H * W, 3, self.num_heads, -1).permute(2, 0, 3, 1, 4)
508
+ # q, k, v with shape (B * nHead, H * W, C)
509
+ q, k, v = qkv.reshape(3, B * self.num_heads, H * W, -1).unbind(0)
510
+
511
+ attn = (q * self.scale) @ k.transpose(-2, -1)
512
+
513
+ if self.use_rel_pos:
514
+ attn = add_decomposed_rel_pos(attn, q, self.rel_pos_h, self.rel_pos_w, (H, W), (H, W))
515
+
516
+ attn = attn.softmax(dim=-1)
517
+ x = (attn @ v).view(B, self.num_heads, H, W, -1).permute(0, 2, 3, 1, 4).reshape(B, H, W, -1)
518
+ x = self.proj(x)
519
+
520
+ return x
521
+
522
+
523
+ def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.Tensor, Tuple[int, int]]:
524
+ """
525
+ Partition into non-overlapping windows with padding if needed.
526
+ Args:
527
+ x (tensor): input tokens with [B, H, W, C].
528
+ window_size (int): window size.
529
+
530
+ Returns:
531
+ windows: windows after partition with [B * num_windows, window_size, window_size, C].
532
+ (Hp, Wp): padded height and width before partition
533
+ """
534
+ B, H, W, C = x.shape
535
+
536
+ pad_h = (window_size - H % window_size) % window_size
537
+ pad_w = (window_size - W % window_size) % window_size
538
+ if pad_h > 0 or pad_w > 0:
539
+ x = F.pad(x, (0, 0, 0, pad_w, 0, pad_h))
540
+ Hp, Wp = H + pad_h, W + pad_w
541
+
542
+ x = x.view(B, Hp // window_size, window_size, Wp // window_size, window_size, C)
543
+ windows = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(-1, window_size, window_size, C)
544
+ return windows, (Hp, Wp)
545
+
546
+
547
+ def window_unpartition(windows: torch.Tensor, window_size: int, pad_hw: Tuple[int, int], hw: Tuple[int, int]) -> torch.Tensor:
548
+ """
549
+ Window unpartition into original sequences and removing padding.
550
+ Args:
551
+ windows (tensor): input tokens with [B * num_windows, window_size, window_size, C].
552
+ window_size (int): window size.
553
+ pad_hw (Tuple): padded height and width (Hp, Wp).
554
+ hw (Tuple): original height and width (H, W) before padding.
555
+
556
+ Returns:
557
+ x: unpartitioned sequences with [B, H, W, C].
558
+ """
559
+ Hp, Wp = pad_hw
560
+ H, W = hw
561
+ B = windows.shape[0] // (Hp * Wp // window_size // window_size)
562
+ x = windows.view(B, Hp // window_size, Wp // window_size, window_size, window_size, -1)
563
+ x = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(B, Hp, Wp, -1)
564
+
565
+ if Hp > H or Wp > W:
566
+ x = x[:, :H, :W, :].contiguous()
567
+ return x
568
+
569
+
570
+ def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torch.Tensor:
571
+ """
572
+ Get relative positional embeddings according to the relative positions of
573
+ query and key sizes.
574
+ Args:
575
+ q_size (int): size of query q.
576
+ k_size (int): size of key k.
577
+ rel_pos (Tensor): relative position embeddings (L, C).
578
+
579
+ Returns:
580
+ Extracted positional embeddings according to relative positions.
581
+ """
582
+ max_rel_dist = int(2 * max(q_size, k_size) - 1)
583
+ # Interpolate rel pos if needed.
584
+ if rel_pos.shape[0] != max_rel_dist:
585
+ # Interpolate rel pos.
586
+ rel_pos_resized = F.interpolate(
587
+ rel_pos.reshape(1, rel_pos.shape[0], -1).permute(0, 2, 1),
588
+ size=max_rel_dist,
589
+ mode="linear",
590
+ )
591
+ rel_pos_resized = rel_pos_resized.reshape(-1, max_rel_dist).permute(1, 0)
592
+ else:
593
+ rel_pos_resized = rel_pos
594
+
595
+ # Scale the coords with short length if shapes for q and k are different.
596
+ q_coords = torch.arange(q_size)[:, None] * max(k_size / q_size, 1.0)
597
+ k_coords = torch.arange(k_size)[None, :] * max(q_size / k_size, 1.0)
598
+ relative_coords = (q_coords - k_coords) + (k_size - 1) * max(q_size / k_size, 1.0)
599
+
600
+ return rel_pos_resized[relative_coords.long()]
601
+
602
+
603
+ def add_decomposed_rel_pos(
604
+ attn: torch.Tensor,
605
+ q: torch.Tensor,
606
+ rel_pos_h: torch.Tensor,
607
+ rel_pos_w: torch.Tensor,
608
+ q_size: Tuple[int, int],
609
+ k_size: Tuple[int, int],
610
+ ) -> torch.Tensor:
611
+ """
612
+ Calculate decomposed Relative Positional Embeddings from :paper:`mvitv2`.
613
+ https://github.com/facebookresearch/mvit/blob/19786631e330df9f3622e5402b4a419a263a2c80/mvit/models/attention.py # noqa B950
614
+ Args:
615
+ attn (Tensor): attention map.
616
+ q (Tensor): query q in the attention layer with shape (B, q_h * q_w, C).
617
+ rel_pos_h (Tensor): relative position embeddings (Lh, C) for height axis.
618
+ rel_pos_w (Tensor): relative position embeddings (Lw, C) for width axis.
619
+ q_size (Tuple): spatial sequence size of query q with (q_h, q_w).
620
+ k_size (Tuple): spatial sequence size of key k with (k_h, k_w).
621
+
622
+ Returns:
623
+ attn (Tensor): attention map with added relative positional embeddings.
624
+ """
625
+ q_h, q_w = q_size
626
+ k_h, k_w = k_size
627
+ Rh = get_rel_pos(q_h, k_h, rel_pos_h)
628
+ Rw = get_rel_pos(q_w, k_w, rel_pos_w)
629
+
630
+ B, _, dim = q.shape
631
+ r_q = q.reshape(B, q_h, q_w, dim)
632
+ rel_h = torch.einsum("bhwc,hkc->bhwk", r_q, Rh)
633
+ rel_w = torch.einsum("bhwc,wkc->bhwk", r_q, Rw)
634
+
635
+ attn = (
636
+ attn.view(B, q_h, q_w, k_h, k_w) + rel_h[:, :, :, :, None] + rel_w[:, :, :, None, :]
637
+ ).view(B, q_h * q_w, k_h * k_w)
638
+
639
+ return attn
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+ class IdentityMap(nn.Module):
652
+ def __init__(self):
653
+ super().__init__()
654
+
655
+ def forward(self, x, *args, **kwargs):
656
+ return x
657
+
658
+ @property
659
+ def config(self):
660
+ return {"mm_projector_type": 'identity'}
661
+
662
+
663
+ class SpatialPoolingProjector(nn.Module):
664
+ def __init__(self, image_size, patch_size, in_dim, out_dim, layer_type, layer_num, pooling_type='spatial', pooling_size=2):
665
+ super().__init__()
666
+ self.in_dim = in_dim
667
+ self.pooling_size = pooling_size
668
+
669
+ self.num_patches_pre = [img // pch for img, pch in zip(image_size, patch_size)]
670
+ self.num_patches_post = [num // pooling_size for num in self.num_patches_pre]
671
+
672
+ if layer_type == 'linear':
673
+ depth = int(layer_num)
674
+ modules = [nn.Linear(in_dim, out_dim)]
675
+ for _ in range(1, depth):
676
+ modules.append(nn.Linear(out_dim, out_dim))
677
+ self.projector = nn.Sequential(*modules)
678
+ elif layer_type == 'mlp':
679
+ depth = int(layer_num)
680
+ modules = [nn.Linear(in_dim, out_dim)]
681
+ for _ in range(1, depth):
682
+ modules.append(nn.GELU())
683
+ modules.append(nn.Linear(out_dim, out_dim))
684
+ self.projector = nn.Sequential(*modules)
685
+ else:
686
+ print("Projector error!")
687
+
688
+ self.pooling_type = pooling_type
689
+
690
+ def forward(self, x):
691
+ B = x.shape[0] # B*N*D
692
+
693
+ if self.pooling_type == 'spatial':
694
+ to_3d = Rearrange("b (p1 p2 p3) d -> b d p1 p2 p3", b=B, d=self.in_dim, p1=self.num_patches_pre[0], p2=self.num_patches_pre[1], p3=self.num_patches_pre[2])
695
+ x = to_3d(x)
696
+ x = F.avg_pool3d(x, kernel_size=self.pooling_size, stride=self.pooling_size)
697
+ to_seq = Rearrange("b d p1 p2 p3 -> b (p1 p2 p3) d", b=B, d=self.in_dim, p1=self.num_patches_post[0], p2=self.num_patches_post[1], p3=self.num_patches_post[2])
698
+ x = to_seq(x)
699
+ elif self.pooling_type == 'sequence':
700
+ x = x.permute(0, 2, 1) #b d n
701
+ x = F.avg_pool1d(x, kernel_size=self.pooling_size**3, stride=self.pooling_size**3)
702
+ x = x.permute(0, 2, 1) #b n d
703
+
704
+ x = rearrange(x, "b n d -> (b n) d")
705
+ x = self.projector(x)
706
+ x = rearrange(x, "(b n) d -> b n d", b=B)
707
+
708
+ return x
709
+
710
+ @property
711
+ def proj_out_num(self):
712
+ num = 1
713
+ for n in self.num_patches_post:
714
+ num *= n
715
+ return num
716
+
717
+
718
+ class Minigpt(nn.Module):
719
+ def __init__(self, config=None):
720
+ super(Minigpt, self).__init__()
721
+ # c*4 is the input size, and c is the output size for the linear layer
722
+ inc, ouc = config.mm_hidden_size, config.hidden_size
723
+ self.linear = nn.Linear(inc * 4, ouc)
724
+
725
+ def forward(self, x):
726
+ # x is the input tensor with shape [b, num_tokens, c]
727
+ b, num_tokens, c = x.shape
728
+
729
+ # Check if num_tokens is divisible by 4
730
+ if num_tokens % 4 != 0:
731
+ raise ValueError("num_tokens must be divisible by 4")
732
+
733
+ # Reshape x to [b, num_tokens/4, c*4]
734
+ x = x.view(b, num_tokens // 4, c * 4)
735
+
736
+ # Apply the linear transformation
737
+ x = self.linear(x)
738
+ return x
739
+
740
+
741
+ class Vanilla(nn.Module):
742
+ def __init__(self, config=None):
743
+ super(Vanilla, self).__init__()
744
+ # c*4 is the input size, and c is the output size for the linear layer
745
+ inc, ouc = config.mm_hidden_size, config.hidden_size
746
+ self.linear = nn.Linear(inc * 4, ouc)
747
+
748
+ def forward(self, x):
749
+ b, num_tokens, c = x.shape
750
+
751
+ # Check if num_tokens is divisible by 4
752
+ if num_tokens % 4 != 0:
753
+ raise ValueError("num_tokens must be divisible by 4")
754
+
755
+ # First, reshape to [b, num_tokens//4, 4, c]
756
+ x = x.view(b, num_tokens // 4, 4, c)
757
+
758
+ # Then, permute to interleave the tokens
759
+ x = x.permute(0, 1, 3, 2).contiguous()
760
+
761
+ # Finally, reshape to [b, num_tokens//4, c*4] to interleave features of 4 tokens
762
+ x = x.view(b, num_tokens // 4, c * 4)
763
+
764
+ # Apply the linear transformation
765
+ x = self.linear(x)
766
+ return x
767
+
768
+
769
+ def build_mm_projector(config, delay_load=False, **kwargs):
770
+ projector_type = getattr(config, 'mm_projector_type')
771
+
772
+ if projector_type == 'linear':
773
+ return nn.Linear(config.mm_hidden_size, config.hidden_size)
774
+
775
+
776
+ elif projector_type == 'spp':
777
+ return SpatialPoolingProjector(image_size=config.image_size,
778
+ patch_size=config.patch_size,
779
+ in_dim=config.mm_hidden_size,
780
+ out_dim=config.hidden_size,
781
+ layer_type=config.proj_layer_type,
782
+ layer_num=config.proj_layer_num,
783
+ pooling_type=config.proj_pooling_type,
784
+ pooling_size=config.proj_pooling_size)
785
+
786
+
787
+ elif projector_type == 'identity':
788
+ return IdentityMap()
789
+ else:
790
+ raise ValueError(f'Unknown projector type: {projector_type}')
791
+
792
+
793
+ class myViT(nn.Module):
794
+ """
795
+ Vision Transformer (ViT), based on: "Dosovitskiy et al.,
796
+ An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale <https://arxiv.org/abs/2010.11929>"
797
+
798
+ ViT supports Torchscript but only works for Pytorch after 1.8.
799
+ """
800
+
801
+ def __init__(
802
+ self,
803
+ in_channels: int,
804
+ img_size: Sequence[int] | int,
805
+ patch_size: Sequence[int] | int,
806
+ hidden_size: int = 768,
807
+ mlp_dim: int = 3072,
808
+ num_layers: int = 12,
809
+ num_heads: int = 12,
810
+ pos_embed: str = "conv",
811
+ classification: bool = False,
812
+ num_classes: int = 2,
813
+ dropout_rate: float = 0.0,
814
+ spatial_dims: int = 3,
815
+ post_activation="Tanh",
816
+ qkv_bias: bool = False,
817
+ save_attn: bool = False,
818
+ ) -> None:
819
+ """
820
+ Args:
821
+ in_channels (int): dimension of input channels.
822
+ img_size (Union[Sequence[int], int]): dimension of input image.
823
+ patch_size (Union[Sequence[int], int]): dimension of patch size.
824
+ hidden_size (int, optional): dimension of hidden layer. Defaults to 768.
825
+ mlp_dim (int, optional): dimension of feedforward layer. Defaults to 3072.
826
+ num_layers (int, optional): number of transformer blocks. Defaults to 12.
827
+ num_heads (int, optional): number of attention heads. Defaults to 12.
828
+ pos_embed (str, optional): position embedding layer type. Defaults to "conv".
829
+ classification (bool, optional): bool argument to determine if classification is used. Defaults to False.
830
+ num_classes (int, optional): number of classes if classification is used. Defaults to 2.
831
+ dropout_rate (float, optional): faction of the input units to drop. Defaults to 0.0.
832
+ spatial_dims (int, optional): number of spatial dimensions. Defaults to 3.
833
+ post_activation (str, optional): add a final acivation function to the classification head
834
+ when `classification` is True. Default to "Tanh" for `nn.Tanh()`.
835
+ Set to other values to remove this function.
836
+ qkv_bias (bool, optional): apply bias to the qkv linear layer in self attention block. Defaults to False.
837
+ save_attn (bool, optional): to make accessible the attention in self attention block. Defaults to False.
838
+
839
+ Examples::
840
+
841
+ # for single channel input with image size of (96,96,96), conv position embedding and segmentation backbone
842
+ >>> net = ViT(in_channels=1, img_size=(96,96,96), pos_embed='conv')
843
+
844
+ # for 3-channel with image size of (128,128,128), 24 layers and classification backbone
845
+ >>> net = ViT(in_channels=3, img_size=(128,128,128), pos_embed='conv', classification=True)
846
+
847
+ # for 3-channel with image size of (224,224), 12 layers and classification backbone
848
+ >>> net = ViT(in_channels=3, img_size=(224,224), pos_embed='conv', classification=True, spatial_dims=2)
849
+
850
+ """
851
+
852
+ super().__init__()
853
+
854
+ if not (0 <= dropout_rate <= 1):
855
+ raise ValueError("dropout_rate should be between 0 and 1.")
856
+
857
+ if hidden_size % num_heads != 0:
858
+ raise ValueError("hidden_size should be divisible by num_heads.")
859
+ self.hidden_size = hidden_size
860
+ self.classification = classification
861
+ self.patch_embedding = PatchEmbeddingBlock(
862
+ in_channels=in_channels,
863
+ img_size=img_size,
864
+ patch_size=patch_size,
865
+ hidden_size=hidden_size,
866
+ num_heads=num_heads,
867
+ pos_embed=pos_embed,
868
+ dropout_rate=dropout_rate,
869
+ spatial_dims=spatial_dims,
870
+ )
871
+ self.blocks = nn.ModuleList(
872
+ [
873
+ TransformerBlock(hidden_size, mlp_dim, num_heads, dropout_rate, qkv_bias, save_attn)
874
+ for i in range(num_layers)
875
+ ]
876
+ )
877
+ self.norm = nn.LayerNorm(hidden_size)
878
+ if self.classification:
879
+ self.cls_token = nn.Parameter(torch.zeros(1, 1, hidden_size))
880
+ # if post_activation == "Tanh":
881
+ # self.classification_head = nn.Sequential(nn.Linear(hidden_size, num_classes), nn.Tanh())
882
+ # else:
883
+ # self.classification_head = nn.Linear(hidden_size, num_classes) # type: ignore
884
+
885
+ def forward(self, x):
886
+ x = self.patch_embedding(x)
887
+ if hasattr(self, "cls_token"):
888
+ cls_token = self.cls_token.expand(x.shape[0], -1, -1)
889
+ x = torch.cat((cls_token, x), dim=1)
890
+ hidden_states_out = []
891
+ for blk in self.blocks:
892
+ x = blk(x)
893
+ hidden_states_out.append(x)
894
+ x = self.norm(x)
895
+ # if hasattr(self, "classification_head"):
896
+ # x = self.classification_head(x[:, 0])
897
+ return x, hidden_states_out
898
+
899
+
900
+ class ViT3DTower(nn.Module):
901
+ def __init__(self, config):
902
+ super().__init__()
903
+ self.config = config
904
+ self.select_layer = config.vision_select_layer
905
+ self.select_feature = config.vision_select_feature
906
+
907
+ self.vision_tower = myViT(
908
+ in_channels=self.config.image_channel,
909
+ img_size=self.config.image_size,
910
+ patch_size=self.config.patch_size,
911
+ pos_embed="perceptron",
912
+ spatial_dims=len(self.config.patch_size),
913
+ classification=True,
914
+ )
915
+
916
+ def forward(self, images):
917
+ last_feature, hidden_states = self.vision_tower(images)
918
+ if self.select_layer == -1:
919
+ image_features = last_feature
920
+ elif self.select_layer < -1:
921
+ image_features = hidden_states[self.select_feature]
922
+ else:
923
+ raise ValueError(f'Unexpected select layer: {self.select_layer}')
924
+
925
+ if self.select_feature == 'patch':
926
+ image_features = image_features[:, 1:]
927
+ elif self.select_feature == 'cls_patch':
928
+ image_features = image_features
929
+ else:
930
+ raise ValueError(f'Unexpected select feature: {self.select_feature}')
931
+
932
+ return image_features
933
+
934
+ @property
935
+ def dtype(self):
936
+ return self.vision_tower.dtype
937
+
938
+ @property
939
+ def device(self):
940
+ return self.vision_tower.device
941
+
942
+ @property
943
+ def hidden_size(self):
944
+ return self.vision_tower.hidden_size
945
+
946
+
947
+ def build_vision_tower(config, **kwargs):
948
+ vision_tower = getattr(config, 'vision_tower', None)
949
+ if 'vit3d' in vision_tower.lower():
950
+ return ViT3DTower(config, **kwargs)
951
+ else:
952
+ raise ValueError(f'Unknown vision tower: {vision_tower}')
953
+
954
+
955
+ class LamedMetaModel:
956
+ def __init__(self, config):
957
+ super(LamedMetaModel, self).__init__(config)
958
+
959
+ self.config = config
960
+
961
+ if hasattr(config, "vision_tower"):
962
+ self.vision_tower = build_vision_tower(config)
963
+ self.mm_projector = build_mm_projector(config)
964
+
965
+ def get_vision_tower(self):
966
+ vision_tower = getattr(self, 'vision_tower', None)
967
+ return vision_tower
968
+
969
+ def initialize_vision_modules(self, model_args):
970
+ self.config.image_channel = model_args.image_channel
971
+ self.config.image_size = model_args.image_size
972
+ self.config.patch_size = model_args.patch_size
973
+
974
+ self.config.vision_tower = model_args.vision_tower
975
+ self.config.vision_select_layer = model_args.vision_select_layer
976
+ self.config.vision_select_feature = model_args.vision_select_feature
977
+
978
+ self.config.mm_projector_type = model_args.mm_projector_type
979
+ self.config.proj_layer_type = model_args.proj_layer_type
980
+ self.config.proj_layer_num = model_args.proj_layer_num
981
+ self.config.proj_pooling_type = model_args.proj_pooling_type
982
+ self.config.proj_pooling_size = model_args.proj_pooling_size
983
+
984
+ # vision tower
985
+ if self.get_vision_tower() is None:
986
+ self.vision_tower = build_vision_tower(self.config)
987
+ # If you have a more robust vision encoder, try freezing the vision tower by requires_grad_(False)
988
+
989
+
990
+ if model_args.pretrain_vision_model is not None:
991
+ vision_model_weights = torch.load(model_args.pretrain_vision_model, map_location='cpu')
992
+ self.vision_tower.vision_tower.load_state_dict(vision_model_weights, strict=True)
993
+
994
+ self.config.mm_hidden_size = self.vision_tower.hidden_size
995
+
996
+ # mm_projector
997
+ if getattr(self, 'mm_projector', None) is None:
998
+ self.mm_projector = build_mm_projector(self.config)
999
+
1000
+ if model_args.pretrain_mm_mlp_adapter is not None:
1001
+ mm_projector_weights = torch.load(model_args.pretrain_mm_mlp_adapter, map_location='cpu')
1002
+ def get_w(weights, keyword):
1003
+ return {k.split(keyword + '.')[1]: v for k, v in weights.items() if keyword in k}
1004
+ self.mm_projector.load_state_dict(get_w(mm_projector_weights, 'mm_projector'), strict=True)
1005
+
1006
+
1007
+ class LamedMetaForCausalLM(ABC):
1008
+ @abstractmethod
1009
+ def get_model(self):
1010
+ pass
1011
+
1012
+ def get_vision_tower(self):
1013
+ return self.get_model().get_vision_tower()
1014
+
1015
+ def encode_images(self, images):
1016
+ image_features = self.get_model().get_vision_tower()(images)
1017
+ image_features = self.get_model().mm_projector(image_features)
1018
+ return image_features
1019
+
1020
+ def prepare_inputs_for_multimodal(self, input_ids, position_ids, attention_mask, past_key_values, labels, images):
1021
+ vision_tower = self.get_vision_tower()
1022
+ if vision_tower is None or images is None or input_ids.shape[1] == 1:
1023
+ return input_ids, position_ids, attention_mask, past_key_values, None, labels
1024
+ else:
1025
+ image_features = self.encode_images(images)
1026
+ inputs_embeds = self.get_model().embed_tokens(input_ids)
1027
+ inputs_embeds = torch.cat((inputs_embeds[:, :1, :], image_features, inputs_embeds[:, (image_features.shape[1] + 1):, :]), dim=1)
1028
+ return None, position_ids, attention_mask, past_key_values, inputs_embeds, labels
1029
+
1030
+ def initialize_vision_tokenizer(self, model_args, tokenizer):
1031
+ num_new_tokens = model_args.num_new_tokens
1032
+
1033
+ self.resize_token_embeddings(len(tokenizer))
1034
+
1035
+ if num_new_tokens > 0:
1036
+ input_embeddings = self.get_input_embeddings().weight.data
1037
+ output_embeddings = self.get_output_embeddings().weight.data
1038
+
1039
+ input_embeddings_avg = input_embeddings[:-num_new_tokens].mean(
1040
+ dim=0, keepdim=True)
1041
+ output_embeddings_avg = output_embeddings[:-num_new_tokens].mean(
1042
+ dim=0, keepdim=True)
1043
+
1044
+ input_embeddings[-num_new_tokens:] = input_embeddings_avg
1045
+ output_embeddings[-num_new_tokens:] = output_embeddings_avg
1046
+
1047
+ if model_args.tune_mm_mlp_adapter:
1048
+ for p in self.get_input_embeddings().parameters():
1049
+ p.requires_grad = True
1050
+ for p in self.get_output_embeddings().parameters():
1051
+ p.requires_grad = False
1052
+ else:
1053
+ # we add 4 new tokens
1054
+ # if new tokens need input, please train input_embeddings
1055
+ for p in self.get_input_embeddings().parameters():
1056
+ p.requires_grad = True
1057
+ # if new tokens need predict, please train output_embeddings
1058
+ for p in self.get_output_embeddings().parameters():
1059
+ p.requires_grad = True
1060
+
1061
+ if model_args.pretrain_mm_mlp_adapter:
1062
+ mm_projector_weights = torch.load(model_args.pretrain_mm_mlp_adapter, map_location='cpu')
1063
+ embed_tokens_weight = mm_projector_weights['model.embed_tokens.weight']
1064
+
1065
+ if input_embeddings.shape == embed_tokens_weight.shape:
1066
+ input_embeddings = embed_tokens_weight
1067
+ elif embed_tokens_weight.shape[0] == num_new_tokens:
1068
+ input_embeddings[-num_new_tokens:] = embed_tokens_weight
1069
+ else:
1070
+ raise ValueError(f"Unexpected embed_tokens_weight shape. Pretrained: {embed_tokens_weight.shape}. Current: {input_embeddings.shape}. Numer of new tokens: {num_new_tokens}.")
1071
+
1072
+
1073
+ class LamedLlamaModel(LamedMetaModel, LlamaModel):
1074
+ config_class = LamedConfig
1075
+ def __init__(self, config: LlamaConfig):
1076
+ super(LamedLlamaModel, self).__init__(config)
1077
+
1078
+
1079
+ class LamedLlamaForCausalLM(LamedMetaForCausalLM, LlamaForCausalLM):
1080
+ config_class = LamedConfig
1081
+
1082
+ def __init__(self, config):
1083
+ super(LlamaForCausalLM, self).__init__(config)
1084
+ self.model = LamedLlamaModel(config)
1085
+ self.pretraining_tp = config.pretraining_tp
1086
+ self.vocab_size = config.vocab_size
1087
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
1088
+
1089
+ # Initialize weights and apply final processing
1090
+ self.post_init()
1091
+
1092
+ def get_model(self):
1093
+ return self.model
1094
+
1095
+ def forward(
1096
+ self,
1097
+ images: Optional[torch.FloatTensor] = None,
1098
+ input_ids: torch.LongTensor = None,
1099
+ labels: Optional[torch.LongTensor] = None,
1100
+ attention_mask: Optional[torch.Tensor] = None,
1101
+
1102
+ position_ids: Optional[torch.LongTensor] = None,
1103
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1104
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1105
+ use_cache: Optional[bool] = None,
1106
+ output_attentions: Optional[bool] = None,
1107
+ output_hidden_states: Optional[bool] = None,
1108
+ return_dict: Optional[bool] = None,
1109
+ cache_position: Optional[torch.LongTensor] = None,
1110
+ ) -> Union[Tuple, CausalLMOutputWithPast]:
1111
+
1112
+ input_ids_pre = input_ids
1113
+
1114
+ if inputs_embeds is None:
1115
+ (
1116
+ input_ids,
1117
+ position_ids,
1118
+ attention_mask,
1119
+ past_key_values,
1120
+ inputs_embeds,
1121
+ labels
1122
+ ) = self.prepare_inputs_for_multimodal(
1123
+ input_ids,
1124
+ position_ids,
1125
+ attention_mask,
1126
+ past_key_values,
1127
+ labels,
1128
+ images,
1129
+ )
1130
+
1131
+ return super().forward(
1132
+ input_ids=input_ids,
1133
+ attention_mask=attention_mask,
1134
+ position_ids=position_ids,
1135
+ past_key_values=past_key_values,
1136
+ inputs_embeds=inputs_embeds,
1137
+ labels=labels,
1138
+ use_cache=use_cache,
1139
+ output_attentions=output_attentions,
1140
+ output_hidden_states=output_hidden_states,
1141
+ return_dict=return_dict
1142
+ )
1143
+
1144
+ @torch.no_grad()
1145
+ def generate(
1146
+ self,
1147
+ images: Optional[torch.Tensor] = None,
1148
+ inputs: Optional[torch.Tensor] = None,
1149
+ **kwargs,
1150
+ ) -> Union[GenerateOutput, torch.LongTensor, Any]:
1151
+ position_ids = kwargs.pop("position_ids", None)
1152
+ attention_mask = kwargs.pop("attention_mask", None)
1153
+ if "inputs_embeds" in kwargs:
1154
+ raise NotImplementedError("`inputs_embeds` is not supported")
1155
+
1156
+ if images is not None:
1157
+ (
1158
+ inputs,
1159
+ position_ids,
1160
+ attention_mask,
1161
+ _,
1162
+ inputs_embeds,
1163
+ _
1164
+ ) = self.prepare_inputs_for_multimodal(
1165
+ inputs,
1166
+ position_ids,
1167
+ attention_mask,
1168
+ None,
1169
+ None,
1170
+ images,
1171
+ )
1172
+ else:
1173
+ inputs_embeds = self.get_model().embed_tokens(inputs)
1174
+
1175
+ return super().generate(
1176
+ position_ids=position_ids,
1177
+ attention_mask=attention_mask,
1178
+ inputs_embeds=inputs_embeds,
1179
+ **kwargs
1180
+ )
1181
+
1182
+
1183
+ def prepare_inputs_for_generation(self, input_ids, past_key_values=None, inputs_embeds=None, **kwargs):
1184
+ images = kwargs.pop("images", None)
1185
+ inputs = super().prepare_inputs_for_generation(input_ids, past_key_values=past_key_values, inputs_embeds=inputs_embeds, **kwargs)
1186
+ if images is not None:
1187
+ inputs['images'] = images
1188
+ return inputs
special_tokens_map.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "<im_patch>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ }
10
+ ],
11
+ "bos_token": {
12
+ "content": "<|begin_of_text|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "eos_token": {
19
+ "content": "<|eot_id|>",
20
+ "lstrip": false,
21
+ "normalized": false,
22
+ "rstrip": false,
23
+ "single_word": false
24
+ },
25
+ "pad_token": "<|eot_id|>"
26
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,2075 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "128000": {
4
+ "content": "<|begin_of_text|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "128001": {
12
+ "content": "<|end_of_text|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "128002": {
20
+ "content": "<|reserved_special_token_0|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "128003": {
28
+ "content": "<|reserved_special_token_1|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128004": {
36
+ "content": "<|finetune_right_pad_id|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "128005": {
44
+ "content": "<|reserved_special_token_2|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "128006": {
52
+ "content": "<|start_header_id|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "128007": {
60
+ "content": "<|end_header_id|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "128008": {
68
+ "content": "<|eom_id|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "128009": {
76
+ "content": "<|eot_id|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "128010": {
84
+ "content": "<|python_tag|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "128011": {
92
+ "content": "<|reserved_special_token_3|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "128012": {
100
+ "content": "<|reserved_special_token_4|>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "128013": {
108
+ "content": "<|reserved_special_token_5|>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "128014": {
116
+ "content": "<|reserved_special_token_6|>",
117
+ "lstrip": false,
118
+ "normalized": false,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": true
122
+ },
123
+ "128015": {
124
+ "content": "<|reserved_special_token_7|>",
125
+ "lstrip": false,
126
+ "normalized": false,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": true
130
+ },
131
+ "128016": {
132
+ "content": "<|reserved_special_token_8|>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": true
138
+ },
139
+ "128017": {
140
+ "content": "<|reserved_special_token_9|>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": true
146
+ },
147
+ "128018": {
148
+ "content": "<|reserved_special_token_10|>",
149
+ "lstrip": false,
150
+ "normalized": false,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": true
154
+ },
155
+ "128019": {
156
+ "content": "<|reserved_special_token_11|>",
157
+ "lstrip": false,
158
+ "normalized": false,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": true
162
+ },
163
+ "128020": {
164
+ "content": "<|reserved_special_token_12|>",
165
+ "lstrip": false,
166
+ "normalized": false,
167
+ "rstrip": false,
168
+ "single_word": false,
169
+ "special": true
170
+ },
171
+ "128021": {
172
+ "content": "<|reserved_special_token_13|>",
173
+ "lstrip": false,
174
+ "normalized": false,
175
+ "rstrip": false,
176
+ "single_word": false,
177
+ "special": true
178
+ },
179
+ "128022": {
180
+ "content": "<|reserved_special_token_14|>",
181
+ "lstrip": false,
182
+ "normalized": false,
183
+ "rstrip": false,
184
+ "single_word": false,
185
+ "special": true
186
+ },
187
+ "128023": {
188
+ "content": "<|reserved_special_token_15|>",
189
+ "lstrip": false,
190
+ "normalized": false,
191
+ "rstrip": false,
192
+ "single_word": false,
193
+ "special": true
194
+ },
195
+ "128024": {
196
+ "content": "<|reserved_special_token_16|>",
197
+ "lstrip": false,
198
+ "normalized": false,
199
+ "rstrip": false,
200
+ "single_word": false,
201
+ "special": true
202
+ },
203
+ "128025": {
204
+ "content": "<|reserved_special_token_17|>",
205
+ "lstrip": false,
206
+ "normalized": false,
207
+ "rstrip": false,
208
+ "single_word": false,
209
+ "special": true
210
+ },
211
+ "128026": {
212
+ "content": "<|reserved_special_token_18|>",
213
+ "lstrip": false,
214
+ "normalized": false,
215
+ "rstrip": false,
216
+ "single_word": false,
217
+ "special": true
218
+ },
219
+ "128027": {
220
+ "content": "<|reserved_special_token_19|>",
221
+ "lstrip": false,
222
+ "normalized": false,
223
+ "rstrip": false,
224
+ "single_word": false,
225
+ "special": true
226
+ },
227
+ "128028": {
228
+ "content": "<|reserved_special_token_20|>",
229
+ "lstrip": false,
230
+ "normalized": false,
231
+ "rstrip": false,
232
+ "single_word": false,
233
+ "special": true
234
+ },
235
+ "128029": {
236
+ "content": "<|reserved_special_token_21|>",
237
+ "lstrip": false,
238
+ "normalized": false,
239
+ "rstrip": false,
240
+ "single_word": false,
241
+ "special": true
242
+ },
243
+ "128030": {
244
+ "content": "<|reserved_special_token_22|>",
245
+ "lstrip": false,
246
+ "normalized": false,
247
+ "rstrip": false,
248
+ "single_word": false,
249
+ "special": true
250
+ },
251
+ "128031": {
252
+ "content": "<|reserved_special_token_23|>",
253
+ "lstrip": false,
254
+ "normalized": false,
255
+ "rstrip": false,
256
+ "single_word": false,
257
+ "special": true
258
+ },
259
+ "128032": {
260
+ "content": "<|reserved_special_token_24|>",
261
+ "lstrip": false,
262
+ "normalized": false,
263
+ "rstrip": false,
264
+ "single_word": false,
265
+ "special": true
266
+ },
267
+ "128033": {
268
+ "content": "<|reserved_special_token_25|>",
269
+ "lstrip": false,
270
+ "normalized": false,
271
+ "rstrip": false,
272
+ "single_word": false,
273
+ "special": true
274
+ },
275
+ "128034": {
276
+ "content": "<|reserved_special_token_26|>",
277
+ "lstrip": false,
278
+ "normalized": false,
279
+ "rstrip": false,
280
+ "single_word": false,
281
+ "special": true
282
+ },
283
+ "128035": {
284
+ "content": "<|reserved_special_token_27|>",
285
+ "lstrip": false,
286
+ "normalized": false,
287
+ "rstrip": false,
288
+ "single_word": false,
289
+ "special": true
290
+ },
291
+ "128036": {
292
+ "content": "<|reserved_special_token_28|>",
293
+ "lstrip": false,
294
+ "normalized": false,
295
+ "rstrip": false,
296
+ "single_word": false,
297
+ "special": true
298
+ },
299
+ "128037": {
300
+ "content": "<|reserved_special_token_29|>",
301
+ "lstrip": false,
302
+ "normalized": false,
303
+ "rstrip": false,
304
+ "single_word": false,
305
+ "special": true
306
+ },
307
+ "128038": {
308
+ "content": "<|reserved_special_token_30|>",
309
+ "lstrip": false,
310
+ "normalized": false,
311
+ "rstrip": false,
312
+ "single_word": false,
313
+ "special": true
314
+ },
315
+ "128039": {
316
+ "content": "<|reserved_special_token_31|>",
317
+ "lstrip": false,
318
+ "normalized": false,
319
+ "rstrip": false,
320
+ "single_word": false,
321
+ "special": true
322
+ },
323
+ "128040": {
324
+ "content": "<|reserved_special_token_32|>",
325
+ "lstrip": false,
326
+ "normalized": false,
327
+ "rstrip": false,
328
+ "single_word": false,
329
+ "special": true
330
+ },
331
+ "128041": {
332
+ "content": "<|reserved_special_token_33|>",
333
+ "lstrip": false,
334
+ "normalized": false,
335
+ "rstrip": false,
336
+ "single_word": false,
337
+ "special": true
338
+ },
339
+ "128042": {
340
+ "content": "<|reserved_special_token_34|>",
341
+ "lstrip": false,
342
+ "normalized": false,
343
+ "rstrip": false,
344
+ "single_word": false,
345
+ "special": true
346
+ },
347
+ "128043": {
348
+ "content": "<|reserved_special_token_35|>",
349
+ "lstrip": false,
350
+ "normalized": false,
351
+ "rstrip": false,
352
+ "single_word": false,
353
+ "special": true
354
+ },
355
+ "128044": {
356
+ "content": "<|reserved_special_token_36|>",
357
+ "lstrip": false,
358
+ "normalized": false,
359
+ "rstrip": false,
360
+ "single_word": false,
361
+ "special": true
362
+ },
363
+ "128045": {
364
+ "content": "<|reserved_special_token_37|>",
365
+ "lstrip": false,
366
+ "normalized": false,
367
+ "rstrip": false,
368
+ "single_word": false,
369
+ "special": true
370
+ },
371
+ "128046": {
372
+ "content": "<|reserved_special_token_38|>",
373
+ "lstrip": false,
374
+ "normalized": false,
375
+ "rstrip": false,
376
+ "single_word": false,
377
+ "special": true
378
+ },
379
+ "128047": {
380
+ "content": "<|reserved_special_token_39|>",
381
+ "lstrip": false,
382
+ "normalized": false,
383
+ "rstrip": false,
384
+ "single_word": false,
385
+ "special": true
386
+ },
387
+ "128048": {
388
+ "content": "<|reserved_special_token_40|>",
389
+ "lstrip": false,
390
+ "normalized": false,
391
+ "rstrip": false,
392
+ "single_word": false,
393
+ "special": true
394
+ },
395
+ "128049": {
396
+ "content": "<|reserved_special_token_41|>",
397
+ "lstrip": false,
398
+ "normalized": false,
399
+ "rstrip": false,
400
+ "single_word": false,
401
+ "special": true
402
+ },
403
+ "128050": {
404
+ "content": "<|reserved_special_token_42|>",
405
+ "lstrip": false,
406
+ "normalized": false,
407
+ "rstrip": false,
408
+ "single_word": false,
409
+ "special": true
410
+ },
411
+ "128051": {
412
+ "content": "<|reserved_special_token_43|>",
413
+ "lstrip": false,
414
+ "normalized": false,
415
+ "rstrip": false,
416
+ "single_word": false,
417
+ "special": true
418
+ },
419
+ "128052": {
420
+ "content": "<|reserved_special_token_44|>",
421
+ "lstrip": false,
422
+ "normalized": false,
423
+ "rstrip": false,
424
+ "single_word": false,
425
+ "special": true
426
+ },
427
+ "128053": {
428
+ "content": "<|reserved_special_token_45|>",
429
+ "lstrip": false,
430
+ "normalized": false,
431
+ "rstrip": false,
432
+ "single_word": false,
433
+ "special": true
434
+ },
435
+ "128054": {
436
+ "content": "<|reserved_special_token_46|>",
437
+ "lstrip": false,
438
+ "normalized": false,
439
+ "rstrip": false,
440
+ "single_word": false,
441
+ "special": true
442
+ },
443
+ "128055": {
444
+ "content": "<|reserved_special_token_47|>",
445
+ "lstrip": false,
446
+ "normalized": false,
447
+ "rstrip": false,
448
+ "single_word": false,
449
+ "special": true
450
+ },
451
+ "128056": {
452
+ "content": "<|reserved_special_token_48|>",
453
+ "lstrip": false,
454
+ "normalized": false,
455
+ "rstrip": false,
456
+ "single_word": false,
457
+ "special": true
458
+ },
459
+ "128057": {
460
+ "content": "<|reserved_special_token_49|>",
461
+ "lstrip": false,
462
+ "normalized": false,
463
+ "rstrip": false,
464
+ "single_word": false,
465
+ "special": true
466
+ },
467
+ "128058": {
468
+ "content": "<|reserved_special_token_50|>",
469
+ "lstrip": false,
470
+ "normalized": false,
471
+ "rstrip": false,
472
+ "single_word": false,
473
+ "special": true
474
+ },
475
+ "128059": {
476
+ "content": "<|reserved_special_token_51|>",
477
+ "lstrip": false,
478
+ "normalized": false,
479
+ "rstrip": false,
480
+ "single_word": false,
481
+ "special": true
482
+ },
483
+ "128060": {
484
+ "content": "<|reserved_special_token_52|>",
485
+ "lstrip": false,
486
+ "normalized": false,
487
+ "rstrip": false,
488
+ "single_word": false,
489
+ "special": true
490
+ },
491
+ "128061": {
492
+ "content": "<|reserved_special_token_53|>",
493
+ "lstrip": false,
494
+ "normalized": false,
495
+ "rstrip": false,
496
+ "single_word": false,
497
+ "special": true
498
+ },
499
+ "128062": {
500
+ "content": "<|reserved_special_token_54|>",
501
+ "lstrip": false,
502
+ "normalized": false,
503
+ "rstrip": false,
504
+ "single_word": false,
505
+ "special": true
506
+ },
507
+ "128063": {
508
+ "content": "<|reserved_special_token_55|>",
509
+ "lstrip": false,
510
+ "normalized": false,
511
+ "rstrip": false,
512
+ "single_word": false,
513
+ "special": true
514
+ },
515
+ "128064": {
516
+ "content": "<|reserved_special_token_56|>",
517
+ "lstrip": false,
518
+ "normalized": false,
519
+ "rstrip": false,
520
+ "single_word": false,
521
+ "special": true
522
+ },
523
+ "128065": {
524
+ "content": "<|reserved_special_token_57|>",
525
+ "lstrip": false,
526
+ "normalized": false,
527
+ "rstrip": false,
528
+ "single_word": false,
529
+ "special": true
530
+ },
531
+ "128066": {
532
+ "content": "<|reserved_special_token_58|>",
533
+ "lstrip": false,
534
+ "normalized": false,
535
+ "rstrip": false,
536
+ "single_word": false,
537
+ "special": true
538
+ },
539
+ "128067": {
540
+ "content": "<|reserved_special_token_59|>",
541
+ "lstrip": false,
542
+ "normalized": false,
543
+ "rstrip": false,
544
+ "single_word": false,
545
+ "special": true
546
+ },
547
+ "128068": {
548
+ "content": "<|reserved_special_token_60|>",
549
+ "lstrip": false,
550
+ "normalized": false,
551
+ "rstrip": false,
552
+ "single_word": false,
553
+ "special": true
554
+ },
555
+ "128069": {
556
+ "content": "<|reserved_special_token_61|>",
557
+ "lstrip": false,
558
+ "normalized": false,
559
+ "rstrip": false,
560
+ "single_word": false,
561
+ "special": true
562
+ },
563
+ "128070": {
564
+ "content": "<|reserved_special_token_62|>",
565
+ "lstrip": false,
566
+ "normalized": false,
567
+ "rstrip": false,
568
+ "single_word": false,
569
+ "special": true
570
+ },
571
+ "128071": {
572
+ "content": "<|reserved_special_token_63|>",
573
+ "lstrip": false,
574
+ "normalized": false,
575
+ "rstrip": false,
576
+ "single_word": false,
577
+ "special": true
578
+ },
579
+ "128072": {
580
+ "content": "<|reserved_special_token_64|>",
581
+ "lstrip": false,
582
+ "normalized": false,
583
+ "rstrip": false,
584
+ "single_word": false,
585
+ "special": true
586
+ },
587
+ "128073": {
588
+ "content": "<|reserved_special_token_65|>",
589
+ "lstrip": false,
590
+ "normalized": false,
591
+ "rstrip": false,
592
+ "single_word": false,
593
+ "special": true
594
+ },
595
+ "128074": {
596
+ "content": "<|reserved_special_token_66|>",
597
+ "lstrip": false,
598
+ "normalized": false,
599
+ "rstrip": false,
600
+ "single_word": false,
601
+ "special": true
602
+ },
603
+ "128075": {
604
+ "content": "<|reserved_special_token_67|>",
605
+ "lstrip": false,
606
+ "normalized": false,
607
+ "rstrip": false,
608
+ "single_word": false,
609
+ "special": true
610
+ },
611
+ "128076": {
612
+ "content": "<|reserved_special_token_68|>",
613
+ "lstrip": false,
614
+ "normalized": false,
615
+ "rstrip": false,
616
+ "single_word": false,
617
+ "special": true
618
+ },
619
+ "128077": {
620
+ "content": "<|reserved_special_token_69|>",
621
+ "lstrip": false,
622
+ "normalized": false,
623
+ "rstrip": false,
624
+ "single_word": false,
625
+ "special": true
626
+ },
627
+ "128078": {
628
+ "content": "<|reserved_special_token_70|>",
629
+ "lstrip": false,
630
+ "normalized": false,
631
+ "rstrip": false,
632
+ "single_word": false,
633
+ "special": true
634
+ },
635
+ "128079": {
636
+ "content": "<|reserved_special_token_71|>",
637
+ "lstrip": false,
638
+ "normalized": false,
639
+ "rstrip": false,
640
+ "single_word": false,
641
+ "special": true
642
+ },
643
+ "128080": {
644
+ "content": "<|reserved_special_token_72|>",
645
+ "lstrip": false,
646
+ "normalized": false,
647
+ "rstrip": false,
648
+ "single_word": false,
649
+ "special": true
650
+ },
651
+ "128081": {
652
+ "content": "<|reserved_special_token_73|>",
653
+ "lstrip": false,
654
+ "normalized": false,
655
+ "rstrip": false,
656
+ "single_word": false,
657
+ "special": true
658
+ },
659
+ "128082": {
660
+ "content": "<|reserved_special_token_74|>",
661
+ "lstrip": false,
662
+ "normalized": false,
663
+ "rstrip": false,
664
+ "single_word": false,
665
+ "special": true
666
+ },
667
+ "128083": {
668
+ "content": "<|reserved_special_token_75|>",
669
+ "lstrip": false,
670
+ "normalized": false,
671
+ "rstrip": false,
672
+ "single_word": false,
673
+ "special": true
674
+ },
675
+ "128084": {
676
+ "content": "<|reserved_special_token_76|>",
677
+ "lstrip": false,
678
+ "normalized": false,
679
+ "rstrip": false,
680
+ "single_word": false,
681
+ "special": true
682
+ },
683
+ "128085": {
684
+ "content": "<|reserved_special_token_77|>",
685
+ "lstrip": false,
686
+ "normalized": false,
687
+ "rstrip": false,
688
+ "single_word": false,
689
+ "special": true
690
+ },
691
+ "128086": {
692
+ "content": "<|reserved_special_token_78|>",
693
+ "lstrip": false,
694
+ "normalized": false,
695
+ "rstrip": false,
696
+ "single_word": false,
697
+ "special": true
698
+ },
699
+ "128087": {
700
+ "content": "<|reserved_special_token_79|>",
701
+ "lstrip": false,
702
+ "normalized": false,
703
+ "rstrip": false,
704
+ "single_word": false,
705
+ "special": true
706
+ },
707
+ "128088": {
708
+ "content": "<|reserved_special_token_80|>",
709
+ "lstrip": false,
710
+ "normalized": false,
711
+ "rstrip": false,
712
+ "single_word": false,
713
+ "special": true
714
+ },
715
+ "128089": {
716
+ "content": "<|reserved_special_token_81|>",
717
+ "lstrip": false,
718
+ "normalized": false,
719
+ "rstrip": false,
720
+ "single_word": false,
721
+ "special": true
722
+ },
723
+ "128090": {
724
+ "content": "<|reserved_special_token_82|>",
725
+ "lstrip": false,
726
+ "normalized": false,
727
+ "rstrip": false,
728
+ "single_word": false,
729
+ "special": true
730
+ },
731
+ "128091": {
732
+ "content": "<|reserved_special_token_83|>",
733
+ "lstrip": false,
734
+ "normalized": false,
735
+ "rstrip": false,
736
+ "single_word": false,
737
+ "special": true
738
+ },
739
+ "128092": {
740
+ "content": "<|reserved_special_token_84|>",
741
+ "lstrip": false,
742
+ "normalized": false,
743
+ "rstrip": false,
744
+ "single_word": false,
745
+ "special": true
746
+ },
747
+ "128093": {
748
+ "content": "<|reserved_special_token_85|>",
749
+ "lstrip": false,
750
+ "normalized": false,
751
+ "rstrip": false,
752
+ "single_word": false,
753
+ "special": true
754
+ },
755
+ "128094": {
756
+ "content": "<|reserved_special_token_86|>",
757
+ "lstrip": false,
758
+ "normalized": false,
759
+ "rstrip": false,
760
+ "single_word": false,
761
+ "special": true
762
+ },
763
+ "128095": {
764
+ "content": "<|reserved_special_token_87|>",
765
+ "lstrip": false,
766
+ "normalized": false,
767
+ "rstrip": false,
768
+ "single_word": false,
769
+ "special": true
770
+ },
771
+ "128096": {
772
+ "content": "<|reserved_special_token_88|>",
773
+ "lstrip": false,
774
+ "normalized": false,
775
+ "rstrip": false,
776
+ "single_word": false,
777
+ "special": true
778
+ },
779
+ "128097": {
780
+ "content": "<|reserved_special_token_89|>",
781
+ "lstrip": false,
782
+ "normalized": false,
783
+ "rstrip": false,
784
+ "single_word": false,
785
+ "special": true
786
+ },
787
+ "128098": {
788
+ "content": "<|reserved_special_token_90|>",
789
+ "lstrip": false,
790
+ "normalized": false,
791
+ "rstrip": false,
792
+ "single_word": false,
793
+ "special": true
794
+ },
795
+ "128099": {
796
+ "content": "<|reserved_special_token_91|>",
797
+ "lstrip": false,
798
+ "normalized": false,
799
+ "rstrip": false,
800
+ "single_word": false,
801
+ "special": true
802
+ },
803
+ "128100": {
804
+ "content": "<|reserved_special_token_92|>",
805
+ "lstrip": false,
806
+ "normalized": false,
807
+ "rstrip": false,
808
+ "single_word": false,
809
+ "special": true
810
+ },
811
+ "128101": {
812
+ "content": "<|reserved_special_token_93|>",
813
+ "lstrip": false,
814
+ "normalized": false,
815
+ "rstrip": false,
816
+ "single_word": false,
817
+ "special": true
818
+ },
819
+ "128102": {
820
+ "content": "<|reserved_special_token_94|>",
821
+ "lstrip": false,
822
+ "normalized": false,
823
+ "rstrip": false,
824
+ "single_word": false,
825
+ "special": true
826
+ },
827
+ "128103": {
828
+ "content": "<|reserved_special_token_95|>",
829
+ "lstrip": false,
830
+ "normalized": false,
831
+ "rstrip": false,
832
+ "single_word": false,
833
+ "special": true
834
+ },
835
+ "128104": {
836
+ "content": "<|reserved_special_token_96|>",
837
+ "lstrip": false,
838
+ "normalized": false,
839
+ "rstrip": false,
840
+ "single_word": false,
841
+ "special": true
842
+ },
843
+ "128105": {
844
+ "content": "<|reserved_special_token_97|>",
845
+ "lstrip": false,
846
+ "normalized": false,
847
+ "rstrip": false,
848
+ "single_word": false,
849
+ "special": true
850
+ },
851
+ "128106": {
852
+ "content": "<|reserved_special_token_98|>",
853
+ "lstrip": false,
854
+ "normalized": false,
855
+ "rstrip": false,
856
+ "single_word": false,
857
+ "special": true
858
+ },
859
+ "128107": {
860
+ "content": "<|reserved_special_token_99|>",
861
+ "lstrip": false,
862
+ "normalized": false,
863
+ "rstrip": false,
864
+ "single_word": false,
865
+ "special": true
866
+ },
867
+ "128108": {
868
+ "content": "<|reserved_special_token_100|>",
869
+ "lstrip": false,
870
+ "normalized": false,
871
+ "rstrip": false,
872
+ "single_word": false,
873
+ "special": true
874
+ },
875
+ "128109": {
876
+ "content": "<|reserved_special_token_101|>",
877
+ "lstrip": false,
878
+ "normalized": false,
879
+ "rstrip": false,
880
+ "single_word": false,
881
+ "special": true
882
+ },
883
+ "128110": {
884
+ "content": "<|reserved_special_token_102|>",
885
+ "lstrip": false,
886
+ "normalized": false,
887
+ "rstrip": false,
888
+ "single_word": false,
889
+ "special": true
890
+ },
891
+ "128111": {
892
+ "content": "<|reserved_special_token_103|>",
893
+ "lstrip": false,
894
+ "normalized": false,
895
+ "rstrip": false,
896
+ "single_word": false,
897
+ "special": true
898
+ },
899
+ "128112": {
900
+ "content": "<|reserved_special_token_104|>",
901
+ "lstrip": false,
902
+ "normalized": false,
903
+ "rstrip": false,
904
+ "single_word": false,
905
+ "special": true
906
+ },
907
+ "128113": {
908
+ "content": "<|reserved_special_token_105|>",
909
+ "lstrip": false,
910
+ "normalized": false,
911
+ "rstrip": false,
912
+ "single_word": false,
913
+ "special": true
914
+ },
915
+ "128114": {
916
+ "content": "<|reserved_special_token_106|>",
917
+ "lstrip": false,
918
+ "normalized": false,
919
+ "rstrip": false,
920
+ "single_word": false,
921
+ "special": true
922
+ },
923
+ "128115": {
924
+ "content": "<|reserved_special_token_107|>",
925
+ "lstrip": false,
926
+ "normalized": false,
927
+ "rstrip": false,
928
+ "single_word": false,
929
+ "special": true
930
+ },
931
+ "128116": {
932
+ "content": "<|reserved_special_token_108|>",
933
+ "lstrip": false,
934
+ "normalized": false,
935
+ "rstrip": false,
936
+ "single_word": false,
937
+ "special": true
938
+ },
939
+ "128117": {
940
+ "content": "<|reserved_special_token_109|>",
941
+ "lstrip": false,
942
+ "normalized": false,
943
+ "rstrip": false,
944
+ "single_word": false,
945
+ "special": true
946
+ },
947
+ "128118": {
948
+ "content": "<|reserved_special_token_110|>",
949
+ "lstrip": false,
950
+ "normalized": false,
951
+ "rstrip": false,
952
+ "single_word": false,
953
+ "special": true
954
+ },
955
+ "128119": {
956
+ "content": "<|reserved_special_token_111|>",
957
+ "lstrip": false,
958
+ "normalized": false,
959
+ "rstrip": false,
960
+ "single_word": false,
961
+ "special": true
962
+ },
963
+ "128120": {
964
+ "content": "<|reserved_special_token_112|>",
965
+ "lstrip": false,
966
+ "normalized": false,
967
+ "rstrip": false,
968
+ "single_word": false,
969
+ "special": true
970
+ },
971
+ "128121": {
972
+ "content": "<|reserved_special_token_113|>",
973
+ "lstrip": false,
974
+ "normalized": false,
975
+ "rstrip": false,
976
+ "single_word": false,
977
+ "special": true
978
+ },
979
+ "128122": {
980
+ "content": "<|reserved_special_token_114|>",
981
+ "lstrip": false,
982
+ "normalized": false,
983
+ "rstrip": false,
984
+ "single_word": false,
985
+ "special": true
986
+ },
987
+ "128123": {
988
+ "content": "<|reserved_special_token_115|>",
989
+ "lstrip": false,
990
+ "normalized": false,
991
+ "rstrip": false,
992
+ "single_word": false,
993
+ "special": true
994
+ },
995
+ "128124": {
996
+ "content": "<|reserved_special_token_116|>",
997
+ "lstrip": false,
998
+ "normalized": false,
999
+ "rstrip": false,
1000
+ "single_word": false,
1001
+ "special": true
1002
+ },
1003
+ "128125": {
1004
+ "content": "<|reserved_special_token_117|>",
1005
+ "lstrip": false,
1006
+ "normalized": false,
1007
+ "rstrip": false,
1008
+ "single_word": false,
1009
+ "special": true
1010
+ },
1011
+ "128126": {
1012
+ "content": "<|reserved_special_token_118|>",
1013
+ "lstrip": false,
1014
+ "normalized": false,
1015
+ "rstrip": false,
1016
+ "single_word": false,
1017
+ "special": true
1018
+ },
1019
+ "128127": {
1020
+ "content": "<|reserved_special_token_119|>",
1021
+ "lstrip": false,
1022
+ "normalized": false,
1023
+ "rstrip": false,
1024
+ "single_word": false,
1025
+ "special": true
1026
+ },
1027
+ "128128": {
1028
+ "content": "<|reserved_special_token_120|>",
1029
+ "lstrip": false,
1030
+ "normalized": false,
1031
+ "rstrip": false,
1032
+ "single_word": false,
1033
+ "special": true
1034
+ },
1035
+ "128129": {
1036
+ "content": "<|reserved_special_token_121|>",
1037
+ "lstrip": false,
1038
+ "normalized": false,
1039
+ "rstrip": false,
1040
+ "single_word": false,
1041
+ "special": true
1042
+ },
1043
+ "128130": {
1044
+ "content": "<|reserved_special_token_122|>",
1045
+ "lstrip": false,
1046
+ "normalized": false,
1047
+ "rstrip": false,
1048
+ "single_word": false,
1049
+ "special": true
1050
+ },
1051
+ "128131": {
1052
+ "content": "<|reserved_special_token_123|>",
1053
+ "lstrip": false,
1054
+ "normalized": false,
1055
+ "rstrip": false,
1056
+ "single_word": false,
1057
+ "special": true
1058
+ },
1059
+ "128132": {
1060
+ "content": "<|reserved_special_token_124|>",
1061
+ "lstrip": false,
1062
+ "normalized": false,
1063
+ "rstrip": false,
1064
+ "single_word": false,
1065
+ "special": true
1066
+ },
1067
+ "128133": {
1068
+ "content": "<|reserved_special_token_125|>",
1069
+ "lstrip": false,
1070
+ "normalized": false,
1071
+ "rstrip": false,
1072
+ "single_word": false,
1073
+ "special": true
1074
+ },
1075
+ "128134": {
1076
+ "content": "<|reserved_special_token_126|>",
1077
+ "lstrip": false,
1078
+ "normalized": false,
1079
+ "rstrip": false,
1080
+ "single_word": false,
1081
+ "special": true
1082
+ },
1083
+ "128135": {
1084
+ "content": "<|reserved_special_token_127|>",
1085
+ "lstrip": false,
1086
+ "normalized": false,
1087
+ "rstrip": false,
1088
+ "single_word": false,
1089
+ "special": true
1090
+ },
1091
+ "128136": {
1092
+ "content": "<|reserved_special_token_128|>",
1093
+ "lstrip": false,
1094
+ "normalized": false,
1095
+ "rstrip": false,
1096
+ "single_word": false,
1097
+ "special": true
1098
+ },
1099
+ "128137": {
1100
+ "content": "<|reserved_special_token_129|>",
1101
+ "lstrip": false,
1102
+ "normalized": false,
1103
+ "rstrip": false,
1104
+ "single_word": false,
1105
+ "special": true
1106
+ },
1107
+ "128138": {
1108
+ "content": "<|reserved_special_token_130|>",
1109
+ "lstrip": false,
1110
+ "normalized": false,
1111
+ "rstrip": false,
1112
+ "single_word": false,
1113
+ "special": true
1114
+ },
1115
+ "128139": {
1116
+ "content": "<|reserved_special_token_131|>",
1117
+ "lstrip": false,
1118
+ "normalized": false,
1119
+ "rstrip": false,
1120
+ "single_word": false,
1121
+ "special": true
1122
+ },
1123
+ "128140": {
1124
+ "content": "<|reserved_special_token_132|>",
1125
+ "lstrip": false,
1126
+ "normalized": false,
1127
+ "rstrip": false,
1128
+ "single_word": false,
1129
+ "special": true
1130
+ },
1131
+ "128141": {
1132
+ "content": "<|reserved_special_token_133|>",
1133
+ "lstrip": false,
1134
+ "normalized": false,
1135
+ "rstrip": false,
1136
+ "single_word": false,
1137
+ "special": true
1138
+ },
1139
+ "128142": {
1140
+ "content": "<|reserved_special_token_134|>",
1141
+ "lstrip": false,
1142
+ "normalized": false,
1143
+ "rstrip": false,
1144
+ "single_word": false,
1145
+ "special": true
1146
+ },
1147
+ "128143": {
1148
+ "content": "<|reserved_special_token_135|>",
1149
+ "lstrip": false,
1150
+ "normalized": false,
1151
+ "rstrip": false,
1152
+ "single_word": false,
1153
+ "special": true
1154
+ },
1155
+ "128144": {
1156
+ "content": "<|reserved_special_token_136|>",
1157
+ "lstrip": false,
1158
+ "normalized": false,
1159
+ "rstrip": false,
1160
+ "single_word": false,
1161
+ "special": true
1162
+ },
1163
+ "128145": {
1164
+ "content": "<|reserved_special_token_137|>",
1165
+ "lstrip": false,
1166
+ "normalized": false,
1167
+ "rstrip": false,
1168
+ "single_word": false,
1169
+ "special": true
1170
+ },
1171
+ "128146": {
1172
+ "content": "<|reserved_special_token_138|>",
1173
+ "lstrip": false,
1174
+ "normalized": false,
1175
+ "rstrip": false,
1176
+ "single_word": false,
1177
+ "special": true
1178
+ },
1179
+ "128147": {
1180
+ "content": "<|reserved_special_token_139|>",
1181
+ "lstrip": false,
1182
+ "normalized": false,
1183
+ "rstrip": false,
1184
+ "single_word": false,
1185
+ "special": true
1186
+ },
1187
+ "128148": {
1188
+ "content": "<|reserved_special_token_140|>",
1189
+ "lstrip": false,
1190
+ "normalized": false,
1191
+ "rstrip": false,
1192
+ "single_word": false,
1193
+ "special": true
1194
+ },
1195
+ "128149": {
1196
+ "content": "<|reserved_special_token_141|>",
1197
+ "lstrip": false,
1198
+ "normalized": false,
1199
+ "rstrip": false,
1200
+ "single_word": false,
1201
+ "special": true
1202
+ },
1203
+ "128150": {
1204
+ "content": "<|reserved_special_token_142|>",
1205
+ "lstrip": false,
1206
+ "normalized": false,
1207
+ "rstrip": false,
1208
+ "single_word": false,
1209
+ "special": true
1210
+ },
1211
+ "128151": {
1212
+ "content": "<|reserved_special_token_143|>",
1213
+ "lstrip": false,
1214
+ "normalized": false,
1215
+ "rstrip": false,
1216
+ "single_word": false,
1217
+ "special": true
1218
+ },
1219
+ "128152": {
1220
+ "content": "<|reserved_special_token_144|>",
1221
+ "lstrip": false,
1222
+ "normalized": false,
1223
+ "rstrip": false,
1224
+ "single_word": false,
1225
+ "special": true
1226
+ },
1227
+ "128153": {
1228
+ "content": "<|reserved_special_token_145|>",
1229
+ "lstrip": false,
1230
+ "normalized": false,
1231
+ "rstrip": false,
1232
+ "single_word": false,
1233
+ "special": true
1234
+ },
1235
+ "128154": {
1236
+ "content": "<|reserved_special_token_146|>",
1237
+ "lstrip": false,
1238
+ "normalized": false,
1239
+ "rstrip": false,
1240
+ "single_word": false,
1241
+ "special": true
1242
+ },
1243
+ "128155": {
1244
+ "content": "<|reserved_special_token_147|>",
1245
+ "lstrip": false,
1246
+ "normalized": false,
1247
+ "rstrip": false,
1248
+ "single_word": false,
1249
+ "special": true
1250
+ },
1251
+ "128156": {
1252
+ "content": "<|reserved_special_token_148|>",
1253
+ "lstrip": false,
1254
+ "normalized": false,
1255
+ "rstrip": false,
1256
+ "single_word": false,
1257
+ "special": true
1258
+ },
1259
+ "128157": {
1260
+ "content": "<|reserved_special_token_149|>",
1261
+ "lstrip": false,
1262
+ "normalized": false,
1263
+ "rstrip": false,
1264
+ "single_word": false,
1265
+ "special": true
1266
+ },
1267
+ "128158": {
1268
+ "content": "<|reserved_special_token_150|>",
1269
+ "lstrip": false,
1270
+ "normalized": false,
1271
+ "rstrip": false,
1272
+ "single_word": false,
1273
+ "special": true
1274
+ },
1275
+ "128159": {
1276
+ "content": "<|reserved_special_token_151|>",
1277
+ "lstrip": false,
1278
+ "normalized": false,
1279
+ "rstrip": false,
1280
+ "single_word": false,
1281
+ "special": true
1282
+ },
1283
+ "128160": {
1284
+ "content": "<|reserved_special_token_152|>",
1285
+ "lstrip": false,
1286
+ "normalized": false,
1287
+ "rstrip": false,
1288
+ "single_word": false,
1289
+ "special": true
1290
+ },
1291
+ "128161": {
1292
+ "content": "<|reserved_special_token_153|>",
1293
+ "lstrip": false,
1294
+ "normalized": false,
1295
+ "rstrip": false,
1296
+ "single_word": false,
1297
+ "special": true
1298
+ },
1299
+ "128162": {
1300
+ "content": "<|reserved_special_token_154|>",
1301
+ "lstrip": false,
1302
+ "normalized": false,
1303
+ "rstrip": false,
1304
+ "single_word": false,
1305
+ "special": true
1306
+ },
1307
+ "128163": {
1308
+ "content": "<|reserved_special_token_155|>",
1309
+ "lstrip": false,
1310
+ "normalized": false,
1311
+ "rstrip": false,
1312
+ "single_word": false,
1313
+ "special": true
1314
+ },
1315
+ "128164": {
1316
+ "content": "<|reserved_special_token_156|>",
1317
+ "lstrip": false,
1318
+ "normalized": false,
1319
+ "rstrip": false,
1320
+ "single_word": false,
1321
+ "special": true
1322
+ },
1323
+ "128165": {
1324
+ "content": "<|reserved_special_token_157|>",
1325
+ "lstrip": false,
1326
+ "normalized": false,
1327
+ "rstrip": false,
1328
+ "single_word": false,
1329
+ "special": true
1330
+ },
1331
+ "128166": {
1332
+ "content": "<|reserved_special_token_158|>",
1333
+ "lstrip": false,
1334
+ "normalized": false,
1335
+ "rstrip": false,
1336
+ "single_word": false,
1337
+ "special": true
1338
+ },
1339
+ "128167": {
1340
+ "content": "<|reserved_special_token_159|>",
1341
+ "lstrip": false,
1342
+ "normalized": false,
1343
+ "rstrip": false,
1344
+ "single_word": false,
1345
+ "special": true
1346
+ },
1347
+ "128168": {
1348
+ "content": "<|reserved_special_token_160|>",
1349
+ "lstrip": false,
1350
+ "normalized": false,
1351
+ "rstrip": false,
1352
+ "single_word": false,
1353
+ "special": true
1354
+ },
1355
+ "128169": {
1356
+ "content": "<|reserved_special_token_161|>",
1357
+ "lstrip": false,
1358
+ "normalized": false,
1359
+ "rstrip": false,
1360
+ "single_word": false,
1361
+ "special": true
1362
+ },
1363
+ "128170": {
1364
+ "content": "<|reserved_special_token_162|>",
1365
+ "lstrip": false,
1366
+ "normalized": false,
1367
+ "rstrip": false,
1368
+ "single_word": false,
1369
+ "special": true
1370
+ },
1371
+ "128171": {
1372
+ "content": "<|reserved_special_token_163|>",
1373
+ "lstrip": false,
1374
+ "normalized": false,
1375
+ "rstrip": false,
1376
+ "single_word": false,
1377
+ "special": true
1378
+ },
1379
+ "128172": {
1380
+ "content": "<|reserved_special_token_164|>",
1381
+ "lstrip": false,
1382
+ "normalized": false,
1383
+ "rstrip": false,
1384
+ "single_word": false,
1385
+ "special": true
1386
+ },
1387
+ "128173": {
1388
+ "content": "<|reserved_special_token_165|>",
1389
+ "lstrip": false,
1390
+ "normalized": false,
1391
+ "rstrip": false,
1392
+ "single_word": false,
1393
+ "special": true
1394
+ },
1395
+ "128174": {
1396
+ "content": "<|reserved_special_token_166|>",
1397
+ "lstrip": false,
1398
+ "normalized": false,
1399
+ "rstrip": false,
1400
+ "single_word": false,
1401
+ "special": true
1402
+ },
1403
+ "128175": {
1404
+ "content": "<|reserved_special_token_167|>",
1405
+ "lstrip": false,
1406
+ "normalized": false,
1407
+ "rstrip": false,
1408
+ "single_word": false,
1409
+ "special": true
1410
+ },
1411
+ "128176": {
1412
+ "content": "<|reserved_special_token_168|>",
1413
+ "lstrip": false,
1414
+ "normalized": false,
1415
+ "rstrip": false,
1416
+ "single_word": false,
1417
+ "special": true
1418
+ },
1419
+ "128177": {
1420
+ "content": "<|reserved_special_token_169|>",
1421
+ "lstrip": false,
1422
+ "normalized": false,
1423
+ "rstrip": false,
1424
+ "single_word": false,
1425
+ "special": true
1426
+ },
1427
+ "128178": {
1428
+ "content": "<|reserved_special_token_170|>",
1429
+ "lstrip": false,
1430
+ "normalized": false,
1431
+ "rstrip": false,
1432
+ "single_word": false,
1433
+ "special": true
1434
+ },
1435
+ "128179": {
1436
+ "content": "<|reserved_special_token_171|>",
1437
+ "lstrip": false,
1438
+ "normalized": false,
1439
+ "rstrip": false,
1440
+ "single_word": false,
1441
+ "special": true
1442
+ },
1443
+ "128180": {
1444
+ "content": "<|reserved_special_token_172|>",
1445
+ "lstrip": false,
1446
+ "normalized": false,
1447
+ "rstrip": false,
1448
+ "single_word": false,
1449
+ "special": true
1450
+ },
1451
+ "128181": {
1452
+ "content": "<|reserved_special_token_173|>",
1453
+ "lstrip": false,
1454
+ "normalized": false,
1455
+ "rstrip": false,
1456
+ "single_word": false,
1457
+ "special": true
1458
+ },
1459
+ "128182": {
1460
+ "content": "<|reserved_special_token_174|>",
1461
+ "lstrip": false,
1462
+ "normalized": false,
1463
+ "rstrip": false,
1464
+ "single_word": false,
1465
+ "special": true
1466
+ },
1467
+ "128183": {
1468
+ "content": "<|reserved_special_token_175|>",
1469
+ "lstrip": false,
1470
+ "normalized": false,
1471
+ "rstrip": false,
1472
+ "single_word": false,
1473
+ "special": true
1474
+ },
1475
+ "128184": {
1476
+ "content": "<|reserved_special_token_176|>",
1477
+ "lstrip": false,
1478
+ "normalized": false,
1479
+ "rstrip": false,
1480
+ "single_word": false,
1481
+ "special": true
1482
+ },
1483
+ "128185": {
1484
+ "content": "<|reserved_special_token_177|>",
1485
+ "lstrip": false,
1486
+ "normalized": false,
1487
+ "rstrip": false,
1488
+ "single_word": false,
1489
+ "special": true
1490
+ },
1491
+ "128186": {
1492
+ "content": "<|reserved_special_token_178|>",
1493
+ "lstrip": false,
1494
+ "normalized": false,
1495
+ "rstrip": false,
1496
+ "single_word": false,
1497
+ "special": true
1498
+ },
1499
+ "128187": {
1500
+ "content": "<|reserved_special_token_179|>",
1501
+ "lstrip": false,
1502
+ "normalized": false,
1503
+ "rstrip": false,
1504
+ "single_word": false,
1505
+ "special": true
1506
+ },
1507
+ "128188": {
1508
+ "content": "<|reserved_special_token_180|>",
1509
+ "lstrip": false,
1510
+ "normalized": false,
1511
+ "rstrip": false,
1512
+ "single_word": false,
1513
+ "special": true
1514
+ },
1515
+ "128189": {
1516
+ "content": "<|reserved_special_token_181|>",
1517
+ "lstrip": false,
1518
+ "normalized": false,
1519
+ "rstrip": false,
1520
+ "single_word": false,
1521
+ "special": true
1522
+ },
1523
+ "128190": {
1524
+ "content": "<|reserved_special_token_182|>",
1525
+ "lstrip": false,
1526
+ "normalized": false,
1527
+ "rstrip": false,
1528
+ "single_word": false,
1529
+ "special": true
1530
+ },
1531
+ "128191": {
1532
+ "content": "<|reserved_special_token_183|>",
1533
+ "lstrip": false,
1534
+ "normalized": false,
1535
+ "rstrip": false,
1536
+ "single_word": false,
1537
+ "special": true
1538
+ },
1539
+ "128192": {
1540
+ "content": "<|reserved_special_token_184|>",
1541
+ "lstrip": false,
1542
+ "normalized": false,
1543
+ "rstrip": false,
1544
+ "single_word": false,
1545
+ "special": true
1546
+ },
1547
+ "128193": {
1548
+ "content": "<|reserved_special_token_185|>",
1549
+ "lstrip": false,
1550
+ "normalized": false,
1551
+ "rstrip": false,
1552
+ "single_word": false,
1553
+ "special": true
1554
+ },
1555
+ "128194": {
1556
+ "content": "<|reserved_special_token_186|>",
1557
+ "lstrip": false,
1558
+ "normalized": false,
1559
+ "rstrip": false,
1560
+ "single_word": false,
1561
+ "special": true
1562
+ },
1563
+ "128195": {
1564
+ "content": "<|reserved_special_token_187|>",
1565
+ "lstrip": false,
1566
+ "normalized": false,
1567
+ "rstrip": false,
1568
+ "single_word": false,
1569
+ "special": true
1570
+ },
1571
+ "128196": {
1572
+ "content": "<|reserved_special_token_188|>",
1573
+ "lstrip": false,
1574
+ "normalized": false,
1575
+ "rstrip": false,
1576
+ "single_word": false,
1577
+ "special": true
1578
+ },
1579
+ "128197": {
1580
+ "content": "<|reserved_special_token_189|>",
1581
+ "lstrip": false,
1582
+ "normalized": false,
1583
+ "rstrip": false,
1584
+ "single_word": false,
1585
+ "special": true
1586
+ },
1587
+ "128198": {
1588
+ "content": "<|reserved_special_token_190|>",
1589
+ "lstrip": false,
1590
+ "normalized": false,
1591
+ "rstrip": false,
1592
+ "single_word": false,
1593
+ "special": true
1594
+ },
1595
+ "128199": {
1596
+ "content": "<|reserved_special_token_191|>",
1597
+ "lstrip": false,
1598
+ "normalized": false,
1599
+ "rstrip": false,
1600
+ "single_word": false,
1601
+ "special": true
1602
+ },
1603
+ "128200": {
1604
+ "content": "<|reserved_special_token_192|>",
1605
+ "lstrip": false,
1606
+ "normalized": false,
1607
+ "rstrip": false,
1608
+ "single_word": false,
1609
+ "special": true
1610
+ },
1611
+ "128201": {
1612
+ "content": "<|reserved_special_token_193|>",
1613
+ "lstrip": false,
1614
+ "normalized": false,
1615
+ "rstrip": false,
1616
+ "single_word": false,
1617
+ "special": true
1618
+ },
1619
+ "128202": {
1620
+ "content": "<|reserved_special_token_194|>",
1621
+ "lstrip": false,
1622
+ "normalized": false,
1623
+ "rstrip": false,
1624
+ "single_word": false,
1625
+ "special": true
1626
+ },
1627
+ "128203": {
1628
+ "content": "<|reserved_special_token_195|>",
1629
+ "lstrip": false,
1630
+ "normalized": false,
1631
+ "rstrip": false,
1632
+ "single_word": false,
1633
+ "special": true
1634
+ },
1635
+ "128204": {
1636
+ "content": "<|reserved_special_token_196|>",
1637
+ "lstrip": false,
1638
+ "normalized": false,
1639
+ "rstrip": false,
1640
+ "single_word": false,
1641
+ "special": true
1642
+ },
1643
+ "128205": {
1644
+ "content": "<|reserved_special_token_197|>",
1645
+ "lstrip": false,
1646
+ "normalized": false,
1647
+ "rstrip": false,
1648
+ "single_word": false,
1649
+ "special": true
1650
+ },
1651
+ "128206": {
1652
+ "content": "<|reserved_special_token_198|>",
1653
+ "lstrip": false,
1654
+ "normalized": false,
1655
+ "rstrip": false,
1656
+ "single_word": false,
1657
+ "special": true
1658
+ },
1659
+ "128207": {
1660
+ "content": "<|reserved_special_token_199|>",
1661
+ "lstrip": false,
1662
+ "normalized": false,
1663
+ "rstrip": false,
1664
+ "single_word": false,
1665
+ "special": true
1666
+ },
1667
+ "128208": {
1668
+ "content": "<|reserved_special_token_200|>",
1669
+ "lstrip": false,
1670
+ "normalized": false,
1671
+ "rstrip": false,
1672
+ "single_word": false,
1673
+ "special": true
1674
+ },
1675
+ "128209": {
1676
+ "content": "<|reserved_special_token_201|>",
1677
+ "lstrip": false,
1678
+ "normalized": false,
1679
+ "rstrip": false,
1680
+ "single_word": false,
1681
+ "special": true
1682
+ },
1683
+ "128210": {
1684
+ "content": "<|reserved_special_token_202|>",
1685
+ "lstrip": false,
1686
+ "normalized": false,
1687
+ "rstrip": false,
1688
+ "single_word": false,
1689
+ "special": true
1690
+ },
1691
+ "128211": {
1692
+ "content": "<|reserved_special_token_203|>",
1693
+ "lstrip": false,
1694
+ "normalized": false,
1695
+ "rstrip": false,
1696
+ "single_word": false,
1697
+ "special": true
1698
+ },
1699
+ "128212": {
1700
+ "content": "<|reserved_special_token_204|>",
1701
+ "lstrip": false,
1702
+ "normalized": false,
1703
+ "rstrip": false,
1704
+ "single_word": false,
1705
+ "special": true
1706
+ },
1707
+ "128213": {
1708
+ "content": "<|reserved_special_token_205|>",
1709
+ "lstrip": false,
1710
+ "normalized": false,
1711
+ "rstrip": false,
1712
+ "single_word": false,
1713
+ "special": true
1714
+ },
1715
+ "128214": {
1716
+ "content": "<|reserved_special_token_206|>",
1717
+ "lstrip": false,
1718
+ "normalized": false,
1719
+ "rstrip": false,
1720
+ "single_word": false,
1721
+ "special": true
1722
+ },
1723
+ "128215": {
1724
+ "content": "<|reserved_special_token_207|>",
1725
+ "lstrip": false,
1726
+ "normalized": false,
1727
+ "rstrip": false,
1728
+ "single_word": false,
1729
+ "special": true
1730
+ },
1731
+ "128216": {
1732
+ "content": "<|reserved_special_token_208|>",
1733
+ "lstrip": false,
1734
+ "normalized": false,
1735
+ "rstrip": false,
1736
+ "single_word": false,
1737
+ "special": true
1738
+ },
1739
+ "128217": {
1740
+ "content": "<|reserved_special_token_209|>",
1741
+ "lstrip": false,
1742
+ "normalized": false,
1743
+ "rstrip": false,
1744
+ "single_word": false,
1745
+ "special": true
1746
+ },
1747
+ "128218": {
1748
+ "content": "<|reserved_special_token_210|>",
1749
+ "lstrip": false,
1750
+ "normalized": false,
1751
+ "rstrip": false,
1752
+ "single_word": false,
1753
+ "special": true
1754
+ },
1755
+ "128219": {
1756
+ "content": "<|reserved_special_token_211|>",
1757
+ "lstrip": false,
1758
+ "normalized": false,
1759
+ "rstrip": false,
1760
+ "single_word": false,
1761
+ "special": true
1762
+ },
1763
+ "128220": {
1764
+ "content": "<|reserved_special_token_212|>",
1765
+ "lstrip": false,
1766
+ "normalized": false,
1767
+ "rstrip": false,
1768
+ "single_word": false,
1769
+ "special": true
1770
+ },
1771
+ "128221": {
1772
+ "content": "<|reserved_special_token_213|>",
1773
+ "lstrip": false,
1774
+ "normalized": false,
1775
+ "rstrip": false,
1776
+ "single_word": false,
1777
+ "special": true
1778
+ },
1779
+ "128222": {
1780
+ "content": "<|reserved_special_token_214|>",
1781
+ "lstrip": false,
1782
+ "normalized": false,
1783
+ "rstrip": false,
1784
+ "single_word": false,
1785
+ "special": true
1786
+ },
1787
+ "128223": {
1788
+ "content": "<|reserved_special_token_215|>",
1789
+ "lstrip": false,
1790
+ "normalized": false,
1791
+ "rstrip": false,
1792
+ "single_word": false,
1793
+ "special": true
1794
+ },
1795
+ "128224": {
1796
+ "content": "<|reserved_special_token_216|>",
1797
+ "lstrip": false,
1798
+ "normalized": false,
1799
+ "rstrip": false,
1800
+ "single_word": false,
1801
+ "special": true
1802
+ },
1803
+ "128225": {
1804
+ "content": "<|reserved_special_token_217|>",
1805
+ "lstrip": false,
1806
+ "normalized": false,
1807
+ "rstrip": false,
1808
+ "single_word": false,
1809
+ "special": true
1810
+ },
1811
+ "128226": {
1812
+ "content": "<|reserved_special_token_218|>",
1813
+ "lstrip": false,
1814
+ "normalized": false,
1815
+ "rstrip": false,
1816
+ "single_word": false,
1817
+ "special": true
1818
+ },
1819
+ "128227": {
1820
+ "content": "<|reserved_special_token_219|>",
1821
+ "lstrip": false,
1822
+ "normalized": false,
1823
+ "rstrip": false,
1824
+ "single_word": false,
1825
+ "special": true
1826
+ },
1827
+ "128228": {
1828
+ "content": "<|reserved_special_token_220|>",
1829
+ "lstrip": false,
1830
+ "normalized": false,
1831
+ "rstrip": false,
1832
+ "single_word": false,
1833
+ "special": true
1834
+ },
1835
+ "128229": {
1836
+ "content": "<|reserved_special_token_221|>",
1837
+ "lstrip": false,
1838
+ "normalized": false,
1839
+ "rstrip": false,
1840
+ "single_word": false,
1841
+ "special": true
1842
+ },
1843
+ "128230": {
1844
+ "content": "<|reserved_special_token_222|>",
1845
+ "lstrip": false,
1846
+ "normalized": false,
1847
+ "rstrip": false,
1848
+ "single_word": false,
1849
+ "special": true
1850
+ },
1851
+ "128231": {
1852
+ "content": "<|reserved_special_token_223|>",
1853
+ "lstrip": false,
1854
+ "normalized": false,
1855
+ "rstrip": false,
1856
+ "single_word": false,
1857
+ "special": true
1858
+ },
1859
+ "128232": {
1860
+ "content": "<|reserved_special_token_224|>",
1861
+ "lstrip": false,
1862
+ "normalized": false,
1863
+ "rstrip": false,
1864
+ "single_word": false,
1865
+ "special": true
1866
+ },
1867
+ "128233": {
1868
+ "content": "<|reserved_special_token_225|>",
1869
+ "lstrip": false,
1870
+ "normalized": false,
1871
+ "rstrip": false,
1872
+ "single_word": false,
1873
+ "special": true
1874
+ },
1875
+ "128234": {
1876
+ "content": "<|reserved_special_token_226|>",
1877
+ "lstrip": false,
1878
+ "normalized": false,
1879
+ "rstrip": false,
1880
+ "single_word": false,
1881
+ "special": true
1882
+ },
1883
+ "128235": {
1884
+ "content": "<|reserved_special_token_227|>",
1885
+ "lstrip": false,
1886
+ "normalized": false,
1887
+ "rstrip": false,
1888
+ "single_word": false,
1889
+ "special": true
1890
+ },
1891
+ "128236": {
1892
+ "content": "<|reserved_special_token_228|>",
1893
+ "lstrip": false,
1894
+ "normalized": false,
1895
+ "rstrip": false,
1896
+ "single_word": false,
1897
+ "special": true
1898
+ },
1899
+ "128237": {
1900
+ "content": "<|reserved_special_token_229|>",
1901
+ "lstrip": false,
1902
+ "normalized": false,
1903
+ "rstrip": false,
1904
+ "single_word": false,
1905
+ "special": true
1906
+ },
1907
+ "128238": {
1908
+ "content": "<|reserved_special_token_230|>",
1909
+ "lstrip": false,
1910
+ "normalized": false,
1911
+ "rstrip": false,
1912
+ "single_word": false,
1913
+ "special": true
1914
+ },
1915
+ "128239": {
1916
+ "content": "<|reserved_special_token_231|>",
1917
+ "lstrip": false,
1918
+ "normalized": false,
1919
+ "rstrip": false,
1920
+ "single_word": false,
1921
+ "special": true
1922
+ },
1923
+ "128240": {
1924
+ "content": "<|reserved_special_token_232|>",
1925
+ "lstrip": false,
1926
+ "normalized": false,
1927
+ "rstrip": false,
1928
+ "single_word": false,
1929
+ "special": true
1930
+ },
1931
+ "128241": {
1932
+ "content": "<|reserved_special_token_233|>",
1933
+ "lstrip": false,
1934
+ "normalized": false,
1935
+ "rstrip": false,
1936
+ "single_word": false,
1937
+ "special": true
1938
+ },
1939
+ "128242": {
1940
+ "content": "<|reserved_special_token_234|>",
1941
+ "lstrip": false,
1942
+ "normalized": false,
1943
+ "rstrip": false,
1944
+ "single_word": false,
1945
+ "special": true
1946
+ },
1947
+ "128243": {
1948
+ "content": "<|reserved_special_token_235|>",
1949
+ "lstrip": false,
1950
+ "normalized": false,
1951
+ "rstrip": false,
1952
+ "single_word": false,
1953
+ "special": true
1954
+ },
1955
+ "128244": {
1956
+ "content": "<|reserved_special_token_236|>",
1957
+ "lstrip": false,
1958
+ "normalized": false,
1959
+ "rstrip": false,
1960
+ "single_word": false,
1961
+ "special": true
1962
+ },
1963
+ "128245": {
1964
+ "content": "<|reserved_special_token_237|>",
1965
+ "lstrip": false,
1966
+ "normalized": false,
1967
+ "rstrip": false,
1968
+ "single_word": false,
1969
+ "special": true
1970
+ },
1971
+ "128246": {
1972
+ "content": "<|reserved_special_token_238|>",
1973
+ "lstrip": false,
1974
+ "normalized": false,
1975
+ "rstrip": false,
1976
+ "single_word": false,
1977
+ "special": true
1978
+ },
1979
+ "128247": {
1980
+ "content": "<|reserved_special_token_239|>",
1981
+ "lstrip": false,
1982
+ "normalized": false,
1983
+ "rstrip": false,
1984
+ "single_word": false,
1985
+ "special": true
1986
+ },
1987
+ "128248": {
1988
+ "content": "<|reserved_special_token_240|>",
1989
+ "lstrip": false,
1990
+ "normalized": false,
1991
+ "rstrip": false,
1992
+ "single_word": false,
1993
+ "special": true
1994
+ },
1995
+ "128249": {
1996
+ "content": "<|reserved_special_token_241|>",
1997
+ "lstrip": false,
1998
+ "normalized": false,
1999
+ "rstrip": false,
2000
+ "single_word": false,
2001
+ "special": true
2002
+ },
2003
+ "128250": {
2004
+ "content": "<|reserved_special_token_242|>",
2005
+ "lstrip": false,
2006
+ "normalized": false,
2007
+ "rstrip": false,
2008
+ "single_word": false,
2009
+ "special": true
2010
+ },
2011
+ "128251": {
2012
+ "content": "<|reserved_special_token_243|>",
2013
+ "lstrip": false,
2014
+ "normalized": false,
2015
+ "rstrip": false,
2016
+ "single_word": false,
2017
+ "special": true
2018
+ },
2019
+ "128252": {
2020
+ "content": "<|reserved_special_token_244|>",
2021
+ "lstrip": false,
2022
+ "normalized": false,
2023
+ "rstrip": false,
2024
+ "single_word": false,
2025
+ "special": true
2026
+ },
2027
+ "128253": {
2028
+ "content": "<|reserved_special_token_245|>",
2029
+ "lstrip": false,
2030
+ "normalized": false,
2031
+ "rstrip": false,
2032
+ "single_word": false,
2033
+ "special": true
2034
+ },
2035
+ "128254": {
2036
+ "content": "<|reserved_special_token_246|>",
2037
+ "lstrip": false,
2038
+ "normalized": false,
2039
+ "rstrip": false,
2040
+ "single_word": false,
2041
+ "special": true
2042
+ },
2043
+ "128255": {
2044
+ "content": "<|reserved_special_token_247|>",
2045
+ "lstrip": false,
2046
+ "normalized": false,
2047
+ "rstrip": false,
2048
+ "single_word": false,
2049
+ "special": true
2050
+ },
2051
+ "128256": {
2052
+ "content": "<im_patch>",
2053
+ "lstrip": false,
2054
+ "normalized": false,
2055
+ "rstrip": false,
2056
+ "single_word": false,
2057
+ "special": true
2058
+ }
2059
+ },
2060
+ "additional_special_tokens": [
2061
+ "<im_patch>"
2062
+ ],
2063
+ "bos_token": "<|begin_of_text|>",
2064
+ "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- set date_string = \"26 Jul 2024\" %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"\" %}\n{%- endif %}\n\n{#- System message + builtin tools #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if builtin_tools is defined or tools is not none %}\n {{- \"Environment: ipython\\n\" }}\n{%- endif %}\n{%- if builtin_tools is defined %}\n {{- \"Tools: \" + builtin_tools | reject('equalto', 'code_interpreter') | join(\", \") + \"\\n\\n\"}}\n{%- endif %}\n{{- \"Cutting Knowledge Date: December 2023\\n\" }}\n{{- \"Today Date: \" + date_string + \"\\n\\n\" }}\n{%- if tools is not none and not tools_in_user_message %}\n {{- \"You have access to the following functions. To call a function, please respond with JSON for a function call.\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n{%- endif %}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n{%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n'+ message['content'] | trim + '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {%- if builtin_tools is defined and tool_call.name in builtin_tools %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- \"<|python_tag|>\" + tool_call.name + \".call(\" }}\n {%- for arg_name, arg_val in tool_call.arguments | items %}\n {{- arg_name + '=\"' + arg_val + '\"' }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- endif %}\n {%- endfor %}\n {{- \")\" }}\n {%- else %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\"name\": \"' + tool_call.name + '\", ' }}\n {{- '\"parameters\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {%- endif %}\n {%- if builtin_tools is defined %}\n {#- This means we're in ipython mode #}\n {{- \"<|eom_id|>\" }}\n {%- else %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n",
2065
+ "clean_up_tokenization_spaces": true,
2066
+ "eos_token": "<|eot_id|>",
2067
+ "model_input_names": [
2068
+ "input_ids",
2069
+ "attention_mask"
2070
+ ],
2071
+ "model_max_length": 131072,
2072
+ "pad_token": "<|eot_id|>",
2073
+ "padding_side": "right",
2074
+ "tokenizer_class": "PreTrainedTokenizerFast"
2075
+ }