weiweiz1 commited on
Commit
8d8451c
1 Parent(s): abdbaa5

auto_round format

Browse files

Signed-off-by: Zhang, Weiwei1 <weiwei1.zhang@intel.com>

config.json CHANGED
@@ -45,12 +45,11 @@
45
  "quantization_config": {
46
  "amp": true,
47
  "autoround_version": "0.4.2.dev",
 
48
  "batch_size": 8,
49
  "bits": 4,
50
- "block_name_to_quantize": "transformer.encoder.layers",
51
- "damp_percent": 0.01,
52
  "data_type": "int",
53
- "desc_act": false,
54
  "enable_minmax_tuning": true,
55
  "enable_norm_bias_tuning": false,
56
  "enable_quanted_input": true,
@@ -61,12 +60,11 @@
61
  "lr": 0.001,
62
  "minmax_lr": 0.001,
63
  "nsamples": 512,
64
- "quant_method": "gptq",
65
  "scale_dtype": "torch.float16",
66
  "seqlen": 2048,
67
  "sym": true,
68
- "to_quant_block_names": "transformer.encoder.layers",
69
- "true_sequential": false
70
  },
71
  "rmsnorm": true,
72
  "rope_ratio": 1,
 
45
  "quantization_config": {
46
  "amp": true,
47
  "autoround_version": "0.4.2.dev",
48
+ "backend": "auto_round:gptq:exllamav2",
49
  "batch_size": 8,
50
  "bits": 4,
 
 
51
  "data_type": "int",
52
+ "dataset": "NeelNanda/pile-10k",
53
  "enable_minmax_tuning": true,
54
  "enable_norm_bias_tuning": false,
55
  "enable_quanted_input": true,
 
60
  "lr": 0.001,
61
  "minmax_lr": 0.001,
62
  "nsamples": 512,
63
+ "quant_method": "intel/auto-round",
64
  "scale_dtype": "torch.float16",
65
  "seqlen": 2048,
66
  "sym": true,
67
+ "to_quant_block_names": "transformer.encoder.layers"
 
68
  },
69
  "rmsnorm": true,
70
  "rope_ratio": 1,
model-00001-of-00004.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:62829b26f86cde3129ce4012e21dd67e0259bc05131c3a463b1dfb854f680949
3
- size 4975739040
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7c295fef9b3f7fd900bdf38512c4a1a05621e85a3123de63d2dbb2ad4139b40
3
+ size 4973226600
model-00002-of-00004.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:94f8b1740de71c38f3d7968e6c29191dbe7231dcafb898d6fbc16348efe2a203
3
- size 4984273648
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50d9300df8c11f3332a3bec54fbe5f3da7d2a51cd76152a5d4a89229d6b20fcc
3
+ size 4983924232
model.safetensors.index.json CHANGED
@@ -1,23 +1,20 @@
1
  {
2
  "metadata": {
3
- "total_size": 15742098496
4
  },
5
  "weight_map": {
6
  "transformer.embedding.word_embeddings.weight": "model-00001-of-00004.safetensors",
7
  "transformer.encoder.final_layernorm.weight": "model-00002-of-00004.safetensors",
8
  "transformer.encoder.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
9
- "transformer.encoder.layers.0.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
10
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
11
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
12
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
13
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
14
- "transformer.encoder.layers.0.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
15
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
16
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
17
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
18
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
19
  "transformer.encoder.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
20
- "transformer.encoder.layers.0.self_attention.dense.bias": "model-00001-of-00004.safetensors",
21
  "transformer.encoder.layers.0.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
22
  "transformer.encoder.layers.0.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
23
  "transformer.encoder.layers.0.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -28,18 +25,15 @@
28
  "transformer.encoder.layers.0.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
29
  "transformer.encoder.layers.0.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
30
  "transformer.encoder.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
31
- "transformer.encoder.layers.1.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
32
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
33
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
34
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
35
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
36
- "transformer.encoder.layers.1.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
37
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
38
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
39
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
40
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
41
  "transformer.encoder.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
42
- "transformer.encoder.layers.1.self_attention.dense.bias": "model-00001-of-00004.safetensors",
43
  "transformer.encoder.layers.1.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
44
  "transformer.encoder.layers.1.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
45
  "transformer.encoder.layers.1.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -50,18 +44,15 @@
50
  "transformer.encoder.layers.1.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
51
  "transformer.encoder.layers.1.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
52
  "transformer.encoder.layers.10.input_layernorm.weight": "model-00001-of-00004.safetensors",
53
- "transformer.encoder.layers.10.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
54
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
55
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
56
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
57
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
58
- "transformer.encoder.layers.10.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
59
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
60
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
61
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
62
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
63
  "transformer.encoder.layers.10.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
64
- "transformer.encoder.layers.10.self_attention.dense.bias": "model-00001-of-00004.safetensors",
65
  "transformer.encoder.layers.10.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
66
  "transformer.encoder.layers.10.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
67
  "transformer.encoder.layers.10.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -72,18 +63,15 @@
72
  "transformer.encoder.layers.10.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
73
  "transformer.encoder.layers.10.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
74
  "transformer.encoder.layers.11.input_layernorm.weight": "model-00001-of-00004.safetensors",
75
- "transformer.encoder.layers.11.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
76
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
77
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
78
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
79
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
80
- "transformer.encoder.layers.11.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
81
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
82
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
83
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
84
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
85
  "transformer.encoder.layers.11.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
86
- "transformer.encoder.layers.11.self_attention.dense.bias": "model-00001-of-00004.safetensors",
87
  "transformer.encoder.layers.11.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
88
  "transformer.encoder.layers.11.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
89
  "transformer.encoder.layers.11.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -94,18 +82,15 @@
94
  "transformer.encoder.layers.11.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
95
  "transformer.encoder.layers.11.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
96
  "transformer.encoder.layers.12.input_layernorm.weight": "model-00001-of-00004.safetensors",
97
- "transformer.encoder.layers.12.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
98
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
99
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
100
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
101
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
102
- "transformer.encoder.layers.12.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
103
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
104
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
105
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
106
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
107
  "transformer.encoder.layers.12.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
108
- "transformer.encoder.layers.12.self_attention.dense.bias": "model-00001-of-00004.safetensors",
109
  "transformer.encoder.layers.12.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
110
  "transformer.encoder.layers.12.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
111
  "transformer.encoder.layers.12.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -116,18 +101,15 @@
116
  "transformer.encoder.layers.12.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
117
  "transformer.encoder.layers.12.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
118
  "transformer.encoder.layers.13.input_layernorm.weight": "model-00001-of-00004.safetensors",
119
- "transformer.encoder.layers.13.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
120
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
121
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
122
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
123
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
124
- "transformer.encoder.layers.13.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
125
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
126
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
127
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
128
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
129
  "transformer.encoder.layers.13.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
130
- "transformer.encoder.layers.13.self_attention.dense.bias": "model-00001-of-00004.safetensors",
131
  "transformer.encoder.layers.13.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
132
  "transformer.encoder.layers.13.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
133
  "transformer.encoder.layers.13.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -138,18 +120,15 @@
138
  "transformer.encoder.layers.13.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
139
  "transformer.encoder.layers.13.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
140
  "transformer.encoder.layers.14.input_layernorm.weight": "model-00001-of-00004.safetensors",
141
- "transformer.encoder.layers.14.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
142
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
143
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
144
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
145
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
146
- "transformer.encoder.layers.14.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
147
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
148
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
149
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
150
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
151
  "transformer.encoder.layers.14.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
152
- "transformer.encoder.layers.14.self_attention.dense.bias": "model-00001-of-00004.safetensors",
153
  "transformer.encoder.layers.14.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
154
  "transformer.encoder.layers.14.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
155
  "transformer.encoder.layers.14.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -160,18 +139,15 @@
160
  "transformer.encoder.layers.14.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
161
  "transformer.encoder.layers.14.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
162
  "transformer.encoder.layers.15.input_layernorm.weight": "model-00001-of-00004.safetensors",
163
- "transformer.encoder.layers.15.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
164
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
165
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
166
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
167
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
168
- "transformer.encoder.layers.15.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
169
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
170
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
171
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
172
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
173
  "transformer.encoder.layers.15.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
174
- "transformer.encoder.layers.15.self_attention.dense.bias": "model-00001-of-00004.safetensors",
175
  "transformer.encoder.layers.15.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
176
  "transformer.encoder.layers.15.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
177
  "transformer.encoder.layers.15.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -182,18 +158,15 @@
182
  "transformer.encoder.layers.15.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
183
  "transformer.encoder.layers.15.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
184
  "transformer.encoder.layers.16.input_layernorm.weight": "model-00001-of-00004.safetensors",
185
- "transformer.encoder.layers.16.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
186
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
187
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
188
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
189
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
190
- "transformer.encoder.layers.16.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
191
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
192
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
193
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
194
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
195
  "transformer.encoder.layers.16.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
196
- "transformer.encoder.layers.16.self_attention.dense.bias": "model-00001-of-00004.safetensors",
197
  "transformer.encoder.layers.16.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
198
  "transformer.encoder.layers.16.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
199
  "transformer.encoder.layers.16.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -204,18 +177,15 @@
204
  "transformer.encoder.layers.16.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
205
  "transformer.encoder.layers.16.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
206
  "transformer.encoder.layers.17.input_layernorm.weight": "model-00001-of-00004.safetensors",
207
- "transformer.encoder.layers.17.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
208
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
209
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
210
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
211
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
212
- "transformer.encoder.layers.17.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
213
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
214
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
215
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
216
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
217
  "transformer.encoder.layers.17.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
218
- "transformer.encoder.layers.17.self_attention.dense.bias": "model-00001-of-00004.safetensors",
219
  "transformer.encoder.layers.17.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
220
  "transformer.encoder.layers.17.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
221
  "transformer.encoder.layers.17.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -226,18 +196,15 @@
226
  "transformer.encoder.layers.17.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
227
  "transformer.encoder.layers.17.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
228
  "transformer.encoder.layers.18.input_layernorm.weight": "model-00001-of-00004.safetensors",
229
- "transformer.encoder.layers.18.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
230
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
231
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
232
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
233
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
234
- "transformer.encoder.layers.18.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
235
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
236
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
237
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
238
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
239
  "transformer.encoder.layers.18.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
240
- "transformer.encoder.layers.18.self_attention.dense.bias": "model-00001-of-00004.safetensors",
241
  "transformer.encoder.layers.18.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
242
  "transformer.encoder.layers.18.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
243
  "transformer.encoder.layers.18.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -248,18 +215,15 @@
248
  "transformer.encoder.layers.18.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
249
  "transformer.encoder.layers.18.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
250
  "transformer.encoder.layers.19.input_layernorm.weight": "model-00001-of-00004.safetensors",
251
- "transformer.encoder.layers.19.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
252
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
253
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
254
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
255
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
256
- "transformer.encoder.layers.19.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
257
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
258
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
259
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
260
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
261
  "transformer.encoder.layers.19.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
262
- "transformer.encoder.layers.19.self_attention.dense.bias": "model-00001-of-00004.safetensors",
263
  "transformer.encoder.layers.19.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
264
  "transformer.encoder.layers.19.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
265
  "transformer.encoder.layers.19.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -270,18 +234,15 @@
270
  "transformer.encoder.layers.19.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
271
  "transformer.encoder.layers.19.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
272
  "transformer.encoder.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
273
- "transformer.encoder.layers.2.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
274
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
275
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
276
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
277
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
278
- "transformer.encoder.layers.2.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
279
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
280
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
281
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
282
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
283
  "transformer.encoder.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
284
- "transformer.encoder.layers.2.self_attention.dense.bias": "model-00001-of-00004.safetensors",
285
  "transformer.encoder.layers.2.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
286
  "transformer.encoder.layers.2.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
287
  "transformer.encoder.layers.2.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -292,18 +253,15 @@
292
  "transformer.encoder.layers.2.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
293
  "transformer.encoder.layers.2.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
294
  "transformer.encoder.layers.20.input_layernorm.weight": "model-00001-of-00004.safetensors",
295
- "transformer.encoder.layers.20.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
296
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
297
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
298
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
299
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
300
- "transformer.encoder.layers.20.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
301
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
302
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
303
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
304
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
305
  "transformer.encoder.layers.20.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
306
- "transformer.encoder.layers.20.self_attention.dense.bias": "model-00001-of-00004.safetensors",
307
  "transformer.encoder.layers.20.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
308
  "transformer.encoder.layers.20.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
309
  "transformer.encoder.layers.20.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -314,18 +272,15 @@
314
  "transformer.encoder.layers.20.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
315
  "transformer.encoder.layers.20.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
316
  "transformer.encoder.layers.21.input_layernorm.weight": "model-00001-of-00004.safetensors",
317
- "transformer.encoder.layers.21.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
318
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
319
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
320
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
321
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
322
- "transformer.encoder.layers.21.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
323
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
324
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
325
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
326
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
327
  "transformer.encoder.layers.21.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
328
- "transformer.encoder.layers.21.self_attention.dense.bias": "model-00001-of-00004.safetensors",
329
  "transformer.encoder.layers.21.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
330
  "transformer.encoder.layers.21.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
331
  "transformer.encoder.layers.21.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -336,18 +291,15 @@
336
  "transformer.encoder.layers.21.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
337
  "transformer.encoder.layers.21.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
338
  "transformer.encoder.layers.22.input_layernorm.weight": "model-00001-of-00004.safetensors",
339
- "transformer.encoder.layers.22.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
340
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
341
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
342
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
343
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
344
- "transformer.encoder.layers.22.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
345
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
346
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
347
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
348
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
349
  "transformer.encoder.layers.22.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
350
- "transformer.encoder.layers.22.self_attention.dense.bias": "model-00001-of-00004.safetensors",
351
  "transformer.encoder.layers.22.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
352
  "transformer.encoder.layers.22.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
353
  "transformer.encoder.layers.22.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -358,18 +310,15 @@
358
  "transformer.encoder.layers.22.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
359
  "transformer.encoder.layers.22.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
360
  "transformer.encoder.layers.23.input_layernorm.weight": "model-00001-of-00004.safetensors",
361
- "transformer.encoder.layers.23.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
362
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
363
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
364
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
365
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
366
- "transformer.encoder.layers.23.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
367
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
368
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
369
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
370
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
371
  "transformer.encoder.layers.23.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
372
- "transformer.encoder.layers.23.self_attention.dense.bias": "model-00001-of-00004.safetensors",
373
  "transformer.encoder.layers.23.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
374
  "transformer.encoder.layers.23.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
375
  "transformer.encoder.layers.23.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -380,18 +329,15 @@
380
  "transformer.encoder.layers.23.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
381
  "transformer.encoder.layers.23.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
382
  "transformer.encoder.layers.24.input_layernorm.weight": "model-00001-of-00004.safetensors",
383
- "transformer.encoder.layers.24.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
384
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
385
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
386
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
387
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
388
- "transformer.encoder.layers.24.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
389
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
390
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
391
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
392
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
393
  "transformer.encoder.layers.24.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
394
- "transformer.encoder.layers.24.self_attention.dense.bias": "model-00001-of-00004.safetensors",
395
  "transformer.encoder.layers.24.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
396
  "transformer.encoder.layers.24.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
397
  "transformer.encoder.layers.24.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -402,18 +348,15 @@
402
  "transformer.encoder.layers.24.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
403
  "transformer.encoder.layers.24.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
404
  "transformer.encoder.layers.25.input_layernorm.weight": "model-00001-of-00004.safetensors",
405
- "transformer.encoder.layers.25.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
406
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
407
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
408
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
409
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
410
- "transformer.encoder.layers.25.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
411
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
412
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
413
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
414
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
415
  "transformer.encoder.layers.25.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
416
- "transformer.encoder.layers.25.self_attention.dense.bias": "model-00001-of-00004.safetensors",
417
  "transformer.encoder.layers.25.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
418
  "transformer.encoder.layers.25.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
419
  "transformer.encoder.layers.25.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -424,18 +367,15 @@
424
  "transformer.encoder.layers.25.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
425
  "transformer.encoder.layers.25.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
426
  "transformer.encoder.layers.26.input_layernorm.weight": "model-00001-of-00004.safetensors",
427
- "transformer.encoder.layers.26.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
428
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
429
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
430
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
431
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
432
- "transformer.encoder.layers.26.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
433
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
434
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
435
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
436
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
437
  "transformer.encoder.layers.26.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
438
- "transformer.encoder.layers.26.self_attention.dense.bias": "model-00001-of-00004.safetensors",
439
  "transformer.encoder.layers.26.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
440
  "transformer.encoder.layers.26.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
441
  "transformer.encoder.layers.26.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -446,18 +386,15 @@
446
  "transformer.encoder.layers.26.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
447
  "transformer.encoder.layers.26.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
448
  "transformer.encoder.layers.27.input_layernorm.weight": "model-00001-of-00004.safetensors",
449
- "transformer.encoder.layers.27.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
450
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
451
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
452
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
453
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
454
- "transformer.encoder.layers.27.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
455
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
456
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
457
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
458
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
459
  "transformer.encoder.layers.27.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
460
- "transformer.encoder.layers.27.self_attention.dense.bias": "model-00001-of-00004.safetensors",
461
  "transformer.encoder.layers.27.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
462
  "transformer.encoder.layers.27.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
463
  "transformer.encoder.layers.27.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -468,18 +405,15 @@
468
  "transformer.encoder.layers.27.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
469
  "transformer.encoder.layers.27.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
470
  "transformer.encoder.layers.28.input_layernorm.weight": "model-00001-of-00004.safetensors",
471
- "transformer.encoder.layers.28.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
472
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
473
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
474
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
475
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
476
- "transformer.encoder.layers.28.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
477
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
478
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
479
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
480
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
481
  "transformer.encoder.layers.28.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
482
- "transformer.encoder.layers.28.self_attention.dense.bias": "model-00001-of-00004.safetensors",
483
  "transformer.encoder.layers.28.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
484
  "transformer.encoder.layers.28.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
485
  "transformer.encoder.layers.28.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -490,18 +424,15 @@
490
  "transformer.encoder.layers.28.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
491
  "transformer.encoder.layers.28.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
492
  "transformer.encoder.layers.29.input_layernorm.weight": "model-00001-of-00004.safetensors",
493
- "transformer.encoder.layers.29.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
494
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
495
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
496
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
497
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
498
- "transformer.encoder.layers.29.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
499
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
500
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
501
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
502
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
503
  "transformer.encoder.layers.29.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
504
- "transformer.encoder.layers.29.self_attention.dense.bias": "model-00001-of-00004.safetensors",
505
  "transformer.encoder.layers.29.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
506
  "transformer.encoder.layers.29.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
507
  "transformer.encoder.layers.29.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -512,18 +443,15 @@
512
  "transformer.encoder.layers.29.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
513
  "transformer.encoder.layers.29.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
514
  "transformer.encoder.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
515
- "transformer.encoder.layers.3.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
516
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
517
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
518
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
519
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
520
- "transformer.encoder.layers.3.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
521
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
522
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
523
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
524
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
525
  "transformer.encoder.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
526
- "transformer.encoder.layers.3.self_attention.dense.bias": "model-00001-of-00004.safetensors",
527
  "transformer.encoder.layers.3.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
528
  "transformer.encoder.layers.3.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
529
  "transformer.encoder.layers.3.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -534,18 +462,15 @@
534
  "transformer.encoder.layers.3.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
535
  "transformer.encoder.layers.3.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
536
  "transformer.encoder.layers.30.input_layernorm.weight": "model-00001-of-00004.safetensors",
537
- "transformer.encoder.layers.30.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
538
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
539
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
540
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
541
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
542
- "transformer.encoder.layers.30.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
543
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
544
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
545
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
546
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
547
  "transformer.encoder.layers.30.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
548
- "transformer.encoder.layers.30.self_attention.dense.bias": "model-00001-of-00004.safetensors",
549
  "transformer.encoder.layers.30.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
550
  "transformer.encoder.layers.30.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
551
  "transformer.encoder.layers.30.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -556,18 +481,15 @@
556
  "transformer.encoder.layers.30.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
557
  "transformer.encoder.layers.30.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
558
  "transformer.encoder.layers.31.input_layernorm.weight": "model-00001-of-00004.safetensors",
559
- "transformer.encoder.layers.31.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
560
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
561
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
562
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
563
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
564
- "transformer.encoder.layers.31.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
565
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
566
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
567
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
568
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
569
  "transformer.encoder.layers.31.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
570
- "transformer.encoder.layers.31.self_attention.dense.bias": "model-00001-of-00004.safetensors",
571
  "transformer.encoder.layers.31.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
572
  "transformer.encoder.layers.31.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
573
  "transformer.encoder.layers.31.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -578,18 +500,15 @@
578
  "transformer.encoder.layers.31.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
579
  "transformer.encoder.layers.31.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
580
  "transformer.encoder.layers.32.input_layernorm.weight": "model-00001-of-00004.safetensors",
581
- "transformer.encoder.layers.32.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
582
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
583
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
584
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
585
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
586
- "transformer.encoder.layers.32.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
587
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
588
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
589
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
590
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
591
  "transformer.encoder.layers.32.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
592
- "transformer.encoder.layers.32.self_attention.dense.bias": "model-00001-of-00004.safetensors",
593
  "transformer.encoder.layers.32.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
594
  "transformer.encoder.layers.32.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
595
  "transformer.encoder.layers.32.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -600,18 +519,15 @@
600
  "transformer.encoder.layers.32.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
601
  "transformer.encoder.layers.32.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
602
  "transformer.encoder.layers.33.input_layernorm.weight": "model-00001-of-00004.safetensors",
603
- "transformer.encoder.layers.33.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
604
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
605
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
606
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
607
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
608
- "transformer.encoder.layers.33.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
609
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
610
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
611
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
612
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
613
  "transformer.encoder.layers.33.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
614
- "transformer.encoder.layers.33.self_attention.dense.bias": "model-00001-of-00004.safetensors",
615
  "transformer.encoder.layers.33.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
616
  "transformer.encoder.layers.33.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
617
  "transformer.encoder.layers.33.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -622,18 +538,15 @@
622
  "transformer.encoder.layers.33.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
623
  "transformer.encoder.layers.33.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
624
  "transformer.encoder.layers.34.input_layernorm.weight": "model-00001-of-00004.safetensors",
625
- "transformer.encoder.layers.34.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
626
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
627
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
628
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
629
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
630
- "transformer.encoder.layers.34.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
631
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
632
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
633
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
634
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
635
  "transformer.encoder.layers.34.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
636
- "transformer.encoder.layers.34.self_attention.dense.bias": "model-00001-of-00004.safetensors",
637
  "transformer.encoder.layers.34.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
638
  "transformer.encoder.layers.34.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
639
  "transformer.encoder.layers.34.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -644,18 +557,15 @@
644
  "transformer.encoder.layers.34.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
645
  "transformer.encoder.layers.34.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
646
  "transformer.encoder.layers.35.input_layernorm.weight": "model-00001-of-00004.safetensors",
647
- "transformer.encoder.layers.35.mlp.dense_4h_to_h.bias": "model-00002-of-00004.safetensors",
648
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
649
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
650
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
651
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
652
- "transformer.encoder.layers.35.mlp.dense_h_to_4h.bias": "model-00002-of-00004.safetensors",
653
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
654
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
655
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
656
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
657
  "transformer.encoder.layers.35.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
658
- "transformer.encoder.layers.35.self_attention.dense.bias": "model-00001-of-00004.safetensors",
659
  "transformer.encoder.layers.35.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
660
  "transformer.encoder.layers.35.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
661
  "transformer.encoder.layers.35.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -666,18 +576,15 @@
666
  "transformer.encoder.layers.35.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
667
  "transformer.encoder.layers.35.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
668
  "transformer.encoder.layers.36.input_layernorm.weight": "model-00002-of-00004.safetensors",
669
- "transformer.encoder.layers.36.mlp.dense_4h_to_h.bias": "model-00002-of-00004.safetensors",
670
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
671
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
672
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
673
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
674
- "transformer.encoder.layers.36.mlp.dense_h_to_4h.bias": "model-00002-of-00004.safetensors",
675
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
676
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
677
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
678
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
679
  "transformer.encoder.layers.36.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
680
- "transformer.encoder.layers.36.self_attention.dense.bias": "model-00002-of-00004.safetensors",
681
  "transformer.encoder.layers.36.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
682
  "transformer.encoder.layers.36.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
683
  "transformer.encoder.layers.36.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
@@ -688,18 +595,15 @@
688
  "transformer.encoder.layers.36.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
689
  "transformer.encoder.layers.36.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
690
  "transformer.encoder.layers.37.input_layernorm.weight": "model-00002-of-00004.safetensors",
691
- "transformer.encoder.layers.37.mlp.dense_4h_to_h.bias": "model-00002-of-00004.safetensors",
692
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
693
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
694
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
695
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
696
- "transformer.encoder.layers.37.mlp.dense_h_to_4h.bias": "model-00002-of-00004.safetensors",
697
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
698
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
699
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
700
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
701
  "transformer.encoder.layers.37.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
702
- "transformer.encoder.layers.37.self_attention.dense.bias": "model-00002-of-00004.safetensors",
703
  "transformer.encoder.layers.37.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
704
  "transformer.encoder.layers.37.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
705
  "transformer.encoder.layers.37.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
@@ -710,18 +614,15 @@
710
  "transformer.encoder.layers.37.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
711
  "transformer.encoder.layers.37.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
712
  "transformer.encoder.layers.38.input_layernorm.weight": "model-00002-of-00004.safetensors",
713
- "transformer.encoder.layers.38.mlp.dense_4h_to_h.bias": "model-00002-of-00004.safetensors",
714
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
715
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
716
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
717
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
718
- "transformer.encoder.layers.38.mlp.dense_h_to_4h.bias": "model-00002-of-00004.safetensors",
719
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
720
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
721
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
722
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
723
  "transformer.encoder.layers.38.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
724
- "transformer.encoder.layers.38.self_attention.dense.bias": "model-00002-of-00004.safetensors",
725
  "transformer.encoder.layers.38.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
726
  "transformer.encoder.layers.38.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
727
  "transformer.encoder.layers.38.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
@@ -732,18 +633,15 @@
732
  "transformer.encoder.layers.38.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
733
  "transformer.encoder.layers.38.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
734
  "transformer.encoder.layers.39.input_layernorm.weight": "model-00002-of-00004.safetensors",
735
- "transformer.encoder.layers.39.mlp.dense_4h_to_h.bias": "model-00002-of-00004.safetensors",
736
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
737
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
738
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
739
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
740
- "transformer.encoder.layers.39.mlp.dense_h_to_4h.bias": "model-00002-of-00004.safetensors",
741
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
742
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
743
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
744
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
745
  "transformer.encoder.layers.39.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
746
- "transformer.encoder.layers.39.self_attention.dense.bias": "model-00002-of-00004.safetensors",
747
  "transformer.encoder.layers.39.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
748
  "transformer.encoder.layers.39.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
749
  "transformer.encoder.layers.39.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
@@ -754,18 +652,15 @@
754
  "transformer.encoder.layers.39.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
755
  "transformer.encoder.layers.39.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
756
  "transformer.encoder.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
757
- "transformer.encoder.layers.4.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
758
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
759
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
760
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
761
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
762
- "transformer.encoder.layers.4.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
763
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
764
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
765
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
766
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
767
  "transformer.encoder.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
768
- "transformer.encoder.layers.4.self_attention.dense.bias": "model-00001-of-00004.safetensors",
769
  "transformer.encoder.layers.4.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
770
  "transformer.encoder.layers.4.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
771
  "transformer.encoder.layers.4.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -776,18 +671,15 @@
776
  "transformer.encoder.layers.4.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
777
  "transformer.encoder.layers.4.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
778
  "transformer.encoder.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
779
- "transformer.encoder.layers.5.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
780
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
781
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
782
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
783
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
784
- "transformer.encoder.layers.5.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
785
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
786
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
787
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
788
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
789
  "transformer.encoder.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
790
- "transformer.encoder.layers.5.self_attention.dense.bias": "model-00001-of-00004.safetensors",
791
  "transformer.encoder.layers.5.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
792
  "transformer.encoder.layers.5.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
793
  "transformer.encoder.layers.5.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -798,18 +690,15 @@
798
  "transformer.encoder.layers.5.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
799
  "transformer.encoder.layers.5.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
800
  "transformer.encoder.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
801
- "transformer.encoder.layers.6.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
802
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
803
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
804
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
805
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
806
- "transformer.encoder.layers.6.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
807
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
808
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
809
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
810
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
811
  "transformer.encoder.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
812
- "transformer.encoder.layers.6.self_attention.dense.bias": "model-00001-of-00004.safetensors",
813
  "transformer.encoder.layers.6.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
814
  "transformer.encoder.layers.6.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
815
  "transformer.encoder.layers.6.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -820,18 +709,15 @@
820
  "transformer.encoder.layers.6.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
821
  "transformer.encoder.layers.6.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
822
  "transformer.encoder.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
823
- "transformer.encoder.layers.7.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
824
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
825
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
826
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
827
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
828
- "transformer.encoder.layers.7.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
829
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
830
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
831
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
832
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
833
  "transformer.encoder.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
834
- "transformer.encoder.layers.7.self_attention.dense.bias": "model-00001-of-00004.safetensors",
835
  "transformer.encoder.layers.7.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
836
  "transformer.encoder.layers.7.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
837
  "transformer.encoder.layers.7.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -842,18 +728,15 @@
842
  "transformer.encoder.layers.7.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
843
  "transformer.encoder.layers.7.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
844
  "transformer.encoder.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
845
- "transformer.encoder.layers.8.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
846
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
847
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
848
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
849
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
850
- "transformer.encoder.layers.8.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
851
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
852
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
853
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
854
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
855
  "transformer.encoder.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
856
- "transformer.encoder.layers.8.self_attention.dense.bias": "model-00001-of-00004.safetensors",
857
  "transformer.encoder.layers.8.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
858
  "transformer.encoder.layers.8.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
859
  "transformer.encoder.layers.8.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
@@ -864,18 +747,15 @@
864
  "transformer.encoder.layers.8.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
865
  "transformer.encoder.layers.8.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
866
  "transformer.encoder.layers.9.input_layernorm.weight": "model-00001-of-00004.safetensors",
867
- "transformer.encoder.layers.9.mlp.dense_4h_to_h.bias": "model-00001-of-00004.safetensors",
868
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
869
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
870
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
871
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
872
- "transformer.encoder.layers.9.mlp.dense_h_to_4h.bias": "model-00001-of-00004.safetensors",
873
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
874
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
875
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
876
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
877
  "transformer.encoder.layers.9.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
878
- "transformer.encoder.layers.9.self_attention.dense.bias": "model-00001-of-00004.safetensors",
879
  "transformer.encoder.layers.9.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
880
  "transformer.encoder.layers.9.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
881
  "transformer.encoder.layers.9.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
1
  {
2
  "metadata": {
3
+ "total_size": 15739251776
4
  },
5
  "weight_map": {
6
  "transformer.embedding.word_embeddings.weight": "model-00001-of-00004.safetensors",
7
  "transformer.encoder.final_layernorm.weight": "model-00002-of-00004.safetensors",
8
  "transformer.encoder.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
9
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
10
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
11
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
12
  "transformer.encoder.layers.0.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
13
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
14
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
15
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
16
  "transformer.encoder.layers.0.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
17
  "transformer.encoder.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
18
  "transformer.encoder.layers.0.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
19
  "transformer.encoder.layers.0.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
20
  "transformer.encoder.layers.0.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
25
  "transformer.encoder.layers.0.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
26
  "transformer.encoder.layers.0.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
27
  "transformer.encoder.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
28
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
29
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
30
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
31
  "transformer.encoder.layers.1.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
32
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
33
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
34
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
35
  "transformer.encoder.layers.1.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
36
  "transformer.encoder.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
37
  "transformer.encoder.layers.1.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
38
  "transformer.encoder.layers.1.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
39
  "transformer.encoder.layers.1.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
44
  "transformer.encoder.layers.1.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
45
  "transformer.encoder.layers.1.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
46
  "transformer.encoder.layers.10.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
47
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
48
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
49
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
50
  "transformer.encoder.layers.10.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
51
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
52
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
53
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
54
  "transformer.encoder.layers.10.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
55
  "transformer.encoder.layers.10.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
56
  "transformer.encoder.layers.10.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
57
  "transformer.encoder.layers.10.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
58
  "transformer.encoder.layers.10.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
63
  "transformer.encoder.layers.10.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
64
  "transformer.encoder.layers.10.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
65
  "transformer.encoder.layers.11.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
66
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
67
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
68
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
69
  "transformer.encoder.layers.11.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
70
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
71
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
72
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
73
  "transformer.encoder.layers.11.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
74
  "transformer.encoder.layers.11.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
75
  "transformer.encoder.layers.11.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
76
  "transformer.encoder.layers.11.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
77
  "transformer.encoder.layers.11.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
82
  "transformer.encoder.layers.11.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
83
  "transformer.encoder.layers.11.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
84
  "transformer.encoder.layers.12.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
85
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
86
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
87
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
88
  "transformer.encoder.layers.12.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
89
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
90
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
91
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
92
  "transformer.encoder.layers.12.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
93
  "transformer.encoder.layers.12.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
94
  "transformer.encoder.layers.12.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
95
  "transformer.encoder.layers.12.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
96
  "transformer.encoder.layers.12.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
101
  "transformer.encoder.layers.12.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
102
  "transformer.encoder.layers.12.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
103
  "transformer.encoder.layers.13.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
104
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
105
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
106
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
107
  "transformer.encoder.layers.13.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
108
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
109
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
110
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
111
  "transformer.encoder.layers.13.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
112
  "transformer.encoder.layers.13.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
113
  "transformer.encoder.layers.13.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
114
  "transformer.encoder.layers.13.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
115
  "transformer.encoder.layers.13.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
120
  "transformer.encoder.layers.13.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
121
  "transformer.encoder.layers.13.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
122
  "transformer.encoder.layers.14.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
123
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
124
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
125
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
126
  "transformer.encoder.layers.14.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
127
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
128
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
129
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
130
  "transformer.encoder.layers.14.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
131
  "transformer.encoder.layers.14.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
132
  "transformer.encoder.layers.14.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
133
  "transformer.encoder.layers.14.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
134
  "transformer.encoder.layers.14.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
139
  "transformer.encoder.layers.14.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
140
  "transformer.encoder.layers.14.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
141
  "transformer.encoder.layers.15.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
142
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
143
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
144
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
145
  "transformer.encoder.layers.15.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
146
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
147
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
148
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
149
  "transformer.encoder.layers.15.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
150
  "transformer.encoder.layers.15.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
151
  "transformer.encoder.layers.15.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
152
  "transformer.encoder.layers.15.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
153
  "transformer.encoder.layers.15.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
158
  "transformer.encoder.layers.15.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
159
  "transformer.encoder.layers.15.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
160
  "transformer.encoder.layers.16.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
161
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
162
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
163
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
164
  "transformer.encoder.layers.16.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
165
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
166
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
167
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
168
  "transformer.encoder.layers.16.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
169
  "transformer.encoder.layers.16.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
170
  "transformer.encoder.layers.16.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
171
  "transformer.encoder.layers.16.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
172
  "transformer.encoder.layers.16.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
177
  "transformer.encoder.layers.16.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
178
  "transformer.encoder.layers.16.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
179
  "transformer.encoder.layers.17.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
180
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
181
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
182
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
183
  "transformer.encoder.layers.17.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
184
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
185
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
186
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
187
  "transformer.encoder.layers.17.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
188
  "transformer.encoder.layers.17.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
189
  "transformer.encoder.layers.17.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
190
  "transformer.encoder.layers.17.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
191
  "transformer.encoder.layers.17.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
196
  "transformer.encoder.layers.17.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
197
  "transformer.encoder.layers.17.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
198
  "transformer.encoder.layers.18.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
199
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
200
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
201
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
202
  "transformer.encoder.layers.18.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
203
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
204
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
205
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
206
  "transformer.encoder.layers.18.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
207
  "transformer.encoder.layers.18.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
208
  "transformer.encoder.layers.18.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
209
  "transformer.encoder.layers.18.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
210
  "transformer.encoder.layers.18.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
215
  "transformer.encoder.layers.18.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
216
  "transformer.encoder.layers.18.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
217
  "transformer.encoder.layers.19.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
218
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
219
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
220
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
221
  "transformer.encoder.layers.19.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
222
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
223
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
224
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
225
  "transformer.encoder.layers.19.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
226
  "transformer.encoder.layers.19.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
227
  "transformer.encoder.layers.19.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
228
  "transformer.encoder.layers.19.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
229
  "transformer.encoder.layers.19.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
234
  "transformer.encoder.layers.19.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
235
  "transformer.encoder.layers.19.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
236
  "transformer.encoder.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
237
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
238
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
239
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
240
  "transformer.encoder.layers.2.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
241
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
242
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
243
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
244
  "transformer.encoder.layers.2.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
245
  "transformer.encoder.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
246
  "transformer.encoder.layers.2.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
247
  "transformer.encoder.layers.2.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
248
  "transformer.encoder.layers.2.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
253
  "transformer.encoder.layers.2.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
254
  "transformer.encoder.layers.2.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
255
  "transformer.encoder.layers.20.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
256
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
257
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
258
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
259
  "transformer.encoder.layers.20.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
260
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
261
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
262
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
263
  "transformer.encoder.layers.20.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
264
  "transformer.encoder.layers.20.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
265
  "transformer.encoder.layers.20.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
266
  "transformer.encoder.layers.20.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
267
  "transformer.encoder.layers.20.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
272
  "transformer.encoder.layers.20.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
273
  "transformer.encoder.layers.20.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
274
  "transformer.encoder.layers.21.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
275
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
276
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
277
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
278
  "transformer.encoder.layers.21.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
279
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
280
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
281
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
282
  "transformer.encoder.layers.21.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
283
  "transformer.encoder.layers.21.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
284
  "transformer.encoder.layers.21.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
285
  "transformer.encoder.layers.21.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
286
  "transformer.encoder.layers.21.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
291
  "transformer.encoder.layers.21.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
292
  "transformer.encoder.layers.21.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
293
  "transformer.encoder.layers.22.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
294
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
295
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
296
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
297
  "transformer.encoder.layers.22.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
298
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
299
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
300
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
301
  "transformer.encoder.layers.22.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
302
  "transformer.encoder.layers.22.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
303
  "transformer.encoder.layers.22.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
304
  "transformer.encoder.layers.22.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
305
  "transformer.encoder.layers.22.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
310
  "transformer.encoder.layers.22.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
311
  "transformer.encoder.layers.22.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
312
  "transformer.encoder.layers.23.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
313
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
314
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
315
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
316
  "transformer.encoder.layers.23.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
317
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
318
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
319
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
320
  "transformer.encoder.layers.23.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
321
  "transformer.encoder.layers.23.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
322
  "transformer.encoder.layers.23.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
323
  "transformer.encoder.layers.23.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
324
  "transformer.encoder.layers.23.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
329
  "transformer.encoder.layers.23.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
330
  "transformer.encoder.layers.23.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
331
  "transformer.encoder.layers.24.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
332
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
333
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
334
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
335
  "transformer.encoder.layers.24.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
336
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
337
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
338
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
339
  "transformer.encoder.layers.24.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
340
  "transformer.encoder.layers.24.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
341
  "transformer.encoder.layers.24.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
342
  "transformer.encoder.layers.24.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
343
  "transformer.encoder.layers.24.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
348
  "transformer.encoder.layers.24.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
349
  "transformer.encoder.layers.24.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
350
  "transformer.encoder.layers.25.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
351
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
352
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
353
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
354
  "transformer.encoder.layers.25.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
355
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
356
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
357
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
358
  "transformer.encoder.layers.25.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
359
  "transformer.encoder.layers.25.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
360
  "transformer.encoder.layers.25.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
361
  "transformer.encoder.layers.25.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
362
  "transformer.encoder.layers.25.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
367
  "transformer.encoder.layers.25.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
368
  "transformer.encoder.layers.25.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
369
  "transformer.encoder.layers.26.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
370
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
371
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
372
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
373
  "transformer.encoder.layers.26.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
374
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
375
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
376
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
377
  "transformer.encoder.layers.26.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
378
  "transformer.encoder.layers.26.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
379
  "transformer.encoder.layers.26.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
380
  "transformer.encoder.layers.26.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
381
  "transformer.encoder.layers.26.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
386
  "transformer.encoder.layers.26.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
387
  "transformer.encoder.layers.26.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
388
  "transformer.encoder.layers.27.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
389
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
390
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
391
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
392
  "transformer.encoder.layers.27.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
393
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
394
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
395
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
396
  "transformer.encoder.layers.27.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
397
  "transformer.encoder.layers.27.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
398
  "transformer.encoder.layers.27.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
399
  "transformer.encoder.layers.27.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
400
  "transformer.encoder.layers.27.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
405
  "transformer.encoder.layers.27.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
406
  "transformer.encoder.layers.27.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
407
  "transformer.encoder.layers.28.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
408
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
409
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
410
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
411
  "transformer.encoder.layers.28.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
412
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
413
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
414
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
415
  "transformer.encoder.layers.28.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
416
  "transformer.encoder.layers.28.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
417
  "transformer.encoder.layers.28.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
418
  "transformer.encoder.layers.28.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
419
  "transformer.encoder.layers.28.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
424
  "transformer.encoder.layers.28.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
425
  "transformer.encoder.layers.28.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
426
  "transformer.encoder.layers.29.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
427
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
428
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
429
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
430
  "transformer.encoder.layers.29.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
431
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
432
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
433
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
434
  "transformer.encoder.layers.29.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
435
  "transformer.encoder.layers.29.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
436
  "transformer.encoder.layers.29.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
437
  "transformer.encoder.layers.29.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
438
  "transformer.encoder.layers.29.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
443
  "transformer.encoder.layers.29.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
444
  "transformer.encoder.layers.29.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
445
  "transformer.encoder.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
446
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
447
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
448
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
449
  "transformer.encoder.layers.3.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
450
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
451
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
452
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
453
  "transformer.encoder.layers.3.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
454
  "transformer.encoder.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
455
  "transformer.encoder.layers.3.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
456
  "transformer.encoder.layers.3.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
457
  "transformer.encoder.layers.3.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
462
  "transformer.encoder.layers.3.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
463
  "transformer.encoder.layers.3.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
464
  "transformer.encoder.layers.30.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
465
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
466
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
467
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
468
  "transformer.encoder.layers.30.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
469
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
470
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
471
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
472
  "transformer.encoder.layers.30.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
473
  "transformer.encoder.layers.30.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
474
  "transformer.encoder.layers.30.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
475
  "transformer.encoder.layers.30.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
476
  "transformer.encoder.layers.30.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
481
  "transformer.encoder.layers.30.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
482
  "transformer.encoder.layers.30.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
483
  "transformer.encoder.layers.31.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
484
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
485
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
486
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
487
  "transformer.encoder.layers.31.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
488
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
489
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
490
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
491
  "transformer.encoder.layers.31.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
492
  "transformer.encoder.layers.31.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
493
  "transformer.encoder.layers.31.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
494
  "transformer.encoder.layers.31.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
495
  "transformer.encoder.layers.31.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
500
  "transformer.encoder.layers.31.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
501
  "transformer.encoder.layers.31.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
502
  "transformer.encoder.layers.32.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
503
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
504
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
505
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
506
  "transformer.encoder.layers.32.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
507
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
508
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
509
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
510
  "transformer.encoder.layers.32.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
511
  "transformer.encoder.layers.32.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
512
  "transformer.encoder.layers.32.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
513
  "transformer.encoder.layers.32.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
514
  "transformer.encoder.layers.32.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
519
  "transformer.encoder.layers.32.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
520
  "transformer.encoder.layers.32.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
521
  "transformer.encoder.layers.33.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
522
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
523
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
524
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
525
  "transformer.encoder.layers.33.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
526
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
527
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
528
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
529
  "transformer.encoder.layers.33.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
530
  "transformer.encoder.layers.33.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
531
  "transformer.encoder.layers.33.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
532
  "transformer.encoder.layers.33.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
533
  "transformer.encoder.layers.33.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
538
  "transformer.encoder.layers.33.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
539
  "transformer.encoder.layers.33.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
540
  "transformer.encoder.layers.34.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
541
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
542
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
543
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
544
  "transformer.encoder.layers.34.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
545
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
546
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
547
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
548
  "transformer.encoder.layers.34.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
549
  "transformer.encoder.layers.34.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
550
  "transformer.encoder.layers.34.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
551
  "transformer.encoder.layers.34.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
552
  "transformer.encoder.layers.34.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
557
  "transformer.encoder.layers.34.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
558
  "transformer.encoder.layers.34.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
559
  "transformer.encoder.layers.35.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
560
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
561
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
562
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
563
  "transformer.encoder.layers.35.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
 
564
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
565
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
566
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
567
  "transformer.encoder.layers.35.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
568
  "transformer.encoder.layers.35.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
569
  "transformer.encoder.layers.35.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
570
  "transformer.encoder.layers.35.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
571
  "transformer.encoder.layers.35.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
576
  "transformer.encoder.layers.35.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
577
  "transformer.encoder.layers.35.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
578
  "transformer.encoder.layers.36.input_layernorm.weight": "model-00002-of-00004.safetensors",
 
579
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
580
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
581
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
582
  "transformer.encoder.layers.36.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
 
583
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
584
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
585
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
586
  "transformer.encoder.layers.36.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
587
  "transformer.encoder.layers.36.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
 
588
  "transformer.encoder.layers.36.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
589
  "transformer.encoder.layers.36.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
590
  "transformer.encoder.layers.36.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
 
595
  "transformer.encoder.layers.36.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
596
  "transformer.encoder.layers.36.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
597
  "transformer.encoder.layers.37.input_layernorm.weight": "model-00002-of-00004.safetensors",
 
598
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
599
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
600
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
601
  "transformer.encoder.layers.37.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
 
602
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
603
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
604
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
605
  "transformer.encoder.layers.37.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
606
  "transformer.encoder.layers.37.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
 
607
  "transformer.encoder.layers.37.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
608
  "transformer.encoder.layers.37.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
609
  "transformer.encoder.layers.37.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
 
614
  "transformer.encoder.layers.37.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
615
  "transformer.encoder.layers.37.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
616
  "transformer.encoder.layers.38.input_layernorm.weight": "model-00002-of-00004.safetensors",
 
617
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
618
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
619
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
620
  "transformer.encoder.layers.38.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
 
621
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
622
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
623
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
624
  "transformer.encoder.layers.38.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
625
  "transformer.encoder.layers.38.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
 
626
  "transformer.encoder.layers.38.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
627
  "transformer.encoder.layers.38.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
628
  "transformer.encoder.layers.38.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
 
633
  "transformer.encoder.layers.38.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
634
  "transformer.encoder.layers.38.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
635
  "transformer.encoder.layers.39.input_layernorm.weight": "model-00002-of-00004.safetensors",
 
636
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.g_idx": "model-00002-of-00004.safetensors",
637
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.qweight": "model-00002-of-00004.safetensors",
638
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.qzeros": "model-00002-of-00004.safetensors",
639
  "transformer.encoder.layers.39.mlp.dense_4h_to_h.scales": "model-00002-of-00004.safetensors",
 
640
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.g_idx": "model-00002-of-00004.safetensors",
641
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.qweight": "model-00002-of-00004.safetensors",
642
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.qzeros": "model-00002-of-00004.safetensors",
643
  "transformer.encoder.layers.39.mlp.dense_h_to_4h.scales": "model-00002-of-00004.safetensors",
644
  "transformer.encoder.layers.39.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
 
645
  "transformer.encoder.layers.39.self_attention.dense.g_idx": "model-00002-of-00004.safetensors",
646
  "transformer.encoder.layers.39.self_attention.dense.qweight": "model-00002-of-00004.safetensors",
647
  "transformer.encoder.layers.39.self_attention.dense.qzeros": "model-00002-of-00004.safetensors",
 
652
  "transformer.encoder.layers.39.self_attention.query_key_value.qzeros": "model-00002-of-00004.safetensors",
653
  "transformer.encoder.layers.39.self_attention.query_key_value.scales": "model-00002-of-00004.safetensors",
654
  "transformer.encoder.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
655
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
656
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
657
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
658
  "transformer.encoder.layers.4.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
659
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
660
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
661
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
662
  "transformer.encoder.layers.4.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
663
  "transformer.encoder.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
664
  "transformer.encoder.layers.4.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
665
  "transformer.encoder.layers.4.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
666
  "transformer.encoder.layers.4.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
671
  "transformer.encoder.layers.4.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
672
  "transformer.encoder.layers.4.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
673
  "transformer.encoder.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
674
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
675
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
676
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
677
  "transformer.encoder.layers.5.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
678
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
679
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
680
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
681
  "transformer.encoder.layers.5.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
682
  "transformer.encoder.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
683
  "transformer.encoder.layers.5.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
684
  "transformer.encoder.layers.5.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
685
  "transformer.encoder.layers.5.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
690
  "transformer.encoder.layers.5.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
691
  "transformer.encoder.layers.5.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
692
  "transformer.encoder.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
693
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
694
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
695
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
696
  "transformer.encoder.layers.6.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
697
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
698
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
699
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
700
  "transformer.encoder.layers.6.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
701
  "transformer.encoder.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
702
  "transformer.encoder.layers.6.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
703
  "transformer.encoder.layers.6.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
704
  "transformer.encoder.layers.6.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
709
  "transformer.encoder.layers.6.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
710
  "transformer.encoder.layers.6.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
711
  "transformer.encoder.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
712
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
713
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
714
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
715
  "transformer.encoder.layers.7.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
716
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
717
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
718
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
719
  "transformer.encoder.layers.7.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
720
  "transformer.encoder.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
721
  "transformer.encoder.layers.7.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
722
  "transformer.encoder.layers.7.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
723
  "transformer.encoder.layers.7.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
728
  "transformer.encoder.layers.7.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
729
  "transformer.encoder.layers.7.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
730
  "transformer.encoder.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
731
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
732
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
733
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
734
  "transformer.encoder.layers.8.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
735
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
736
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
737
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
738
  "transformer.encoder.layers.8.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
739
  "transformer.encoder.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
740
  "transformer.encoder.layers.8.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
741
  "transformer.encoder.layers.8.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
742
  "transformer.encoder.layers.8.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
 
747
  "transformer.encoder.layers.8.self_attention.query_key_value.qzeros": "model-00001-of-00004.safetensors",
748
  "transformer.encoder.layers.8.self_attention.query_key_value.scales": "model-00001-of-00004.safetensors",
749
  "transformer.encoder.layers.9.input_layernorm.weight": "model-00001-of-00004.safetensors",
 
750
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.g_idx": "model-00001-of-00004.safetensors",
751
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.qweight": "model-00001-of-00004.safetensors",
752
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.qzeros": "model-00001-of-00004.safetensors",
753
  "transformer.encoder.layers.9.mlp.dense_4h_to_h.scales": "model-00001-of-00004.safetensors",
 
754
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.g_idx": "model-00001-of-00004.safetensors",
755
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.qweight": "model-00001-of-00004.safetensors",
756
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.qzeros": "model-00001-of-00004.safetensors",
757
  "transformer.encoder.layers.9.mlp.dense_h_to_4h.scales": "model-00001-of-00004.safetensors",
758
  "transformer.encoder.layers.9.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
 
759
  "transformer.encoder.layers.9.self_attention.dense.g_idx": "model-00001-of-00004.safetensors",
760
  "transformer.encoder.layers.9.self_attention.dense.qweight": "model-00001-of-00004.safetensors",
761
  "transformer.encoder.layers.9.self_attention.dense.qzeros": "model-00001-of-00004.safetensors",
modeling_chatglm.py ADDED
@@ -0,0 +1,1329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """ PyTorch GLM-4V model. """
2
+ import math
3
+ import sys
4
+ import torch
5
+ import torch.utils.checkpoint
6
+ import torch.nn.functional as F
7
+ from torch import nn
8
+ from torch.nn import CrossEntropyLoss, LayerNorm, MSELoss, BCEWithLogitsLoss
9
+ from torch.nn.utils import skip_init
10
+ from typing import Optional, Tuple, Union, List, Dict, Any
11
+
12
+ from transformers.modeling_outputs import (
13
+ BaseModelOutputWithPast,
14
+ CausalLMOutputWithPast,
15
+ SequenceClassifierOutputWithPast,
16
+ )
17
+ from transformers.modeling_utils import PreTrainedModel
18
+ from transformers.utils import logging, is_torch_npu_available
19
+ from transformers.generation.logits_process import LogitsProcessor
20
+ from transformers.generation.utils import LogitsProcessorList, StoppingCriteriaList, GenerationConfig, ModelOutput
21
+
22
+ from .visual import EVA2CLIPModel
23
+ from .configuration_chatglm import ChatGLMConfig
24
+
25
+ try:
26
+ from transformers.utils import is_flash_attn_greater_or_equal_2_10, is_flash_attn_2_available
27
+
28
+ if is_flash_attn_2_available():
29
+ from flash_attn import flash_attn_func, flash_attn_varlen_func
30
+ from flash_attn.bert_padding import index_first_axis, pad_input, unpad_input # noqa
31
+ except:
32
+ pass
33
+
34
+ # flags required to enable jit fusion kernels
35
+
36
+ if sys.platform != 'darwin' and not is_torch_npu_available():
37
+ torch._C._jit_set_profiling_mode(False)
38
+ torch._C._jit_set_profiling_executor(False)
39
+ torch._C._jit_override_can_fuse_on_cpu(True)
40
+ torch._C._jit_override_can_fuse_on_gpu(True)
41
+
42
+ logger = logging.get_logger(__name__)
43
+
44
+ LANGUAGE_TOKEN_TYPE = 0
45
+ VISION_TOKEN_TYPE = 1
46
+
47
+ _CHECKPOINT_FOR_DOC = "THUDM/ChatGLM"
48
+ _CONFIG_FOR_DOC = "ChatGLMConfig"
49
+
50
+
51
+ def default_init(cls, *args, **kwargs):
52
+ return cls(*args, **kwargs)
53
+
54
+
55
+ class InvalidScoreLogitsProcessor(LogitsProcessor):
56
+ def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
57
+ if torch.isnan(scores).any() or torch.isinf(scores).any():
58
+ scores.zero_()
59
+ scores[..., 198] = 5e4
60
+ return scores
61
+
62
+
63
+ class PrefixEncoder(torch.nn.Module):
64
+ """
65
+ The torch.nn model to encode the prefix
66
+ Input shape: (batch-size, prefix-length)
67
+ Output shape: (batch-size, prefix-length, 2*layers*hidden)
68
+ """
69
+
70
+ def __init__(self, config: ChatGLMConfig):
71
+ super().__init__()
72
+ self.prefix_projection = config.prefix_projection
73
+ if self.prefix_projection:
74
+ # Use a two-layer MLP to encode the prefix
75
+ kv_size = config.num_layers * config.kv_channels * config.multi_query_group_num * 2
76
+ self.embedding = torch.nn.Embedding(config.pre_seq_len, kv_size)
77
+ self.trans = torch.nn.Sequential(
78
+ torch.nn.Linear(kv_size, config.hidden_size),
79
+ torch.nn.Tanh(),
80
+ torch.nn.Linear(config.hidden_size, kv_size)
81
+ )
82
+ else:
83
+ self.embedding = torch.nn.Embedding(config.pre_seq_len,
84
+ config.num_layers * config.kv_channels * config.multi_query_group_num * 2)
85
+
86
+ def forward(self, prefix: torch.Tensor):
87
+ if self.prefix_projection:
88
+ prefix_tokens = self.embedding(prefix)
89
+ past_key_values = self.trans(prefix_tokens)
90
+ else:
91
+ past_key_values = self.embedding(prefix)
92
+ return past_key_values
93
+
94
+
95
+ def split_tensor_along_last_dim(
96
+ tensor: torch.Tensor,
97
+ num_partitions: int,
98
+ contiguous_split_chunks: bool = False,
99
+ ) -> List[torch.Tensor]:
100
+ """Split a tensor along its last dimension.
101
+
102
+ Arguments:
103
+ tensor: input tensor.
104
+ num_partitions: number of partitions to split the tensor
105
+ contiguous_split_chunks: If True, make each chunk contiguous
106
+ in memory.
107
+
108
+ Returns:
109
+ A list of Tensors
110
+ """
111
+ # Get the size and dimension.
112
+ last_dim = tensor.dim() - 1
113
+ last_dim_size = tensor.size()[last_dim] // num_partitions
114
+ # Split.
115
+ tensor_list = torch.split(tensor, last_dim_size, dim=last_dim)
116
+ # Note: torch.split does not create contiguous tensors by default.
117
+ if contiguous_split_chunks:
118
+ return tuple(chunk.contiguous() for chunk in tensor_list)
119
+
120
+ return tensor_list
121
+
122
+
123
+ class RotaryEmbedding(nn.Module):
124
+ def __init__(self, dim, rope_ratio=1, original_impl=False, device=None, dtype=None):
125
+ super().__init__()
126
+ inv_freq = 1.0 / (10000 ** (torch.arange(0, dim, 2, device=device).to(dtype=dtype) / dim))
127
+ self.register_buffer("inv_freq", inv_freq)
128
+ self.dim = dim
129
+ self.original_impl = original_impl
130
+ self.rope_ratio = rope_ratio
131
+
132
+ def impl(self, seq_length: int, dim: int, device: torch.device, dtype: torch.dtype):
133
+ base = 10000 * self.rope_ratio
134
+ inv_freq = 1.0 / (
135
+ base ** (torch.arange(0, dim, 2, device=device, dtype=torch.float32) / dim))
136
+ seq = torch.arange(seq_length, device=inv_freq.device, dtype=torch.float32)
137
+ freqs = torch.outer(seq, inv_freq)
138
+ # first part even vector components, second part odd vector components,
139
+ # 2 * dim in dimension size
140
+ emb = torch.cat((freqs, freqs), dim=-1)
141
+ return emb
142
+
143
+ def forward_impl(
144
+ self, seq_len: int, n_elem: int, dtype: torch.dtype, device: torch.device, base: int = 10000
145
+ ):
146
+ """Enhanced Transformer with Rotary Position Embedding.
147
+
148
+ Derived from: https://github.com/labmlai/annotated_deep_learning_paper_implementations/blob/master/labml_nn/
149
+ transformers/rope/__init__.py. MIT License:
150
+ https://github.com/labmlai/annotated_deep_learning_paper_implementations/blob/master/license.
151
+ """
152
+ # $\Theta = {\theta_i = 10000^{\frac{2(i-1)}{d}}, i \in [1, 2, ..., \frac{d}{2}]}$
153
+ base = base * self.rope_ratio
154
+ theta = 1.0 / (base ** (torch.arange(0, n_elem, 2, dtype=torch.float, device=device) / n_elem))
155
+
156
+ # Create position indexes `[0, 1, ..., seq_len - 1]`
157
+ seq_idx = torch.arange(seq_len, dtype=torch.float, device=device)
158
+
159
+ # Calculate the product of position index and $\theta_i$
160
+ idx_theta = torch.outer(seq_idx, theta).float()
161
+
162
+ cache = torch.stack([torch.cos(idx_theta), torch.sin(idx_theta)], dim=-1)
163
+
164
+ # this is to mimic the behaviour of complex32, else we will get different results
165
+ if dtype in (torch.float16, torch.bfloat16, torch.int8):
166
+ cache = cache.bfloat16() if dtype == torch.bfloat16 else cache.half()
167
+ return cache
168
+
169
+ def forward(self, max_seq_len, offset=0):
170
+ if self.original_impl:
171
+ return self.forward_impl(
172
+ max_seq_len, self.dim, dtype=self.inv_freq.dtype, device=self.inv_freq.device
173
+ )
174
+ else:
175
+ return self.impl(max_seq_len, self.dim, dtype=self.inv_freq.dtype, device=self.inv_freq.device)
176
+
177
+
178
+ @torch.jit.script
179
+ def apply_rotary_pos_emb(x: torch.Tensor, rope_cache: torch.Tensor) -> torch.Tensor:
180
+ # x: [b, np, sq, hn]
181
+ b, np, sq, hn = x.size(0), x.size(1), x.size(2), x.size(3)
182
+ rot_dim = rope_cache.shape[-2] * 2
183
+ x, x_pass = x[..., :rot_dim], x[..., rot_dim:]
184
+ # truncate to support variable sizes
185
+ rope_cache = rope_cache[:, :sq]
186
+ xshaped = x.reshape(b, np, sq, rot_dim // 2, 2)
187
+ rope_cache = rope_cache.view(-1, 1, sq, xshaped.size(3), 2)
188
+ x_out2 = torch.stack(
189
+ [
190
+ xshaped[..., 0] * rope_cache[..., 0] - xshaped[..., 1] * rope_cache[..., 1],
191
+ xshaped[..., 1] * rope_cache[..., 0] + xshaped[..., 0] * rope_cache[..., 1],
192
+ ],
193
+ -1,
194
+ )
195
+ x_out2 = x_out2.flatten(3)
196
+ return torch.cat((x_out2, x_pass), dim=-1)
197
+
198
+
199
+ class RMSNorm(torch.nn.Module):
200
+ def __init__(self, normalized_shape, eps=1e-5, device=None, dtype=None, **kwargs):
201
+ super().__init__()
202
+ self.weight = torch.nn.Parameter(torch.empty(normalized_shape, device=device, dtype=dtype))
203
+ self.eps = eps
204
+
205
+ def forward(self, hidden_states: torch.Tensor):
206
+ input_dtype = hidden_states.dtype
207
+ variance = hidden_states.to(torch.float32).pow(2).mean(-1, keepdim=True)
208
+ hidden_states = hidden_states * torch.rsqrt(variance + self.eps)
209
+
210
+ return (self.weight * hidden_states).to(input_dtype)
211
+
212
+
213
+
214
+ class CoreAttention(torch.nn.Module):
215
+ def __init__(self, config: ChatGLMConfig, layer_number):
216
+ super(CoreAttention, self).__init__()
217
+
218
+ self.apply_query_key_layer_scaling = config.apply_query_key_layer_scaling
219
+ self.attention_softmax_in_fp32 = config.attention_softmax_in_fp32
220
+ if self.apply_query_key_layer_scaling:
221
+ self.attention_softmax_in_fp32 = True
222
+ self.layer_number = max(1, layer_number)
223
+
224
+ projection_size = config.kv_channels * config.num_attention_heads
225
+
226
+ # Per attention head and per partition values.
227
+ self.hidden_size_per_partition = projection_size
228
+ self.hidden_size_per_attention_head = projection_size // config.num_attention_heads
229
+ self.num_attention_heads_per_partition = config.num_attention_heads
230
+
231
+ coeff = None
232
+ self.norm_factor = math.sqrt(self.hidden_size_per_attention_head)
233
+ if self.apply_query_key_layer_scaling:
234
+ coeff = self.layer_number
235
+ self.norm_factor *= coeff
236
+ self.coeff = coeff
237
+
238
+ self.attention_dropout = torch.nn.Dropout(config.attention_dropout)
239
+
240
+ def forward(self, query_layer, key_layer, value_layer, attention_mask):
241
+ pytorch_major_version = int(torch.__version__.split('.')[0])
242
+ if pytorch_major_version >= 2:
243
+ if attention_mask is None and query_layer.shape[2] == key_layer.shape[2]:
244
+ context_layer = torch.nn.functional.scaled_dot_product_attention(query_layer, key_layer, value_layer,
245
+ is_causal=True)
246
+ else:
247
+ if attention_mask is not None:
248
+ attention_mask = ~attention_mask
249
+ context_layer = torch.nn.functional.scaled_dot_product_attention(query_layer, key_layer, value_layer,
250
+ attention_mask)
251
+ context_layer = context_layer.transpose(1, 2).contiguous()
252
+ new_context_layer_shape = context_layer.size()[:-2] + (self.hidden_size_per_partition,)
253
+ context_layer = context_layer.reshape(*new_context_layer_shape)
254
+ else:
255
+ # Raw attention scores
256
+
257
+ # [b, np, sq, sk]
258
+ output_size = (query_layer.size(0), query_layer.size(1), query_layer.size(2), key_layer.size(2))
259
+
260
+ # [b, np, sq, hn] -> [b * np, sq, hn]
261
+ query_layer = query_layer.view(output_size[0] * output_size[1], output_size[2], -1)
262
+ # [b, np, sk, hn] -> [b * np, sk, hn]
263
+ key_layer = key_layer.view(output_size[0] * output_size[1], output_size[3], -1)
264
+
265
+ # preallocting input tensor: [b * np, sq, sk]
266
+ matmul_input_buffer = torch.empty(
267
+ output_size[0] * output_size[1], output_size[2], output_size[3], dtype=query_layer.dtype,
268
+ device=query_layer.device
269
+ )
270
+
271
+ # Raw attention scores. [b * np, sq, sk]
272
+ matmul_result = torch.baddbmm(
273
+ matmul_input_buffer,
274
+ query_layer, # [b * np, sq, hn]
275
+ key_layer.transpose(1, 2), # [b * np, hn, sk]
276
+ beta=0.0,
277
+ alpha=(1.0 / self.norm_factor),
278
+ )
279
+
280
+ # change view to [b, np, sq, sk]
281
+ attention_scores = matmul_result.view(*output_size)
282
+
283
+ # ===========================
284
+ # Attention probs and dropout
285
+ # ===========================
286
+
287
+ # attention scores and attention mask [b, np, sq, sk]
288
+ if self.attention_softmax_in_fp32:
289
+ attention_scores = attention_scores.float()
290
+ if self.coeff is not None:
291
+ attention_scores = attention_scores * self.coeff
292
+ if attention_mask is None and attention_scores.shape[2] == attention_scores.shape[3]:
293
+ attention_mask = torch.ones(output_size[0], 1, output_size[2], output_size[3],
294
+ device=attention_scores.device, dtype=torch.bool)
295
+ attention_mask.tril_()
296
+ attention_mask = ~attention_mask
297
+ if attention_mask is not None:
298
+ attention_scores = attention_scores.masked_fill(attention_mask, float("-inf"))
299
+ attention_probs = F.softmax(attention_scores, dim=-1)
300
+ attention_probs = attention_probs.type_as(value_layer)
301
+
302
+ # This is actually dropping out entire tokens to attend to, which might
303
+ # seem a bit unusual, but is taken from the original Transformer paper.
304
+ attention_probs = self.attention_dropout(attention_probs)
305
+ # =========================
306
+ # Context layer. [sq, b, hp]
307
+ # =========================
308
+
309
+ # value_layer -> context layer.
310
+ # [sk, b, np, hn] --> [b, np, sq, hn]
311
+
312
+ # context layer shape: [b, np, sq, hn]
313
+ output_size = (value_layer.size(1), value_layer.size(2), query_layer.size(0), value_layer.size(3))
314
+ # change view [b * np, sk, hn]
315
+ value_layer = value_layer.view(output_size[0] * output_size[1], value_layer.size(2), -1)
316
+ # change view [b * np, sq, sk]
317
+ attention_probs = attention_probs.view(output_size[0] * output_size[1], output_size[2], -1)
318
+ # matmul: [b * np, sq, hn]
319
+ context_layer = torch.bmm(attention_probs, value_layer)
320
+ # change view [b, np, sq, hn]
321
+ context_layer = context_layer.view(*output_size)
322
+ # [b, np, sq, hn] --> [b, sq, np, hn]
323
+ context_layer = context_layer.transpose(1, 2).contiguous()
324
+ # [b, sq, np, hn] --> [b, sq, hp]
325
+ new_context_layer_shape = context_layer.size()[:-2] + (self.hidden_size_per_partition,)
326
+ context_layer = context_layer.reshape(*new_context_layer_shape)
327
+
328
+ return context_layer
329
+
330
+ class SdpaAttention(CoreAttention):
331
+ def forward(self, query_layer, key_layer, value_layer, attention_mask):
332
+ if attention_mask is None and query_layer.shape[2] == key_layer.shape[2]:
333
+ context_layer = torch.nn.functional.scaled_dot_product_attention(query_layer, key_layer, value_layer,
334
+ is_causal=True,
335
+ dropout_p=self.config.attention_dropout if self.training else 0.0)
336
+ else:
337
+ if attention_mask is not None:
338
+ attention_mask = ~attention_mask
339
+ context_layer = torch.nn.functional.scaled_dot_product_attention(query_layer, key_layer, value_layer,
340
+ attention_mask,
341
+ dropout_p=self.config.attention_dropout if self.training else 0.0)
342
+ context_layer = context_layer.transpose(1, 2).contiguous()
343
+ new_context_layer_shape = context_layer.size()[:-2] + (self.hidden_size_per_partition,)
344
+ context_layer = context_layer.reshape(*new_context_layer_shape)
345
+ return context_layer
346
+
347
+
348
+ def _get_unpad_data(attention_mask):
349
+ seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
350
+ indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
351
+ max_seqlen_in_batch = seqlens_in_batch.max().item()
352
+ cu_seqlens = F.pad(torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.int32), (1, 0))
353
+ return (
354
+ indices,
355
+ cu_seqlens,
356
+ max_seqlen_in_batch,
357
+ )
358
+
359
+
360
+ # Copied from transformers.models.llama.modeling_llama.LlamaFlashAttention2
361
+ class FlashAttention2(CoreAttention):
362
+ def __init__(self, *args, **kwargs):
363
+ super().__init__(*args, **kwargs)
364
+ self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
365
+
366
+ def forward(self, query_states, key_states, value_states, attention_mask):
367
+ query_states = query_states.transpose(1, 2)
368
+ key_states = key_states.transpose(1, 2)
369
+ value_states = value_states.transpose(1, 2)
370
+ batch_size, query_length = query_states.shape[:2]
371
+ if not self._flash_attn_uses_top_left_mask:
372
+ causal = self.is_causal
373
+ else:
374
+ # TODO: Remove the `query_length != 1` check once Flash Attention for RoCm is bumped to 2.1. For details, please see the comment in LlamaFlashAttention2 __init__.
375
+ causal = self.is_causal and query_length != 1
376
+ dropout = self.config.attention_dropout if self.training else 0.0
377
+ # Contains at least one padding token in the sequence
378
+ if attention_mask is not None:
379
+ query_states, key_states, value_states, indices_q, cu_seq_lens, max_seq_lens = self._upad_input(
380
+ query_states, key_states, value_states, attention_mask, query_length
381
+ )
382
+
383
+ cu_seqlens_q, cu_seqlens_k = cu_seq_lens
384
+ max_seqlen_in_batch_q, max_seqlen_in_batch_k = max_seq_lens
385
+
386
+ attn_output_unpad = flash_attn_varlen_func(
387
+ query_states,
388
+ key_states,
389
+ value_states,
390
+ cu_seqlens_q=cu_seqlens_q,
391
+ cu_seqlens_k=cu_seqlens_k,
392
+ max_seqlen_q=max_seqlen_in_batch_q,
393
+ max_seqlen_k=max_seqlen_in_batch_k,
394
+ dropout_p=dropout,
395
+ softmax_scale=None,
396
+ causal=causal,
397
+ )
398
+
399
+ attn_output = pad_input(attn_output_unpad, indices_q, batch_size, query_length)
400
+ else:
401
+ attn_output = flash_attn_func(
402
+ query_states, key_states, value_states, dropout, softmax_scale=None, causal=causal
403
+ )
404
+ attn_output = attn_output.reshape(batch_size, query_length, self.hidden_size_per_partition).contiguous()
405
+ return attn_output
406
+
407
+ def _upad_input(self, query_layer, key_layer, value_layer, attention_mask, query_length):
408
+ indices_k, cu_seqlens_k, max_seqlen_in_batch_k = _get_unpad_data(attention_mask)
409
+ batch_size, kv_seq_len, num_key_value_heads, head_dim = key_layer.shape
410
+
411
+ key_layer = index_first_axis(
412
+ key_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim), indices_k
413
+ )
414
+ value_layer = index_first_axis(
415
+ value_layer.reshape(batch_size * kv_seq_len, num_key_value_heads, head_dim), indices_k
416
+ )
417
+ if query_length == kv_seq_len:
418
+ query_layer = index_first_axis(
419
+ query_layer.reshape(batch_size * kv_seq_len, self.num_attention_heads_per_partition, head_dim),
420
+ indices_k
421
+ )
422
+ cu_seqlens_q = cu_seqlens_k
423
+ max_seqlen_in_batch_q = max_seqlen_in_batch_k
424
+ indices_q = indices_k
425
+ elif query_length == 1:
426
+ max_seqlen_in_batch_q = 1
427
+ cu_seqlens_q = torch.arange(
428
+ batch_size + 1, dtype=torch.int32, device=query_layer.device
429
+ ) # There is a memcpy here, that is very bad.
430
+ indices_q = cu_seqlens_q[:-1]
431
+ query_layer = query_layer.squeeze(1)
432
+ else:
433
+ # The -q_len: slice assumes left padding.
434
+ attention_mask = attention_mask[:, -query_length:]
435
+ query_layer, indices_q, cu_seqlens_q, max_seqlen_in_batch_q = unpad_input(query_layer, attention_mask)
436
+
437
+ return (
438
+ query_layer,
439
+ key_layer,
440
+ value_layer,
441
+ indices_q,
442
+ (cu_seqlens_q, cu_seqlens_k),
443
+ (max_seqlen_in_batch_q, max_seqlen_in_batch_k),
444
+ )
445
+
446
+
447
+ CORE_ATTENTION_CLASSES = {
448
+ "eager": CoreAttention,
449
+ "sdpa": SdpaAttention,
450
+ "flash_attention_2": FlashAttention2
451
+ }
452
+
453
+ class SelfAttention(torch.nn.Module):
454
+ """Parallel self-attention layer abstract class.
455
+
456
+ Self-attention layer takes input with size [s, b, h]
457
+ and returns output of the same size.
458
+ """
459
+
460
+ def __init__(self, config: ChatGLMConfig, layer_number, device=None):
461
+ super(SelfAttention, self).__init__()
462
+ self.layer_number = max(1, layer_number)
463
+
464
+ self.projection_size = config.kv_channels * config.num_attention_heads
465
+
466
+ # Per attention head and per partition values.
467
+ self.hidden_size_per_attention_head = self.projection_size // config.num_attention_heads
468
+ self.num_attention_heads_per_partition = config.num_attention_heads
469
+
470
+ self.multi_query_attention = config.multi_query_attention
471
+ self.qkv_hidden_size = 3 * self.projection_size
472
+ self.original_rope = config.original_rope
473
+ if self.multi_query_attention:
474
+ self.num_multi_query_groups_per_partition = config.multi_query_group_num
475
+ self.qkv_hidden_size = (
476
+ self.projection_size + 2 * self.hidden_size_per_attention_head * config.multi_query_group_num
477
+ )
478
+ self.query_key_value = nn.Linear(config.hidden_size, self.qkv_hidden_size,
479
+ bias=config.add_bias_linear or config.add_qkv_bias,
480
+ device=device, **_config_to_kwargs(config)
481
+ )
482
+
483
+ self.core_attention = CoreAttention(config, self.layer_number)
484
+
485
+ # Output.
486
+ self.dense = nn.Linear(self.projection_size, config.hidden_size, bias=config.add_bias_linear,
487
+ device=device, **_config_to_kwargs(config)
488
+ )
489
+
490
+ def _allocate_memory(self, inference_max_sequence_len, batch_size, device=None, dtype=None):
491
+ if self.multi_query_attention:
492
+ num_attention_heads = self.num_multi_query_groups_per_partition
493
+ else:
494
+ num_attention_heads = self.num_attention_heads_per_partition
495
+ return torch.empty(
496
+ inference_max_sequence_len,
497
+ batch_size,
498
+ num_attention_heads,
499
+ self.hidden_size_per_attention_head,
500
+ dtype=dtype,
501
+ device=device,
502
+ )
503
+
504
+ def forward(
505
+ self, hidden_states, attention_mask, rotary_pos_emb, kv_cache=None, use_cache=True
506
+ ):
507
+ # hidden_states: [b, sq, h]
508
+
509
+ # =================================================
510
+ # Pre-allocate memory for key-values for inference.
511
+ # =================================================
512
+ # =====================
513
+ # Query, Key, and Value
514
+ # =====================
515
+
516
+ # Attention heads [b, sq, h] --> [b, sq, (np * 3 * hn)]
517
+ mixed_x_layer = self.query_key_value(hidden_states)
518
+
519
+ if self.multi_query_attention:
520
+ (query_layer, key_layer, value_layer) = mixed_x_layer.split(
521
+ [
522
+ self.num_attention_heads_per_partition * self.hidden_size_per_attention_head,
523
+ self.num_multi_query_groups_per_partition * self.hidden_size_per_attention_head,
524
+ self.num_multi_query_groups_per_partition * self.hidden_size_per_attention_head,
525
+ ],
526
+ dim=-1,
527
+ )
528
+ query_layer = query_layer.view(
529
+ query_layer.size()[:-1] + (self.num_attention_heads_per_partition, self.hidden_size_per_attention_head)
530
+ )
531
+ key_layer = key_layer.view(
532
+ key_layer.size()[:-1] + (self.num_multi_query_groups_per_partition, self.hidden_size_per_attention_head)
533
+ )
534
+ value_layer = value_layer.view(
535
+ value_layer.size()[:-1]
536
+ + (self.num_multi_query_groups_per_partition, self.hidden_size_per_attention_head)
537
+ )
538
+ else:
539
+ new_tensor_shape = mixed_x_layer.size()[:-1] + \
540
+ (self.num_attention_heads_per_partition,
541
+ 3 * self.hidden_size_per_attention_head)
542
+ mixed_x_layer = mixed_x_layer.view(*new_tensor_shape)
543
+
544
+ # [b, sq, np, 3 * hn] --> 3 [b, sq, np, hn]
545
+ (query_layer, key_layer, value_layer) = split_tensor_along_last_dim(mixed_x_layer, 3)
546
+
547
+ # [b, sq, np, hn] -> [b, np, sq, hn]
548
+ query_layer, key_layer, value_layer = [k.transpose(1, 2) for k in [query_layer, key_layer, value_layer]]
549
+
550
+ # apply relative positional encoding (rotary embedding)
551
+ if rotary_pos_emb is not None:
552
+ query_layer = apply_rotary_pos_emb(query_layer, rotary_pos_emb)
553
+ key_layer = apply_rotary_pos_emb(key_layer, rotary_pos_emb)
554
+
555
+ # adjust key and value for inference
556
+ if kv_cache is not None:
557
+ cache_k, cache_v = kv_cache
558
+ key_layer = torch.cat((cache_k, key_layer), dim=2)
559
+ value_layer = torch.cat((cache_v, value_layer), dim=2)
560
+ if use_cache:
561
+ kv_cache = (key_layer, value_layer)
562
+ else:
563
+ kv_cache = None
564
+
565
+ if self.multi_query_attention:
566
+ key_layer = key_layer.unsqueeze(2)
567
+ key_layer = key_layer.expand(
568
+ -1, -1, self.num_attention_heads_per_partition // self.num_multi_query_groups_per_partition, -1, -1
569
+ )
570
+ key_layer = key_layer.contiguous().view(
571
+ key_layer.size()[:1] + (self.num_attention_heads_per_partition,) + key_layer.size()[3:]
572
+ )
573
+ value_layer = value_layer.unsqueeze(2)
574
+ value_layer = value_layer.expand(
575
+ -1, -1, self.num_attention_heads_per_partition // self.num_multi_query_groups_per_partition, -1, -1
576
+ )
577
+ value_layer = value_layer.contiguous().view(
578
+ value_layer.size()[:1] + (self.num_attention_heads_per_partition,) + value_layer.size()[3:]
579
+ )
580
+
581
+ # ==================================
582
+ # core attention computation
583
+ # ==================================
584
+
585
+ context_layer = self.core_attention(query_layer, key_layer, value_layer, attention_mask)
586
+
587
+ # =================
588
+ # Output. [sq, b, h]
589
+ # =================
590
+
591
+ output = self.dense(context_layer)
592
+
593
+ return output, kv_cache
594
+
595
+
596
+ def _config_to_kwargs(args):
597
+ common_kwargs = {
598
+ "dtype": args.torch_dtype,
599
+ }
600
+ return common_kwargs
601
+
602
+
603
+ class MLP(torch.nn.Module):
604
+ """MLP.
605
+
606
+ MLP will take the input with h hidden state, project it to 4*h
607
+ hidden dimension, perform nonlinear transformation, and project the
608
+ state back into h hidden dimension.
609
+ """
610
+
611
+ def __init__(self, config: ChatGLMConfig, device=None):
612
+ super(MLP, self).__init__()
613
+
614
+ self.add_bias = config.add_bias_linear
615
+
616
+ # Project to 4h. If using swiglu double the output width, see https://arxiv.org/pdf/2002.05202.pdf
617
+ self.dense_h_to_4h = nn.Linear(
618
+ config.hidden_size,
619
+ config.ffn_hidden_size * 2,
620
+ bias=self.add_bias,
621
+ device=device,
622
+ **_config_to_kwargs(config)
623
+ )
624
+
625
+ def swiglu(x):
626
+ x = torch.chunk(x, 2, dim=-1)
627
+ return F.silu(x[0]) * x[1]
628
+
629
+ self.activation_func = swiglu
630
+
631
+ # Project back to h.
632
+ self.dense_4h_to_h = nn.Linear(
633
+ config.ffn_hidden_size,
634
+ config.hidden_size,
635
+ bias=self.add_bias,
636
+ device=device,
637
+ **_config_to_kwargs(config)
638
+ )
639
+
640
+ def forward(self, hidden_states):
641
+ # [s, b, 4hp]
642
+ intermediate_parallel = self.dense_h_to_4h(hidden_states)
643
+ intermediate_parallel = self.activation_func(intermediate_parallel)
644
+ # [s, b, h]
645
+ output = self.dense_4h_to_h(intermediate_parallel)
646
+ return output
647
+
648
+
649
+ class GLMBlock(torch.nn.Module):
650
+ """A single transformer layer.
651
+
652
+ Transformer layer takes input with size [s, b, h] and returns an
653
+ output of the same size.
654
+ """
655
+
656
+ def __init__(self, config: ChatGLMConfig, layer_number, device=None):
657
+ super(GLMBlock, self).__init__()
658
+ self.layer_number = layer_number
659
+
660
+ self.apply_residual_connection_post_layernorm = config.apply_residual_connection_post_layernorm
661
+
662
+ self.fp32_residual_connection = config.fp32_residual_connection
663
+
664
+ LayerNormFunc = RMSNorm if config.rmsnorm else LayerNorm
665
+ # Layernorm on the input data.
666
+ self.input_layernorm = LayerNormFunc(config.hidden_size, eps=config.layernorm_epsilon, device=device,
667
+ dtype=config.torch_dtype)
668
+
669
+ # Self attention.
670
+ self.self_attention = SelfAttention(config, layer_number, device=device)
671
+ self.hidden_dropout = config.hidden_dropout
672
+
673
+ # Layernorm on the attention output
674
+ self.post_attention_layernorm = LayerNormFunc(config.hidden_size, eps=config.layernorm_epsilon, device=device,
675
+ dtype=config.torch_dtype)
676
+
677
+ # MLP
678
+ self.mlp = MLP(config, device=device)
679
+
680
+ def forward(
681
+ self, hidden_states, attention_mask, rotary_pos_emb, kv_cache=None, use_cache=True,
682
+ ):
683
+ # hidden_states: [s, b, h]
684
+
685
+ # Layer norm at the beginning of the transformer layer.
686
+ layernorm_output = self.input_layernorm(hidden_states)
687
+ # Self attention.
688
+ attention_output, kv_cache = self.self_attention(
689
+ layernorm_output,
690
+ attention_mask,
691
+ rotary_pos_emb,
692
+ kv_cache=kv_cache,
693
+ use_cache=use_cache
694
+ )
695
+
696
+ # Residual connection.
697
+ if self.apply_residual_connection_post_layernorm:
698
+ residual = layernorm_output
699
+ else:
700
+ residual = hidden_states
701
+
702
+ layernorm_input = torch.nn.functional.dropout(attention_output, p=self.hidden_dropout, training=self.training)
703
+ layernorm_input = residual + layernorm_input
704
+
705
+ # Layer norm post the self attention.
706
+ layernorm_output = self.post_attention_layernorm(layernorm_input)
707
+
708
+ # MLP.
709
+ mlp_output = self.mlp(layernorm_output)
710
+
711
+ # Second residual connection.
712
+ if self.apply_residual_connection_post_layernorm:
713
+ residual = layernorm_output
714
+ else:
715
+ residual = layernorm_input
716
+
717
+ output = torch.nn.functional.dropout(mlp_output, p=self.hidden_dropout, training=self.training)
718
+ output = residual + output
719
+
720
+ return output, kv_cache
721
+
722
+
723
+ class GLMTransformer(torch.nn.Module):
724
+ """Transformer class."""
725
+
726
+ def __init__(self, config: ChatGLMConfig, device=None):
727
+ super(GLMTransformer, self).__init__()
728
+
729
+ self.fp32_residual_connection = config.fp32_residual_connection
730
+ self.post_layer_norm = config.post_layer_norm
731
+
732
+ # Number of layers.
733
+ self.num_layers = config.num_layers
734
+
735
+ # Transformer layers.
736
+ def build_layer(layer_number):
737
+ return GLMBlock(config, layer_number, device=device)
738
+
739
+ self.layers = torch.nn.ModuleList([build_layer(i + 1) for i in range(self.num_layers)])
740
+
741
+ if self.post_layer_norm:
742
+ LayerNormFunc = RMSNorm if config.rmsnorm else LayerNorm
743
+ # Final layer norm before output.
744
+ self.final_layernorm = LayerNormFunc(config.hidden_size, eps=config.layernorm_epsilon, device=device,
745
+ dtype=config.torch_dtype)
746
+
747
+ self.gradient_checkpointing = False
748
+
749
+ def _get_layer(self, layer_number):
750
+ return self.layers[layer_number]
751
+
752
+ def forward(
753
+ self, hidden_states, attention_mask, rotary_pos_emb, kv_caches=None,
754
+ use_cache: Optional[bool] = True,
755
+ output_hidden_states: Optional[bool] = False,
756
+ ):
757
+ if not kv_caches:
758
+ kv_caches = [None for _ in range(self.num_layers)]
759
+ presents = () if use_cache else None
760
+ if self.gradient_checkpointing and self.training:
761
+ if use_cache:
762
+ logger.warning_once(
763
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..."
764
+ )
765
+ use_cache = False
766
+
767
+ all_self_attentions = None
768
+ all_hidden_states = () if output_hidden_states else None
769
+ for index in range(self.num_layers):
770
+ if output_hidden_states:
771
+ all_hidden_states = all_hidden_states + (hidden_states,)
772
+
773
+ layer = self._get_layer(index)
774
+ if self.gradient_checkpointing and self.training:
775
+ layer_ret = torch.utils.checkpoint.checkpoint(
776
+ layer,
777
+ hidden_states,
778
+ attention_mask,
779
+ rotary_pos_emb,
780
+ kv_caches[index],
781
+ use_cache,
782
+ use_reentrant=False
783
+ )
784
+ else:
785
+ layer_ret = layer(
786
+ hidden_states,
787
+ attention_mask,
788
+ rotary_pos_emb,
789
+ kv_cache=kv_caches[index],
790
+ use_cache=use_cache
791
+ )
792
+ hidden_states, kv_cache = layer_ret
793
+ if use_cache:
794
+ presents = presents + (kv_cache,)
795
+
796
+ if output_hidden_states:
797
+ all_hidden_states = all_hidden_states + (hidden_states,)
798
+
799
+ # Final layer norm.
800
+ if self.post_layer_norm:
801
+ hidden_states = self.final_layernorm(hidden_states)
802
+
803
+ return hidden_states, presents, all_hidden_states, all_self_attentions
804
+
805
+
806
+ class ChatGLMPreTrainedModel(PreTrainedModel):
807
+ """
808
+ An abstract class to handle weights initialization and
809
+ a simple interface for downloading and loading pretrained models.
810
+ """
811
+
812
+ is_parallelizable = False
813
+ supports_gradient_checkpointing = True
814
+ config_class = ChatGLMConfig
815
+ base_model_prefix = "transformer"
816
+ _no_split_modules = ["GLMBlock"]
817
+ _supports_flash_attn_2 = True
818
+ _supports_sdpa = True
819
+
820
+ def _init_weights(self, module: nn.Module):
821
+ """Initialize the weights."""
822
+ return
823
+
824
+ def get_masks(self, input_embeds, past_key_values, padding_mask=None):
825
+ batch_size, seq_length, embed_size = input_embeds.shape
826
+ full_attention_mask = torch.ones(batch_size, seq_length, seq_length, device=input_embeds.device)
827
+ full_attention_mask.tril_()
828
+ past_length = 0
829
+ if past_key_values:
830
+ past_length = past_key_values[0][0].shape[2]
831
+ if past_length:
832
+ full_attention_mask = torch.cat((torch.ones(batch_size, seq_length, past_length,
833
+ device=input_embeds.device), full_attention_mask), dim=-1)
834
+ if padding_mask is not None:
835
+ full_attention_mask = full_attention_mask * padding_mask.unsqueeze(1)
836
+ if not past_length and padding_mask is not None:
837
+ full_attention_mask -= padding_mask.unsqueeze(-1) - 1
838
+ full_attention_mask = (full_attention_mask < 0.5).bool()
839
+ full_attention_mask.unsqueeze_(1)
840
+ return full_attention_mask
841
+
842
+ def get_position_ids(self, input_ids, device):
843
+ batch_size, seq_length = input_ids.shape
844
+ position_ids = torch.arange(seq_length, dtype=torch.long, device=device).unsqueeze(0).repeat(batch_size, 1)
845
+ return position_ids
846
+
847
+ def get_multimodal_position_ids(self, input_ids, device):
848
+ batch_size, seq_length = input_ids.shape
849
+ position_ids = torch.arange(seq_length, dtype=torch.long, device=device).unsqueeze(0).repeat(batch_size, 1)
850
+
851
+ class Embedding(torch.nn.Module):
852
+ """Language model embeddings."""
853
+
854
+ def __init__(self, config: ChatGLMConfig, device=None):
855
+ super(Embedding, self).__init__()
856
+
857
+ self.hidden_size = config.hidden_size
858
+ # Word embeddings (parallel).
859
+ self.word_embeddings = nn.Embedding(
860
+ config.padded_vocab_size,
861
+ self.hidden_size,
862
+ dtype=config.torch_dtype,
863
+ device=device
864
+ )
865
+ self.fp32_residual_connection = config.fp32_residual_connection
866
+
867
+ def forward(self, input_ids):
868
+ # Embeddings.
869
+ words_embeddings = self.word_embeddings(input_ids)
870
+ embeddings = words_embeddings
871
+ # If the input flag for fp32 residual connection is set, convert for float.
872
+ if self.fp32_residual_connection:
873
+ embeddings = embeddings.float()
874
+ return embeddings
875
+
876
+
877
+ def is_empty(images_list: Optional[List[List[torch.Tensor]]]):
878
+ if images_list is None or len(images_list) == 0:
879
+ return True
880
+ for image_list in images_list:
881
+ if image_list is not None:
882
+ return False
883
+ return True
884
+
885
+
886
+ class ChatGLMModel(ChatGLMPreTrainedModel):
887
+ def __init__(self, config: ChatGLMConfig, device=None, empty_init=True):
888
+ super().__init__(config)
889
+ if empty_init:
890
+ init_method = skip_init
891
+ else:
892
+ init_method = default_init
893
+ init_kwargs = {}
894
+ if device is not None:
895
+ init_kwargs["device"] = device
896
+ self.embedding = init_method(Embedding, config, **init_kwargs)
897
+ self.num_layers = config.num_layers
898
+ self.multi_query_group_num = config.multi_query_group_num
899
+ self.kv_channels = config.kv_channels
900
+
901
+ # Rotary positional embeddings
902
+ self.seq_length = config.seq_length
903
+ rotary_dim = (
904
+ config.hidden_size // config.num_attention_heads if config.kv_channels is None else config.kv_channels
905
+ )
906
+
907
+ self.rotary_pos_emb = RotaryEmbedding(rotary_dim // 2, rope_ratio=config.rope_ratio,
908
+ original_impl=config.original_rope,
909
+ device=device, dtype=config.torch_dtype)
910
+ self.encoder = init_method(GLMTransformer, config, **init_kwargs)
911
+ self.output_layer = init_method(nn.Linear, config.hidden_size, config.padded_vocab_size, bias=False,
912
+ dtype=config.torch_dtype, **init_kwargs)
913
+ self.pre_seq_len = config.pre_seq_len
914
+ self.prefix_projection = config.prefix_projection
915
+ if self.pre_seq_len is not None:
916
+ for param in self.parameters():
917
+ param.requires_grad = False
918
+ self.prefix_tokens = torch.arange(self.pre_seq_len).long()
919
+ self.prefix_encoder = PrefixEncoder(config)
920
+ self.dropout = torch.nn.Dropout(0.1)
921
+
922
+ self.vision = EVA2CLIPModel(config)
923
+
924
+ def get_input_embeddings(self):
925
+ return self.embedding.word_embeddings
926
+
927
+ def set_input_embeddings(self, value):
928
+ self.embedding.word_embeddings = value
929
+
930
+ def get_prompt(self, batch_size, device, dtype=torch.half):
931
+ prefix_tokens = self.prefix_tokens.unsqueeze(0).expand(batch_size, -1).to(device)
932
+ past_key_values = self.prefix_encoder(prefix_tokens).type(dtype)
933
+ past_key_values = past_key_values.view(
934
+ batch_size,
935
+ self.pre_seq_len,
936
+ self.pre_seq_len,
937
+ self.num_layers * 2,
938
+ self.multi_query_group_num,
939
+ self.kv_channels
940
+ )
941
+ # seq_len, b, nh, hidden_size
942
+ past_key_values = self.dropout(past_key_values)
943
+ past_key_values = past_key_values.permute([2, 1, 0, 3, 4]).split(2)
944
+ return past_key_values
945
+
946
+ def forward(
947
+ self,
948
+ input_ids: torch.LongTensor = None,
949
+ images: torch.Tensor = None,
950
+ position_ids: Optional[torch.Tensor] = None,
951
+ attention_mask: Optional[torch.BoolTensor] = None,
952
+ full_attention_mask: Optional[torch.BoolTensor] = None,
953
+ past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
954
+ inputs_embeds: Optional[torch.Tensor] = None,
955
+ use_cache: Optional[bool] = None,
956
+ output_hidden_states: Optional[bool] = None,
957
+ return_dict: Optional[bool] = None,
958
+ ) -> Union[Tuple, BaseModelOutputWithPast]:
959
+ """take care of image_encode, position_ids and (attention_mask = None is fine)"""
960
+
961
+ # generate mode with past_key_values. the image features are already mapped
962
+ if past_key_values is None:
963
+ # not allow for inputs_embeds, because we want to process image feature
964
+ assert input_ids is not None and inputs_embeds is None, f"{input_ids} {inputs_embeds}"
965
+ if not is_empty(images): # multi-modality
966
+ image_size: int = self.config.vision_config['image_size']
967
+ patch_size: int = self.config.vision_config['patch_size']
968
+ num_patches = (image_size // patch_size // 2) ** 2
969
+ assert len(input_ids) == len(images), f"{len(input_ids)} {len(images)}"
970
+ inputs_embeds = self.embedding(input_ids)
971
+
972
+ images = images.to(dtype=inputs_embeds.dtype)
973
+ images_features = self.vision(images)
974
+
975
+ if position_ids is None:
976
+ position_ids = self.get_position_ids(input_ids, device=inputs_embeds.device)
977
+ new_input_embeds, new_position_ids = [], []
978
+
979
+ for i in range(len(input_ids)):
980
+ input_id = input_ids[i].tolist()
981
+ boi_token_pos, eoi_token_pos = input_id.index(self.config.boi_token_id), input_id.index(
982
+ self.config.eoi_token_id)
983
+ assert eoi_token_pos - boi_token_pos == 2
984
+ new_input_embeds.append(torch.cat(
985
+ (inputs_embeds[i, :boi_token_pos], images_features[i].to(inputs_embeds.device),
986
+ inputs_embeds[i, eoi_token_pos + 1:])))
987
+ new_position_ids.append(torch.cat(
988
+ (position_ids[i, :boi_token_pos + 1], position_ids[i, boi_token_pos + 1].repeat(num_patches),
989
+ position_ids[i, eoi_token_pos:])
990
+ ))
991
+ inputs_embeds = torch.stack(new_input_embeds, dim=0)
992
+ position_ids = torch.stack(new_position_ids, dim=0)
993
+
994
+ output_hidden_states = (
995
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
996
+ )
997
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
998
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
999
+
1000
+ batch_size, seq_length = input_ids.shape
1001
+
1002
+ if inputs_embeds is None:
1003
+ inputs_embeds = self.embedding(input_ids)
1004
+
1005
+ if self.pre_seq_len is not None:
1006
+ if past_key_values is None:
1007
+ past_key_values = self.get_prompt(batch_size=batch_size, device=input_ids.device,
1008
+ dtype=inputs_embeds.dtype)
1009
+ if attention_mask is not None:
1010
+ attention_mask = torch.cat([attention_mask.new_ones((batch_size, self.pre_seq_len)),
1011
+ attention_mask], dim=-1)
1012
+
1013
+ if full_attention_mask is None:
1014
+ if (attention_mask is not None and not attention_mask.all()) or (past_key_values and seq_length != 1):
1015
+ if self.training:
1016
+ # https://github.com/THUDM/GLM-4/issues/264
1017
+ new_input_ids, new_attention_mask = [], []
1018
+ for i in range(len(input_ids)):
1019
+ input_id = input_ids[i].tolist()
1020
+ boi_token_pos, eoi_token_pos = input_id.index(self.config.boi_token_id), input_id.index(self.config.eoi_token_id)
1021
+ assert eoi_token_pos - boi_token_pos == 2
1022
+
1023
+ new_attention_mask.append(torch.cat(
1024
+ (attention_mask[i, :boi_token_pos + 1], torch.ones(num_patches).to(attention_mask.device),
1025
+ attention_mask[i, eoi_token_pos:])))
1026
+
1027
+ new_input_ids.append(torch.cat(
1028
+ (input_ids[i, :boi_token_pos + 1], input_ids[i, -1].repeat(num_patches),
1029
+ input_ids[i, eoi_token_pos:])))
1030
+
1031
+ attention_mask = torch.stack(new_attention_mask, dim=0)
1032
+ input_ids = torch.stack(new_input_ids, dim=0)
1033
+ inputs_embeds = self.embedding(input_ids)
1034
+
1035
+ full_attention_mask = self.get_masks(inputs_embeds, past_key_values, padding_mask=attention_mask)
1036
+
1037
+ # Rotary positional embeddings
1038
+ rotary_pos_emb = self.rotary_pos_emb(self.seq_length)
1039
+
1040
+ if position_ids is not None:
1041
+ rotary_pos_emb = rotary_pos_emb[position_ids]
1042
+ else:
1043
+ rotary_pos_emb = rotary_pos_emb[None, :seq_length]
1044
+
1045
+ # Run encoder.
1046
+ hidden_states, presents, all_hidden_states, all_self_attentions = self.encoder(
1047
+ inputs_embeds, full_attention_mask, rotary_pos_emb=rotary_pos_emb,
1048
+ kv_caches=past_key_values, use_cache=use_cache, output_hidden_states=output_hidden_states
1049
+ )
1050
+
1051
+ if not return_dict:
1052
+ return tuple(v for v in [hidden_states, presents, all_hidden_states, all_self_attentions] if v is not None)
1053
+
1054
+ return BaseModelOutputWithPast(
1055
+ last_hidden_state=hidden_states,
1056
+ past_key_values=presents,
1057
+ hidden_states=all_hidden_states,
1058
+ attentions=all_self_attentions,
1059
+ )
1060
+
1061
+
1062
+ def _history_to_prompt(history, query):
1063
+ prompt = ''
1064
+ flag = False
1065
+ for i, (old_query, response) in enumerate(history):
1066
+ prompt += ('<|user|>' if flag else '') + old_query + "<|assistant|>" + response + "<|endoftext|>"
1067
+ flag = True
1068
+ prompt += '{}{}<|assistant|>'.format('<|user|>' if flag else '', query)
1069
+ return prompt
1070
+
1071
+
1072
+ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
1073
+ def __init__(self, config: ChatGLMConfig, empty_init=True, device=None):
1074
+ super().__init__(config)
1075
+
1076
+ self.max_sequence_length = config.max_length
1077
+ self.transformer = ChatGLMModel(config, empty_init=empty_init, device=device)
1078
+ self.config = config
1079
+
1080
+ def _update_model_kwargs_for_generation(
1081
+ self,
1082
+ outputs: ModelOutput,
1083
+ model_kwargs: Dict[str, Any],
1084
+ is_encoder_decoder: bool = False,
1085
+ ) -> Dict[str, Any]:
1086
+ # update past_key_values
1087
+ cache_name, cache = self._extract_past_from_model_output(outputs)
1088
+ model_kwargs[cache_name] = cache
1089
+
1090
+ # update attention mask
1091
+ if "attention_mask" in model_kwargs:
1092
+ attention_mask = model_kwargs["attention_mask"]
1093
+ model_kwargs["attention_mask"] = torch.cat(
1094
+ [attention_mask, attention_mask.new_ones((attention_mask.shape[0], 1))], dim=-1
1095
+ )
1096
+
1097
+ # update position ids
1098
+ if "position_ids" in model_kwargs:
1099
+ position_ids = model_kwargs["position_ids"]
1100
+ new_position_id = position_ids[..., -1:].clone()
1101
+ new_position_id += 1
1102
+ model_kwargs["position_ids"] = torch.cat(
1103
+ [position_ids, new_position_id], dim=-1
1104
+ )
1105
+
1106
+ model_kwargs["is_first_forward"] = False
1107
+ return model_kwargs
1108
+
1109
+ def prepare_inputs_for_generation(
1110
+ self,
1111
+ input_ids: torch.LongTensor,
1112
+ images: Optional[torch.Tensor] = None,
1113
+ past_key_values: Optional[torch.Tensor] = None,
1114
+ attention_mask: Optional[torch.Tensor] = None,
1115
+ position_ids: Optional[torch.Tensor] = None,
1116
+ use_cache: Optional[bool] = None,
1117
+ is_first_forward: bool = True,
1118
+ **kwargs
1119
+ ) -> dict:
1120
+ # only last token for input_ids if past is not None
1121
+ if position_ids is None:
1122
+ position_ids = self.get_position_ids(input_ids, device=input_ids.device)
1123
+ if attention_mask is not None:
1124
+ image_size: int = self.config.vision_config['image_size']
1125
+ patch_size: int = self.config.vision_config['patch_size']
1126
+ num_patches = (image_size // patch_size // 2) ** 2
1127
+ new_attention_masks = []
1128
+
1129
+ # if not image, use this default id
1130
+ eoi_token_pos = 6
1131
+ boi_token_pos = 4
1132
+
1133
+ for i in range(len(input_ids)):
1134
+ input_id = input_ids[i].tolist()
1135
+ if not is_empty(images):
1136
+ boi_token_pos, eoi_token_pos = input_id.index(self.config.boi_token_id), input_id.index(
1137
+ self.config.eoi_token_id)
1138
+ assert eoi_token_pos - boi_token_pos == 2
1139
+ new_attention_masks.append(torch.cat(
1140
+ (attention_mask[i, :boi_token_pos + 1], attention_mask.new_ones(num_patches),
1141
+ attention_mask[i, eoi_token_pos:])
1142
+ ))
1143
+ attention_mask = torch.stack(new_attention_masks, dim=0)
1144
+ if not is_first_forward:
1145
+ if past_key_values is not None:
1146
+ position_ids = position_ids[..., -1:]
1147
+ input_ids = input_ids[:, -1:]
1148
+ return {
1149
+ "input_ids": input_ids,
1150
+ "images": images,
1151
+ "past_key_values": past_key_values,
1152
+ "position_ids": position_ids,
1153
+ "attention_mask": attention_mask,
1154
+ "return_last_logit": True,
1155
+ "use_cache": use_cache
1156
+ }
1157
+
1158
+ def forward(
1159
+ self,
1160
+ input_ids: Optional[torch.Tensor] = None,
1161
+ images: List[List[torch.Tensor]] = None,
1162
+ position_ids: Optional[torch.Tensor] = None,
1163
+ attention_mask: Optional[torch.Tensor] = None,
1164
+ past_key_values: Optional[Tuple[torch.FloatTensor]] = None,
1165
+ inputs_embeds: Optional[torch.Tensor] = None,
1166
+ labels: Optional[torch.Tensor] = None,
1167
+ use_cache: Optional[bool] = None,
1168
+ output_attentions: Optional[bool] = None,
1169
+ output_hidden_states: Optional[bool] = None,
1170
+ return_dict: Optional[bool] = None,
1171
+ return_last_logit: Optional[bool] = False,
1172
+ ):
1173
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
1174
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1175
+
1176
+ transformer_outputs = self.transformer(
1177
+ input_ids=input_ids,
1178
+ images=images,
1179
+ position_ids=position_ids,
1180
+ attention_mask=attention_mask,
1181
+ past_key_values=past_key_values,
1182
+ inputs_embeds=inputs_embeds,
1183
+ use_cache=use_cache,
1184
+ output_hidden_states=output_hidden_states,
1185
+ return_dict=return_dict,
1186
+ )
1187
+
1188
+ hidden_states = transformer_outputs[0]
1189
+ if return_last_logit:
1190
+ hidden_states = hidden_states[:, -1:]
1191
+ lm_logits = self.transformer.output_layer(hidden_states)
1192
+
1193
+ loss = None
1194
+ if labels is not None:
1195
+ new_labels = []
1196
+ for i in range(len(input_ids)):
1197
+ input_id = input_ids[i].tolist()
1198
+ boi_token_pos, eoi_token_pos = input_id.index(self.config.boi_token_id), input_id.index(
1199
+ self.config.eoi_token_id)
1200
+ assert eoi_token_pos - boi_token_pos == 2
1201
+
1202
+ new_labels.append(torch.cat(
1203
+ (
1204
+ labels[i, :boi_token_pos + 1],
1205
+ torch.tensor([-100]).to(labels.device).to(labels.dtype).repeat(1600),
1206
+ labels[i, eoi_token_pos:])))
1207
+
1208
+ labels = torch.stack(new_labels, dim=0)
1209
+ lm_logits = lm_logits.to(torch.float32)
1210
+ shift_logits = lm_logits[..., :-1, :].contiguous()
1211
+ shift_labels = labels[..., 1:].contiguous()
1212
+ loss_fct = CrossEntropyLoss(ignore_index=-100)
1213
+ loss = loss_fct(shift_logits.view(-1, shift_logits.size(-1)), shift_labels.view(-1))
1214
+
1215
+ lm_logits = lm_logits.to(hidden_states.dtype)
1216
+ loss = loss.to(hidden_states.dtype)
1217
+
1218
+ if not return_dict:
1219
+ output = (lm_logits,) + transformer_outputs[1:]
1220
+ return ((loss,) + output) if loss is not None else output
1221
+
1222
+ return CausalLMOutputWithPast(
1223
+ loss=loss,
1224
+ logits=lm_logits,
1225
+ past_key_values=transformer_outputs.past_key_values,
1226
+ hidden_states=transformer_outputs.hidden_states,
1227
+ attentions=transformer_outputs.attentions,
1228
+ )
1229
+
1230
+ @staticmethod
1231
+ def _reorder_cache(
1232
+ past: Tuple[Tuple[torch.Tensor, torch.Tensor], ...], beam_idx: torch.LongTensor
1233
+ ) -> Tuple[Tuple[torch.Tensor, torch.Tensor], ...]:
1234
+ """
1235
+ This function is used to re-order the `past_key_values` cache if [`~PreTrainedModel.beam_search`] or
1236
+ [`~PreTrainedModel.beam_sample`] is called. This is required to match `past_key_values` with the correct
1237
+ beam_idx at every generation step.
1238
+
1239
+ Output shares the same memory storage as `past`.
1240
+ """
1241
+ return tuple(
1242
+ (
1243
+ layer_past[0].index_select(0, beam_idx.to(layer_past[0].device)),
1244
+ layer_past[1].index_select(0, beam_idx.to(layer_past[1].device)),
1245
+ )
1246
+ for layer_past in past
1247
+ )
1248
+
1249
+ class ChatGLMForSequenceClassification(ChatGLMPreTrainedModel):
1250
+ def __init__(self, config: ChatGLMConfig, empty_init=True, device=None):
1251
+ super().__init__(config)
1252
+
1253
+ self.num_labels = config.num_labels
1254
+ self.transformer = ChatGLMModel(config, empty_init=empty_init, device=device)
1255
+
1256
+ self.classifier_head = nn.Linear(config.hidden_size, config.num_labels, bias=True, dtype=torch.half)
1257
+ if config.classifier_dropout is not None:
1258
+ self.dropout = nn.Dropout(config.classifier_dropout)
1259
+ else:
1260
+ self.dropout = None
1261
+ self.config = config
1262
+
1263
+ def forward(
1264
+ self,
1265
+ input_ids: Optional[torch.LongTensor] = None,
1266
+ position_ids: Optional[torch.LongTensor] = None,
1267
+ attention_mask: Optional[torch.Tensor] = None,
1268
+ full_attention_mask: Optional[torch.Tensor] = None,
1269
+ past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
1270
+ inputs_embeds: Optional[torch.LongTensor] = None,
1271
+ labels: Optional[torch.LongTensor] = None,
1272
+ use_cache: Optional[bool] = None,
1273
+ output_hidden_states: Optional[bool] = None,
1274
+ return_dict: Optional[bool] = None,
1275
+ ) -> Union[Tuple[torch.Tensor, ...], SequenceClassifierOutputWithPast]:
1276
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1277
+
1278
+ transformer_outputs = self.transformer(
1279
+ input_ids=input_ids,
1280
+ position_ids=position_ids,
1281
+ attention_mask=attention_mask,
1282
+ full_attention_mask=full_attention_mask,
1283
+ past_key_values=past_key_values,
1284
+ inputs_embeds=inputs_embeds,
1285
+ use_cache=use_cache,
1286
+ output_hidden_states=output_hidden_states,
1287
+ return_dict=return_dict,
1288
+ )
1289
+
1290
+ hidden_states = transformer_outputs[0]
1291
+ pooled_hidden_states = hidden_states[-1]
1292
+ if self.dropout is not None:
1293
+ pooled_hidden_states = self.dropout(pooled_hidden_states)
1294
+ logits = self.classifier_head(pooled_hidden_states)
1295
+
1296
+ loss = None
1297
+ if labels is not None:
1298
+ if self.config.problem_type is None:
1299
+ if self.num_labels == 1:
1300
+ self.config.problem_type = "regression"
1301
+ elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
1302
+ self.config.problem_type = "single_label_classification"
1303
+ else:
1304
+ self.config.problem_type = "multi_label_classification"
1305
+
1306
+ if self.config.problem_type == "regression":
1307
+ loss_fct = MSELoss()
1308
+ if self.num_labels == 1:
1309
+ loss = loss_fct(logits.squeeze().float(), labels.squeeze())
1310
+ else:
1311
+ loss = loss_fct(logits.float(), labels)
1312
+ elif self.config.problem_type == "single_label_classification":
1313
+ loss_fct = CrossEntropyLoss()
1314
+ loss = loss_fct(logits.view(-1, self.num_labels).float(), labels.view(-1))
1315
+ elif self.config.problem_type == "multi_label_classification":
1316
+ loss_fct = BCEWithLogitsLoss()
1317
+ loss = loss_fct(logits.float(), labels.view(-1, self.num_labels))
1318
+
1319
+ if not return_dict:
1320
+ output = (logits,) + transformer_outputs[1:]
1321
+ return ((loss,) + output) if loss is not None else output
1322
+
1323
+ return SequenceClassifierOutputWithPast(
1324
+ loss=loss,
1325
+ logits=logits,
1326
+ past_key_values=transformer_outputs.past_key_values,
1327
+ hidden_states=transformer_outputs.hidden_states,
1328
+ attentions=transformer_outputs.attentions,
1329
+ )
quantization_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": 128,
4
+ "sym": true,
5
+ "data_type": "int",
6
+ "enable_quanted_input": true,
7
+ "enable_minmax_tuning": true,
8
+ "seqlen": 2048,
9
+ "batch_size": 8,
10
+ "scale_dtype": "torch.float16",
11
+ "lr": 0.001,
12
+ "minmax_lr": 0.001,
13
+ "gradient_accumulate_steps": 1,
14
+ "iters": 1000,
15
+ "amp": true,
16
+ "nsamples": 512,
17
+ "low_gpu_mem_usage": false,
18
+ "to_quant_block_names": "transformer.encoder.layers",
19
+ "enable_norm_bias_tuning": false,
20
+ "dataset": "NeelNanda/pile-10k",
21
+ "autoround_version": "0.4.2.dev",
22
+ "quant_method": "intel/auto-round",
23
+ "backend": "auto_round:gptq:exllamav2"
24
+ }
visual.py ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from torch import nn
3
+ from argparse import Namespace
4
+ import torch.nn.functional as F
5
+ from transformers.activations import ACT2FN
6
+ import math
7
+ from torch.nn import LayerNorm
8
+
9
+
10
+ def standard_attention(query_layer, key_layer, value_layer, scaling_attention_score=True):
11
+ if scaling_attention_score:
12
+ query_layer = query_layer / math.sqrt(query_layer.shape[-1])
13
+ attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))
14
+
15
+ attention_probs = F.softmax(attention_scores, dim=-1)
16
+
17
+ context_layer = torch.matmul(attention_probs, value_layer)
18
+ return context_layer
19
+
20
+
21
+ def attention_fn_default(query_layer, key_layer, value_layer, scaling_attention_score=True):
22
+ if int(torch.__version__.split('.')[0]) >= 2 and scaling_attention_score:
23
+ # Pytorch 2.0 attention uses very much memory if attention_mask is float, and has NaN bug if attention_mask is None.
24
+ attn_output = torch.nn.functional.scaled_dot_product_attention(
25
+ query_layer, key_layer, value_layer,
26
+ attn_mask=None,
27
+ dropout_p=0.,
28
+ is_causal=False
29
+ )
30
+ return attn_output
31
+ else:
32
+ return standard_attention(
33
+ query_layer, key_layer, value_layer, scaling_attention_score=scaling_attention_score
34
+ )
35
+
36
+
37
+ class PatchEmbedding(nn.Module):
38
+ def __init__(self, config):
39
+ super().__init__()
40
+ self.proj = nn.Conv2d(config.in_channels, config.hidden_size, kernel_size=config.patch_size,
41
+ stride=config.patch_size)
42
+ self.cls_embedding = nn.Parameter(torch.zeros(1, config.hidden_size))
43
+ self.position_embedding = nn.Embedding(config.num_positions, config.hidden_size)
44
+
45
+ def forward(self, images: "tensor(B, C, H, W)") -> "tensor(B, L, D)":
46
+ x = self.proj(images)
47
+ x = x.flatten(2).transpose(1, 2)
48
+ cls_token = self.cls_embedding.expand(x.shape[0], -1, -1)
49
+ x = torch.cat((cls_token, x), dim=1)
50
+ x += self.position_embedding.weight.unsqueeze(0)
51
+ return x
52
+
53
+
54
+ class Attention(nn.Module):
55
+ def __init__(self, config):
56
+ super().__init__()
57
+ self.num_heads = config.num_heads
58
+ head_dim = config.hidden_size // config.num_heads
59
+ self.scale = head_dim ** -0.5
60
+ self.query_key_value = nn.Linear(config.hidden_size, config.hidden_size * 3)
61
+ self.dense = nn.Linear(config.hidden_size, config.hidden_size)
62
+ self.output_dropout = torch.nn.Dropout(config.dropout_prob)
63
+
64
+ def forward(self, x: "tensor(B, L, D)") -> "tensor(B, L, D)":
65
+ B, L, _ = x.shape
66
+ qkv = self.query_key_value(x)
67
+ qkv = qkv.reshape(B, L, 3, self.num_heads, -1).permute(2, 0, 3, 1, 4) # 3, B, H, L, D
68
+ q, k, v = qkv[0], qkv[1], qkv[2]
69
+
70
+ out = attention_fn_default(
71
+ q, k, v
72
+ )
73
+ output = self.dense(out.transpose(1, 2).reshape(B, L, -1))
74
+ output = self.output_dropout(output)
75
+ return output
76
+
77
+ def attention(self, q, k, v):
78
+ attn_weights = torch.matmul(q * self.scale, k.transpose(-2, -1))
79
+ attn_weights = attn_weights.softmax(dim=-1)
80
+ output = torch.matmul(attn_weights, v)
81
+ return output
82
+
83
+
84
+ class MLP(nn.Module):
85
+ def __init__(self, config):
86
+ super().__init__()
87
+ self.config = config
88
+ self.activation_fn = ACT2FN[config.hidden_act]
89
+ self.fc1 = nn.Linear(config.hidden_size, config.intermediate_size)
90
+ self.fc2 = nn.Linear(config.intermediate_size, config.hidden_size)
91
+
92
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
93
+ x = self.fc1(x)
94
+ x = self.activation_fn(x)
95
+ x = self.fc2(x)
96
+ return x
97
+
98
+
99
+ class TransformerLayer(nn.Module):
100
+ def __init__(self, config):
101
+ super().__init__()
102
+ self.input_layernorm = LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
103
+ self.attention = Attention(config)
104
+ self.mlp = MLP(config)
105
+ self.post_attention_layernorm = LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
106
+
107
+ def forward(self, hidden_states):
108
+ attention_input = hidden_states
109
+ attention_output = self.input_layernorm(self.attention(attention_input))
110
+ hidden_states = attention_input + attention_output
111
+ mlp_input = hidden_states
112
+
113
+ # https://github.com/THUDM/GLM-4/issues/350
114
+ mlp_output = self.post_attention_layernorm(self.mlp(mlp_input)).to(mlp_input.device)
115
+ output = mlp_input + mlp_output
116
+ return output
117
+
118
+
119
+ class Transformer(nn.Module):
120
+ def __init__(self, config):
121
+ super().__init__()
122
+ self.layers = nn.ModuleList([TransformerLayer(config) for _ in range(config.num_hidden_layers)])
123
+
124
+ def forward(self, hidden_states):
125
+ for layer_module in self.layers:
126
+ hidden_states = layer_module(hidden_states)
127
+ return hidden_states
128
+
129
+
130
+ class GLU(nn.Module):
131
+ def __init__(self, config, in_features):
132
+ super().__init__()
133
+ self.linear_proj = nn.Linear(in_features, config.hidden_size, bias=False)
134
+ self.norm1 = nn.LayerNorm(config.hidden_size)
135
+ self.act1 = nn.GELU()
136
+ self.act2 = nn.functional.silu
137
+ self.dense_h_to_4h = nn.Linear(config.hidden_size, config.ffn_hidden_size, bias=False)
138
+ self.gate_proj = nn.Linear(config.hidden_size, config.ffn_hidden_size, bias=False)
139
+ self.dense_4h_to_h = nn.Linear(config.ffn_hidden_size, config.hidden_size, bias=False)
140
+
141
+ def forward(self, x):
142
+ x = self.linear_proj(x)
143
+ x = self.act1(self.norm1(x))
144
+ x = self.act2(self.gate_proj(x)) * self.dense_h_to_4h(x)
145
+ x = self.dense_4h_to_h(x)
146
+ return x
147
+
148
+
149
+ class EVA2CLIPModel(nn.Module):
150
+ def __init__(self, config):
151
+ super().__init__()
152
+ vision_config = Namespace(**config.vision_config)
153
+ self.patch_embedding = PatchEmbedding(vision_config)
154
+ self.transformer = Transformer(vision_config)
155
+ self.linear_proj = GLU(config, in_features=config.hidden_size)
156
+ self.conv = nn.Conv2d(in_channels=vision_config.hidden_size, out_channels=config.hidden_size, kernel_size=2,
157
+ stride=2)
158
+ self.boi = nn.Parameter(torch.zeros(1, 1, config.hidden_size))
159
+ self.eoi = nn.Parameter(torch.zeros(1, 1, config.hidden_size))
160
+ self.scaling_factor = vision_config.scaling_factor
161
+
162
+ def forward(self, images: "tensor(B, C, H, W)") -> "tensor(B, L, D)":
163
+ x = self.patch_embedding(images)
164
+ x = self.transformer(x)
165
+ x = x[:, 1:]
166
+
167
+ b, s, h = x.shape
168
+ grid_size = int(s ** 0.5)
169
+ x = x.view(b, grid_size, grid_size, h).permute(0, 3, 1, 2)
170
+ x = self.conv(x)
171
+
172
+ x = x.flatten(2).transpose(1, 2)
173
+ x = self.linear_proj(x)
174
+
175
+ # https://github.com/THUDM/GLM-4/issues/350
176
+ boi = self.boi.expand(x.shape[0], -1, -1).to(x.device)
177
+ eoi = self.eoi.expand(x.shape[0], -1, -1).to(x.device)
178
+ x = torch.cat((boi, x, eoi), dim=1)
179
+ x = x / self.scaling_factor
180
+ return x