TheBloke commited on
Commit
a99ad1e
1 Parent(s): 6c19696

AWQ model commit

Browse files
config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/workspace/process/lightonai_alfred-40b-1023/source",
3
+ "alibi": false,
4
+ "apply_residual_connection_post_layernorm": false,
5
+ "architectures": [
6
+ "RWForCausalLM"
7
+ ],
8
+ "attention_dropout": 0.0,
9
+ "auto_map": {
10
+ "AutoConfig": "configuration_RW.RWConfig",
11
+ "AutoModelForCausalLM": "modeling_RW.RWForCausalLM"
12
+ },
13
+ "bias": false,
14
+ "bos_token_id": 11,
15
+ "embedding_scaling_factor": 4,
16
+ "eos_token_id": 11,
17
+ "hidden_dropout": 0.0,
18
+ "hidden_size": 8192,
19
+ "initializer_range": 0.02,
20
+ "layer_norm_epsilon": 1e-05,
21
+ "model_type": "RefinedWeb",
22
+ "multi_query": true,
23
+ "n_head": 128,
24
+ "n_head_kv": 8,
25
+ "n_layer": 60,
26
+ "ntk_scaling_factor": 5,
27
+ "pad_token_id": 0,
28
+ "parallel_attn": true,
29
+ "pretraining_tp": 1,
30
+ "quantization_config": {
31
+ "bits": 4,
32
+ "group_size": 128,
33
+ "quant_method": "awq",
34
+ "version": "gemm",
35
+ "zero_point": true
36
+ },
37
+ "single_ln": false,
38
+ "torch_dtype": "float16",
39
+ "transformers_version": "4.35.0",
40
+ "use_cache": true,
41
+ "vanilla_scaling_factor": null,
42
+ "vocab_size": 65024
43
+ }
configuration_RW.py ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2022 the Big Science Workshop and HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ """ Bloom configuration"""
16
+ from transformers.configuration_utils import PretrainedConfig
17
+ from transformers.utils import logging
18
+
19
+
20
+ logger = logging.get_logger(__name__)
21
+
22
+
23
+ class RWConfig(PretrainedConfig):
24
+ model_type = "RefinedWeb"
25
+ keys_to_ignore_at_inference = ["past_key_values"]
26
+ attribute_map = {
27
+ "num_hidden_layers": "n_layer",
28
+ "num_attention_heads": "n_head",
29
+ }
30
+
31
+ def __init__(
32
+ self,
33
+ vocab_size=250880,
34
+ hidden_size=64,
35
+ n_layer=2,
36
+ n_head=8,
37
+ layer_norm_epsilon=1e-5,
38
+ initializer_range=0.02,
39
+ use_cache=True,
40
+ bos_token_id=1,
41
+ eos_token_id=2,
42
+ apply_residual_connection_post_layernorm=False,
43
+ hidden_dropout=0.0,
44
+ attention_dropout=0.0,
45
+ multi_query=False,
46
+ alibi=False,
47
+ bias=False,
48
+ parallel_attn=False,
49
+ single_ln=False,
50
+ n_head_kv=1,
51
+ ntk_scaling_factor=None,
52
+ vanilla_scaling_factor=None,
53
+ embedding_scaling_factor=None,
54
+ **kwargs,
55
+ ):
56
+ self.vocab_size = vocab_size
57
+ # Backward compatibility with n_embed kwarg
58
+ n_embed = kwargs.pop("n_embed", None)
59
+ self.hidden_size = hidden_size if n_embed is None else n_embed
60
+ self.n_layer = n_layer
61
+ self.n_head = n_head
62
+ self.layer_norm_epsilon = layer_norm_epsilon
63
+ self.initializer_range = initializer_range
64
+ self.use_cache = use_cache
65
+ self.apply_residual_connection_post_layernorm = apply_residual_connection_post_layernorm
66
+ self.hidden_dropout = hidden_dropout
67
+ self.attention_dropout = attention_dropout
68
+
69
+ self.bos_token_id = bos_token_id
70
+ self.eos_token_id = eos_token_id
71
+ self.multi_query = multi_query
72
+ self.alibi = alibi
73
+ self.bias = bias
74
+ self.parallel_attn = parallel_attn
75
+ self.single_ln = single_ln
76
+ self.n_head_kv = n_head_kv
77
+ self.ntk_scaling_factor = ntk_scaling_factor
78
+ self.vanilla_scaling_factor = vanilla_scaling_factor
79
+ self.embedding_scaling_factor = embedding_scaling_factor
80
+
81
+ assert not alibi, "Function of alibi has not been verified yet"
82
+ assert self.vanilla_scaling_factor is None or self.ntk_scaling_factor is None, "Both scaling modes cannot be used concurrently"
83
+
84
+ super().__init__(bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs)
85
+
86
+ @property
87
+ def head_dim(self):
88
+ return self.hidden_size // self.n_head
89
+
90
+ @property
91
+ def rotary(self):
92
+ return not self.alibi
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 11,
4
+ "eos_token_id": 11,
5
+ "transformers_version": "4.31.0"
6
+ }
model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a031e11e2a344f8c3c0bac086a2ea2ee3ccccc7e6575e51e44d8028cb26e64e2
3
+ size 11031788568
model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:354b62cc30cb9336ceda42e7595ebe63b51ff75ec057b488fd72c4a4cc047693
3
+ size 9886158176
model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1a2406bae21592ebf7cbb290577dbbc8665a1db549a5178a30c18e3ae12cc292
3
+ size 2397417352
model.safetensors.index.json ADDED
@@ -0,0 +1,971 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 22249897984
4
+ },
5
+ "weight_map": {
6
+ "transformer.word_embeddings.weight": "model-00001-of-00003.safetensors",
7
+ "transformer.h.0.ln_attn.weight": "model-00001-of-00003.safetensors",
8
+ "transformer.h.0.ln_attn.bias": "model-00001-of-00003.safetensors",
9
+ "transformer.h.0.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
10
+ "transformer.h.0.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
11
+ "transformer.h.0.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
12
+ "transformer.h.0.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
13
+ "transformer.h.0.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
14
+ "transformer.h.0.self_attention.dense.scales": "model-00001-of-00003.safetensors",
15
+ "transformer.h.0.ln_mlp.weight": "model-00001-of-00003.safetensors",
16
+ "transformer.h.0.ln_mlp.bias": "model-00001-of-00003.safetensors",
17
+ "transformer.h.0.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
18
+ "transformer.h.0.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
19
+ "transformer.h.0.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
20
+ "transformer.h.0.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
21
+ "transformer.h.0.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
22
+ "transformer.h.0.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
23
+ "transformer.h.1.ln_attn.weight": "model-00001-of-00003.safetensors",
24
+ "transformer.h.1.ln_attn.bias": "model-00001-of-00003.safetensors",
25
+ "transformer.h.1.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
26
+ "transformer.h.1.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
27
+ "transformer.h.1.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
28
+ "transformer.h.1.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
29
+ "transformer.h.1.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
30
+ "transformer.h.1.self_attention.dense.scales": "model-00001-of-00003.safetensors",
31
+ "transformer.h.1.ln_mlp.weight": "model-00001-of-00003.safetensors",
32
+ "transformer.h.1.ln_mlp.bias": "model-00001-of-00003.safetensors",
33
+ "transformer.h.1.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
34
+ "transformer.h.1.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
35
+ "transformer.h.1.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
36
+ "transformer.h.1.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
37
+ "transformer.h.1.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
38
+ "transformer.h.1.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
39
+ "transformer.h.2.ln_attn.weight": "model-00001-of-00003.safetensors",
40
+ "transformer.h.2.ln_attn.bias": "model-00001-of-00003.safetensors",
41
+ "transformer.h.2.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
42
+ "transformer.h.2.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
43
+ "transformer.h.2.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
44
+ "transformer.h.2.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
45
+ "transformer.h.2.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
46
+ "transformer.h.2.self_attention.dense.scales": "model-00001-of-00003.safetensors",
47
+ "transformer.h.2.ln_mlp.weight": "model-00001-of-00003.safetensors",
48
+ "transformer.h.2.ln_mlp.bias": "model-00001-of-00003.safetensors",
49
+ "transformer.h.2.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
50
+ "transformer.h.2.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
51
+ "transformer.h.2.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
52
+ "transformer.h.2.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
53
+ "transformer.h.2.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
54
+ "transformer.h.2.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
55
+ "transformer.h.3.ln_attn.weight": "model-00001-of-00003.safetensors",
56
+ "transformer.h.3.ln_attn.bias": "model-00001-of-00003.safetensors",
57
+ "transformer.h.3.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
58
+ "transformer.h.3.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
59
+ "transformer.h.3.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
60
+ "transformer.h.3.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
61
+ "transformer.h.3.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
62
+ "transformer.h.3.self_attention.dense.scales": "model-00001-of-00003.safetensors",
63
+ "transformer.h.3.ln_mlp.weight": "model-00001-of-00003.safetensors",
64
+ "transformer.h.3.ln_mlp.bias": "model-00001-of-00003.safetensors",
65
+ "transformer.h.3.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
66
+ "transformer.h.3.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
67
+ "transformer.h.3.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
68
+ "transformer.h.3.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
69
+ "transformer.h.3.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
70
+ "transformer.h.3.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
71
+ "transformer.h.4.ln_attn.weight": "model-00001-of-00003.safetensors",
72
+ "transformer.h.4.ln_attn.bias": "model-00001-of-00003.safetensors",
73
+ "transformer.h.4.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
74
+ "transformer.h.4.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
75
+ "transformer.h.4.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
76
+ "transformer.h.4.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
77
+ "transformer.h.4.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
78
+ "transformer.h.4.self_attention.dense.scales": "model-00001-of-00003.safetensors",
79
+ "transformer.h.4.ln_mlp.weight": "model-00001-of-00003.safetensors",
80
+ "transformer.h.4.ln_mlp.bias": "model-00001-of-00003.safetensors",
81
+ "transformer.h.4.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
82
+ "transformer.h.4.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
83
+ "transformer.h.4.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
84
+ "transformer.h.4.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
85
+ "transformer.h.4.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
86
+ "transformer.h.4.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
87
+ "transformer.h.5.ln_attn.weight": "model-00001-of-00003.safetensors",
88
+ "transformer.h.5.ln_attn.bias": "model-00001-of-00003.safetensors",
89
+ "transformer.h.5.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
90
+ "transformer.h.5.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
91
+ "transformer.h.5.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
92
+ "transformer.h.5.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
93
+ "transformer.h.5.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
94
+ "transformer.h.5.self_attention.dense.scales": "model-00001-of-00003.safetensors",
95
+ "transformer.h.5.ln_mlp.weight": "model-00001-of-00003.safetensors",
96
+ "transformer.h.5.ln_mlp.bias": "model-00001-of-00003.safetensors",
97
+ "transformer.h.5.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
98
+ "transformer.h.5.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
99
+ "transformer.h.5.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
100
+ "transformer.h.5.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
101
+ "transformer.h.5.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
102
+ "transformer.h.5.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
103
+ "transformer.h.6.ln_attn.weight": "model-00001-of-00003.safetensors",
104
+ "transformer.h.6.ln_attn.bias": "model-00001-of-00003.safetensors",
105
+ "transformer.h.6.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
106
+ "transformer.h.6.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
107
+ "transformer.h.6.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
108
+ "transformer.h.6.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
109
+ "transformer.h.6.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
110
+ "transformer.h.6.self_attention.dense.scales": "model-00001-of-00003.safetensors",
111
+ "transformer.h.6.ln_mlp.weight": "model-00001-of-00003.safetensors",
112
+ "transformer.h.6.ln_mlp.bias": "model-00001-of-00003.safetensors",
113
+ "transformer.h.6.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
114
+ "transformer.h.6.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
115
+ "transformer.h.6.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
116
+ "transformer.h.6.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
117
+ "transformer.h.6.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
118
+ "transformer.h.6.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
119
+ "transformer.h.7.ln_attn.weight": "model-00001-of-00003.safetensors",
120
+ "transformer.h.7.ln_attn.bias": "model-00001-of-00003.safetensors",
121
+ "transformer.h.7.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
122
+ "transformer.h.7.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
123
+ "transformer.h.7.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
124
+ "transformer.h.7.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
125
+ "transformer.h.7.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
126
+ "transformer.h.7.self_attention.dense.scales": "model-00001-of-00003.safetensors",
127
+ "transformer.h.7.ln_mlp.weight": "model-00001-of-00003.safetensors",
128
+ "transformer.h.7.ln_mlp.bias": "model-00001-of-00003.safetensors",
129
+ "transformer.h.7.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
130
+ "transformer.h.7.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
131
+ "transformer.h.7.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
132
+ "transformer.h.7.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
133
+ "transformer.h.7.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
134
+ "transformer.h.7.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
135
+ "transformer.h.8.ln_attn.weight": "model-00001-of-00003.safetensors",
136
+ "transformer.h.8.ln_attn.bias": "model-00001-of-00003.safetensors",
137
+ "transformer.h.8.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
138
+ "transformer.h.8.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
139
+ "transformer.h.8.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
140
+ "transformer.h.8.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
141
+ "transformer.h.8.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
142
+ "transformer.h.8.self_attention.dense.scales": "model-00001-of-00003.safetensors",
143
+ "transformer.h.8.ln_mlp.weight": "model-00001-of-00003.safetensors",
144
+ "transformer.h.8.ln_mlp.bias": "model-00001-of-00003.safetensors",
145
+ "transformer.h.8.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
146
+ "transformer.h.8.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
147
+ "transformer.h.8.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
148
+ "transformer.h.8.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
149
+ "transformer.h.8.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
150
+ "transformer.h.8.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
151
+ "transformer.h.9.ln_attn.weight": "model-00001-of-00003.safetensors",
152
+ "transformer.h.9.ln_attn.bias": "model-00001-of-00003.safetensors",
153
+ "transformer.h.9.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
154
+ "transformer.h.9.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
155
+ "transformer.h.9.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
156
+ "transformer.h.9.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
157
+ "transformer.h.9.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
158
+ "transformer.h.9.self_attention.dense.scales": "model-00001-of-00003.safetensors",
159
+ "transformer.h.9.ln_mlp.weight": "model-00001-of-00003.safetensors",
160
+ "transformer.h.9.ln_mlp.bias": "model-00001-of-00003.safetensors",
161
+ "transformer.h.9.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
162
+ "transformer.h.9.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
163
+ "transformer.h.9.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
164
+ "transformer.h.9.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
165
+ "transformer.h.9.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
166
+ "transformer.h.9.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
167
+ "transformer.h.10.ln_attn.weight": "model-00001-of-00003.safetensors",
168
+ "transformer.h.10.ln_attn.bias": "model-00001-of-00003.safetensors",
169
+ "transformer.h.10.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
170
+ "transformer.h.10.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
171
+ "transformer.h.10.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
172
+ "transformer.h.10.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
173
+ "transformer.h.10.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
174
+ "transformer.h.10.self_attention.dense.scales": "model-00001-of-00003.safetensors",
175
+ "transformer.h.10.ln_mlp.weight": "model-00001-of-00003.safetensors",
176
+ "transformer.h.10.ln_mlp.bias": "model-00001-of-00003.safetensors",
177
+ "transformer.h.10.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
178
+ "transformer.h.10.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
179
+ "transformer.h.10.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
180
+ "transformer.h.10.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
181
+ "transformer.h.10.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
182
+ "transformer.h.10.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
183
+ "transformer.h.11.ln_attn.weight": "model-00001-of-00003.safetensors",
184
+ "transformer.h.11.ln_attn.bias": "model-00001-of-00003.safetensors",
185
+ "transformer.h.11.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
186
+ "transformer.h.11.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
187
+ "transformer.h.11.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
188
+ "transformer.h.11.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
189
+ "transformer.h.11.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
190
+ "transformer.h.11.self_attention.dense.scales": "model-00001-of-00003.safetensors",
191
+ "transformer.h.11.ln_mlp.weight": "model-00001-of-00003.safetensors",
192
+ "transformer.h.11.ln_mlp.bias": "model-00001-of-00003.safetensors",
193
+ "transformer.h.11.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
194
+ "transformer.h.11.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
195
+ "transformer.h.11.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
196
+ "transformer.h.11.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
197
+ "transformer.h.11.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
198
+ "transformer.h.11.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
199
+ "transformer.h.12.ln_attn.weight": "model-00001-of-00003.safetensors",
200
+ "transformer.h.12.ln_attn.bias": "model-00001-of-00003.safetensors",
201
+ "transformer.h.12.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
202
+ "transformer.h.12.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
203
+ "transformer.h.12.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
204
+ "transformer.h.12.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
205
+ "transformer.h.12.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
206
+ "transformer.h.12.self_attention.dense.scales": "model-00001-of-00003.safetensors",
207
+ "transformer.h.12.ln_mlp.weight": "model-00001-of-00003.safetensors",
208
+ "transformer.h.12.ln_mlp.bias": "model-00001-of-00003.safetensors",
209
+ "transformer.h.12.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
210
+ "transformer.h.12.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
211
+ "transformer.h.12.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
212
+ "transformer.h.12.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
213
+ "transformer.h.12.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
214
+ "transformer.h.12.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
215
+ "transformer.h.13.ln_attn.weight": "model-00001-of-00003.safetensors",
216
+ "transformer.h.13.ln_attn.bias": "model-00001-of-00003.safetensors",
217
+ "transformer.h.13.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
218
+ "transformer.h.13.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
219
+ "transformer.h.13.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
220
+ "transformer.h.13.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
221
+ "transformer.h.13.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
222
+ "transformer.h.13.self_attention.dense.scales": "model-00001-of-00003.safetensors",
223
+ "transformer.h.13.ln_mlp.weight": "model-00001-of-00003.safetensors",
224
+ "transformer.h.13.ln_mlp.bias": "model-00001-of-00003.safetensors",
225
+ "transformer.h.13.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
226
+ "transformer.h.13.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
227
+ "transformer.h.13.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
228
+ "transformer.h.13.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
229
+ "transformer.h.13.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
230
+ "transformer.h.13.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
231
+ "transformer.h.14.ln_attn.weight": "model-00001-of-00003.safetensors",
232
+ "transformer.h.14.ln_attn.bias": "model-00001-of-00003.safetensors",
233
+ "transformer.h.14.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
234
+ "transformer.h.14.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
235
+ "transformer.h.14.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
236
+ "transformer.h.14.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
237
+ "transformer.h.14.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
238
+ "transformer.h.14.self_attention.dense.scales": "model-00001-of-00003.safetensors",
239
+ "transformer.h.14.ln_mlp.weight": "model-00001-of-00003.safetensors",
240
+ "transformer.h.14.ln_mlp.bias": "model-00001-of-00003.safetensors",
241
+ "transformer.h.14.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
242
+ "transformer.h.14.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
243
+ "transformer.h.14.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
244
+ "transformer.h.14.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
245
+ "transformer.h.14.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
246
+ "transformer.h.14.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
247
+ "transformer.h.15.ln_attn.weight": "model-00001-of-00003.safetensors",
248
+ "transformer.h.15.ln_attn.bias": "model-00001-of-00003.safetensors",
249
+ "transformer.h.15.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
250
+ "transformer.h.15.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
251
+ "transformer.h.15.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
252
+ "transformer.h.15.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
253
+ "transformer.h.15.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
254
+ "transformer.h.15.self_attention.dense.scales": "model-00001-of-00003.safetensors",
255
+ "transformer.h.15.ln_mlp.weight": "model-00001-of-00003.safetensors",
256
+ "transformer.h.15.ln_mlp.bias": "model-00001-of-00003.safetensors",
257
+ "transformer.h.15.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
258
+ "transformer.h.15.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
259
+ "transformer.h.15.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
260
+ "transformer.h.15.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
261
+ "transformer.h.15.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
262
+ "transformer.h.15.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
263
+ "transformer.h.16.ln_attn.weight": "model-00001-of-00003.safetensors",
264
+ "transformer.h.16.ln_attn.bias": "model-00001-of-00003.safetensors",
265
+ "transformer.h.16.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
266
+ "transformer.h.16.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
267
+ "transformer.h.16.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
268
+ "transformer.h.16.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
269
+ "transformer.h.16.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
270
+ "transformer.h.16.self_attention.dense.scales": "model-00001-of-00003.safetensors",
271
+ "transformer.h.16.ln_mlp.weight": "model-00001-of-00003.safetensors",
272
+ "transformer.h.16.ln_mlp.bias": "model-00001-of-00003.safetensors",
273
+ "transformer.h.16.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
274
+ "transformer.h.16.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
275
+ "transformer.h.16.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
276
+ "transformer.h.16.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
277
+ "transformer.h.16.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
278
+ "transformer.h.16.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
279
+ "transformer.h.17.ln_attn.weight": "model-00001-of-00003.safetensors",
280
+ "transformer.h.17.ln_attn.bias": "model-00001-of-00003.safetensors",
281
+ "transformer.h.17.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
282
+ "transformer.h.17.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
283
+ "transformer.h.17.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
284
+ "transformer.h.17.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
285
+ "transformer.h.17.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
286
+ "transformer.h.17.self_attention.dense.scales": "model-00001-of-00003.safetensors",
287
+ "transformer.h.17.ln_mlp.weight": "model-00001-of-00003.safetensors",
288
+ "transformer.h.17.ln_mlp.bias": "model-00001-of-00003.safetensors",
289
+ "transformer.h.17.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
290
+ "transformer.h.17.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
291
+ "transformer.h.17.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
292
+ "transformer.h.17.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
293
+ "transformer.h.17.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
294
+ "transformer.h.17.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
295
+ "transformer.h.18.ln_attn.weight": "model-00001-of-00003.safetensors",
296
+ "transformer.h.18.ln_attn.bias": "model-00001-of-00003.safetensors",
297
+ "transformer.h.18.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
298
+ "transformer.h.18.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
299
+ "transformer.h.18.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
300
+ "transformer.h.18.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
301
+ "transformer.h.18.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
302
+ "transformer.h.18.self_attention.dense.scales": "model-00001-of-00003.safetensors",
303
+ "transformer.h.18.ln_mlp.weight": "model-00001-of-00003.safetensors",
304
+ "transformer.h.18.ln_mlp.bias": "model-00001-of-00003.safetensors",
305
+ "transformer.h.18.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
306
+ "transformer.h.18.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
307
+ "transformer.h.18.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
308
+ "transformer.h.18.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
309
+ "transformer.h.18.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
310
+ "transformer.h.18.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
311
+ "transformer.h.19.ln_attn.weight": "model-00001-of-00003.safetensors",
312
+ "transformer.h.19.ln_attn.bias": "model-00001-of-00003.safetensors",
313
+ "transformer.h.19.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
314
+ "transformer.h.19.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
315
+ "transformer.h.19.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
316
+ "transformer.h.19.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
317
+ "transformer.h.19.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
318
+ "transformer.h.19.self_attention.dense.scales": "model-00001-of-00003.safetensors",
319
+ "transformer.h.19.ln_mlp.weight": "model-00001-of-00003.safetensors",
320
+ "transformer.h.19.ln_mlp.bias": "model-00001-of-00003.safetensors",
321
+ "transformer.h.19.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
322
+ "transformer.h.19.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
323
+ "transformer.h.19.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
324
+ "transformer.h.19.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
325
+ "transformer.h.19.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
326
+ "transformer.h.19.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
327
+ "transformer.h.20.ln_attn.weight": "model-00001-of-00003.safetensors",
328
+ "transformer.h.20.ln_attn.bias": "model-00001-of-00003.safetensors",
329
+ "transformer.h.20.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
330
+ "transformer.h.20.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
331
+ "transformer.h.20.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
332
+ "transformer.h.20.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
333
+ "transformer.h.20.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
334
+ "transformer.h.20.self_attention.dense.scales": "model-00001-of-00003.safetensors",
335
+ "transformer.h.20.ln_mlp.weight": "model-00001-of-00003.safetensors",
336
+ "transformer.h.20.ln_mlp.bias": "model-00001-of-00003.safetensors",
337
+ "transformer.h.20.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
338
+ "transformer.h.20.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
339
+ "transformer.h.20.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
340
+ "transformer.h.20.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
341
+ "transformer.h.20.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
342
+ "transformer.h.20.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
343
+ "transformer.h.21.ln_attn.weight": "model-00001-of-00003.safetensors",
344
+ "transformer.h.21.ln_attn.bias": "model-00001-of-00003.safetensors",
345
+ "transformer.h.21.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
346
+ "transformer.h.21.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
347
+ "transformer.h.21.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
348
+ "transformer.h.21.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
349
+ "transformer.h.21.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
350
+ "transformer.h.21.self_attention.dense.scales": "model-00001-of-00003.safetensors",
351
+ "transformer.h.21.ln_mlp.weight": "model-00001-of-00003.safetensors",
352
+ "transformer.h.21.ln_mlp.bias": "model-00001-of-00003.safetensors",
353
+ "transformer.h.21.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
354
+ "transformer.h.21.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
355
+ "transformer.h.21.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
356
+ "transformer.h.21.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
357
+ "transformer.h.21.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
358
+ "transformer.h.21.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
359
+ "transformer.h.22.ln_attn.weight": "model-00001-of-00003.safetensors",
360
+ "transformer.h.22.ln_attn.bias": "model-00001-of-00003.safetensors",
361
+ "transformer.h.22.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
362
+ "transformer.h.22.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
363
+ "transformer.h.22.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
364
+ "transformer.h.22.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
365
+ "transformer.h.22.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
366
+ "transformer.h.22.self_attention.dense.scales": "model-00001-of-00003.safetensors",
367
+ "transformer.h.22.ln_mlp.weight": "model-00001-of-00003.safetensors",
368
+ "transformer.h.22.ln_mlp.bias": "model-00001-of-00003.safetensors",
369
+ "transformer.h.22.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
370
+ "transformer.h.22.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
371
+ "transformer.h.22.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
372
+ "transformer.h.22.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
373
+ "transformer.h.22.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
374
+ "transformer.h.22.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
375
+ "transformer.h.23.ln_attn.weight": "model-00001-of-00003.safetensors",
376
+ "transformer.h.23.ln_attn.bias": "model-00001-of-00003.safetensors",
377
+ "transformer.h.23.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
378
+ "transformer.h.23.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
379
+ "transformer.h.23.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
380
+ "transformer.h.23.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
381
+ "transformer.h.23.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
382
+ "transformer.h.23.self_attention.dense.scales": "model-00001-of-00003.safetensors",
383
+ "transformer.h.23.ln_mlp.weight": "model-00001-of-00003.safetensors",
384
+ "transformer.h.23.ln_mlp.bias": "model-00001-of-00003.safetensors",
385
+ "transformer.h.23.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
386
+ "transformer.h.23.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
387
+ "transformer.h.23.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
388
+ "transformer.h.23.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
389
+ "transformer.h.23.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
390
+ "transformer.h.23.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
391
+ "transformer.h.24.ln_attn.weight": "model-00001-of-00003.safetensors",
392
+ "transformer.h.24.ln_attn.bias": "model-00001-of-00003.safetensors",
393
+ "transformer.h.24.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
394
+ "transformer.h.24.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
395
+ "transformer.h.24.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
396
+ "transformer.h.24.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
397
+ "transformer.h.24.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
398
+ "transformer.h.24.self_attention.dense.scales": "model-00001-of-00003.safetensors",
399
+ "transformer.h.24.ln_mlp.weight": "model-00001-of-00003.safetensors",
400
+ "transformer.h.24.ln_mlp.bias": "model-00001-of-00003.safetensors",
401
+ "transformer.h.24.mlp.dense_h_to_4h.qweight": "model-00001-of-00003.safetensors",
402
+ "transformer.h.24.mlp.dense_h_to_4h.qzeros": "model-00001-of-00003.safetensors",
403
+ "transformer.h.24.mlp.dense_h_to_4h.scales": "model-00001-of-00003.safetensors",
404
+ "transformer.h.24.mlp.dense_4h_to_h.qweight": "model-00001-of-00003.safetensors",
405
+ "transformer.h.24.mlp.dense_4h_to_h.qzeros": "model-00001-of-00003.safetensors",
406
+ "transformer.h.24.mlp.dense_4h_to_h.scales": "model-00001-of-00003.safetensors",
407
+ "transformer.h.25.ln_attn.weight": "model-00001-of-00003.safetensors",
408
+ "transformer.h.25.ln_attn.bias": "model-00001-of-00003.safetensors",
409
+ "transformer.h.25.self_attention.query_key_value.qweight": "model-00001-of-00003.safetensors",
410
+ "transformer.h.25.self_attention.query_key_value.qzeros": "model-00001-of-00003.safetensors",
411
+ "transformer.h.25.self_attention.query_key_value.scales": "model-00001-of-00003.safetensors",
412
+ "transformer.h.25.self_attention.dense.qweight": "model-00001-of-00003.safetensors",
413
+ "transformer.h.25.self_attention.dense.qzeros": "model-00001-of-00003.safetensors",
414
+ "transformer.h.25.self_attention.dense.scales": "model-00001-of-00003.safetensors",
415
+ "transformer.h.25.ln_mlp.weight": "model-00001-of-00003.safetensors",
416
+ "transformer.h.25.ln_mlp.bias": "model-00001-of-00003.safetensors",
417
+ "lm_head.weight": "model-00001-of-00003.safetensors",
418
+ "transformer.h.25.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
419
+ "transformer.h.25.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
420
+ "transformer.h.25.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
421
+ "transformer.h.25.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
422
+ "transformer.h.25.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
423
+ "transformer.h.25.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
424
+ "transformer.h.26.ln_attn.weight": "model-00002-of-00003.safetensors",
425
+ "transformer.h.26.ln_attn.bias": "model-00002-of-00003.safetensors",
426
+ "transformer.h.26.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
427
+ "transformer.h.26.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
428
+ "transformer.h.26.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
429
+ "transformer.h.26.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
430
+ "transformer.h.26.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
431
+ "transformer.h.26.self_attention.dense.scales": "model-00002-of-00003.safetensors",
432
+ "transformer.h.26.ln_mlp.weight": "model-00002-of-00003.safetensors",
433
+ "transformer.h.26.ln_mlp.bias": "model-00002-of-00003.safetensors",
434
+ "transformer.h.26.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
435
+ "transformer.h.26.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
436
+ "transformer.h.26.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
437
+ "transformer.h.26.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
438
+ "transformer.h.26.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
439
+ "transformer.h.26.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
440
+ "transformer.h.27.ln_attn.weight": "model-00002-of-00003.safetensors",
441
+ "transformer.h.27.ln_attn.bias": "model-00002-of-00003.safetensors",
442
+ "transformer.h.27.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
443
+ "transformer.h.27.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
444
+ "transformer.h.27.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
445
+ "transformer.h.27.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
446
+ "transformer.h.27.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
447
+ "transformer.h.27.self_attention.dense.scales": "model-00002-of-00003.safetensors",
448
+ "transformer.h.27.ln_mlp.weight": "model-00002-of-00003.safetensors",
449
+ "transformer.h.27.ln_mlp.bias": "model-00002-of-00003.safetensors",
450
+ "transformer.h.27.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
451
+ "transformer.h.27.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
452
+ "transformer.h.27.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
453
+ "transformer.h.27.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
454
+ "transformer.h.27.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
455
+ "transformer.h.27.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
456
+ "transformer.h.28.ln_attn.weight": "model-00002-of-00003.safetensors",
457
+ "transformer.h.28.ln_attn.bias": "model-00002-of-00003.safetensors",
458
+ "transformer.h.28.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
459
+ "transformer.h.28.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
460
+ "transformer.h.28.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
461
+ "transformer.h.28.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
462
+ "transformer.h.28.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
463
+ "transformer.h.28.self_attention.dense.scales": "model-00002-of-00003.safetensors",
464
+ "transformer.h.28.ln_mlp.weight": "model-00002-of-00003.safetensors",
465
+ "transformer.h.28.ln_mlp.bias": "model-00002-of-00003.safetensors",
466
+ "transformer.h.28.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
467
+ "transformer.h.28.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
468
+ "transformer.h.28.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
469
+ "transformer.h.28.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
470
+ "transformer.h.28.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
471
+ "transformer.h.28.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
472
+ "transformer.h.29.ln_attn.weight": "model-00002-of-00003.safetensors",
473
+ "transformer.h.29.ln_attn.bias": "model-00002-of-00003.safetensors",
474
+ "transformer.h.29.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
475
+ "transformer.h.29.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
476
+ "transformer.h.29.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
477
+ "transformer.h.29.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
478
+ "transformer.h.29.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
479
+ "transformer.h.29.self_attention.dense.scales": "model-00002-of-00003.safetensors",
480
+ "transformer.h.29.ln_mlp.weight": "model-00002-of-00003.safetensors",
481
+ "transformer.h.29.ln_mlp.bias": "model-00002-of-00003.safetensors",
482
+ "transformer.h.29.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
483
+ "transformer.h.29.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
484
+ "transformer.h.29.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
485
+ "transformer.h.29.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
486
+ "transformer.h.29.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
487
+ "transformer.h.29.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
488
+ "transformer.h.30.ln_attn.weight": "model-00002-of-00003.safetensors",
489
+ "transformer.h.30.ln_attn.bias": "model-00002-of-00003.safetensors",
490
+ "transformer.h.30.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
491
+ "transformer.h.30.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
492
+ "transformer.h.30.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
493
+ "transformer.h.30.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
494
+ "transformer.h.30.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
495
+ "transformer.h.30.self_attention.dense.scales": "model-00002-of-00003.safetensors",
496
+ "transformer.h.30.ln_mlp.weight": "model-00002-of-00003.safetensors",
497
+ "transformer.h.30.ln_mlp.bias": "model-00002-of-00003.safetensors",
498
+ "transformer.h.30.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
499
+ "transformer.h.30.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
500
+ "transformer.h.30.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
501
+ "transformer.h.30.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
502
+ "transformer.h.30.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
503
+ "transformer.h.30.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
504
+ "transformer.h.31.ln_attn.weight": "model-00002-of-00003.safetensors",
505
+ "transformer.h.31.ln_attn.bias": "model-00002-of-00003.safetensors",
506
+ "transformer.h.31.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
507
+ "transformer.h.31.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
508
+ "transformer.h.31.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
509
+ "transformer.h.31.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
510
+ "transformer.h.31.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
511
+ "transformer.h.31.self_attention.dense.scales": "model-00002-of-00003.safetensors",
512
+ "transformer.h.31.ln_mlp.weight": "model-00002-of-00003.safetensors",
513
+ "transformer.h.31.ln_mlp.bias": "model-00002-of-00003.safetensors",
514
+ "transformer.h.31.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
515
+ "transformer.h.31.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
516
+ "transformer.h.31.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
517
+ "transformer.h.31.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
518
+ "transformer.h.31.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
519
+ "transformer.h.31.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
520
+ "transformer.h.32.ln_attn.weight": "model-00002-of-00003.safetensors",
521
+ "transformer.h.32.ln_attn.bias": "model-00002-of-00003.safetensors",
522
+ "transformer.h.32.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
523
+ "transformer.h.32.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
524
+ "transformer.h.32.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
525
+ "transformer.h.32.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
526
+ "transformer.h.32.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
527
+ "transformer.h.32.self_attention.dense.scales": "model-00002-of-00003.safetensors",
528
+ "transformer.h.32.ln_mlp.weight": "model-00002-of-00003.safetensors",
529
+ "transformer.h.32.ln_mlp.bias": "model-00002-of-00003.safetensors",
530
+ "transformer.h.32.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
531
+ "transformer.h.32.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
532
+ "transformer.h.32.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
533
+ "transformer.h.32.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
534
+ "transformer.h.32.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
535
+ "transformer.h.32.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
536
+ "transformer.h.33.ln_attn.weight": "model-00002-of-00003.safetensors",
537
+ "transformer.h.33.ln_attn.bias": "model-00002-of-00003.safetensors",
538
+ "transformer.h.33.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
539
+ "transformer.h.33.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
540
+ "transformer.h.33.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
541
+ "transformer.h.33.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
542
+ "transformer.h.33.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
543
+ "transformer.h.33.self_attention.dense.scales": "model-00002-of-00003.safetensors",
544
+ "transformer.h.33.ln_mlp.weight": "model-00002-of-00003.safetensors",
545
+ "transformer.h.33.ln_mlp.bias": "model-00002-of-00003.safetensors",
546
+ "transformer.h.33.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
547
+ "transformer.h.33.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
548
+ "transformer.h.33.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
549
+ "transformer.h.33.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
550
+ "transformer.h.33.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
551
+ "transformer.h.33.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
552
+ "transformer.h.34.ln_attn.weight": "model-00002-of-00003.safetensors",
553
+ "transformer.h.34.ln_attn.bias": "model-00002-of-00003.safetensors",
554
+ "transformer.h.34.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
555
+ "transformer.h.34.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
556
+ "transformer.h.34.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
557
+ "transformer.h.34.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
558
+ "transformer.h.34.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
559
+ "transformer.h.34.self_attention.dense.scales": "model-00002-of-00003.safetensors",
560
+ "transformer.h.34.ln_mlp.weight": "model-00002-of-00003.safetensors",
561
+ "transformer.h.34.ln_mlp.bias": "model-00002-of-00003.safetensors",
562
+ "transformer.h.34.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
563
+ "transformer.h.34.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
564
+ "transformer.h.34.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
565
+ "transformer.h.34.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
566
+ "transformer.h.34.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
567
+ "transformer.h.34.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
568
+ "transformer.h.35.ln_attn.weight": "model-00002-of-00003.safetensors",
569
+ "transformer.h.35.ln_attn.bias": "model-00002-of-00003.safetensors",
570
+ "transformer.h.35.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
571
+ "transformer.h.35.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
572
+ "transformer.h.35.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
573
+ "transformer.h.35.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
574
+ "transformer.h.35.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
575
+ "transformer.h.35.self_attention.dense.scales": "model-00002-of-00003.safetensors",
576
+ "transformer.h.35.ln_mlp.weight": "model-00002-of-00003.safetensors",
577
+ "transformer.h.35.ln_mlp.bias": "model-00002-of-00003.safetensors",
578
+ "transformer.h.35.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
579
+ "transformer.h.35.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
580
+ "transformer.h.35.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
581
+ "transformer.h.35.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
582
+ "transformer.h.35.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
583
+ "transformer.h.35.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
584
+ "transformer.h.36.ln_attn.weight": "model-00002-of-00003.safetensors",
585
+ "transformer.h.36.ln_attn.bias": "model-00002-of-00003.safetensors",
586
+ "transformer.h.36.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
587
+ "transformer.h.36.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
588
+ "transformer.h.36.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
589
+ "transformer.h.36.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
590
+ "transformer.h.36.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
591
+ "transformer.h.36.self_attention.dense.scales": "model-00002-of-00003.safetensors",
592
+ "transformer.h.36.ln_mlp.weight": "model-00002-of-00003.safetensors",
593
+ "transformer.h.36.ln_mlp.bias": "model-00002-of-00003.safetensors",
594
+ "transformer.h.36.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
595
+ "transformer.h.36.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
596
+ "transformer.h.36.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
597
+ "transformer.h.36.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
598
+ "transformer.h.36.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
599
+ "transformer.h.36.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
600
+ "transformer.h.37.ln_attn.weight": "model-00002-of-00003.safetensors",
601
+ "transformer.h.37.ln_attn.bias": "model-00002-of-00003.safetensors",
602
+ "transformer.h.37.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
603
+ "transformer.h.37.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
604
+ "transformer.h.37.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
605
+ "transformer.h.37.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
606
+ "transformer.h.37.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
607
+ "transformer.h.37.self_attention.dense.scales": "model-00002-of-00003.safetensors",
608
+ "transformer.h.37.ln_mlp.weight": "model-00002-of-00003.safetensors",
609
+ "transformer.h.37.ln_mlp.bias": "model-00002-of-00003.safetensors",
610
+ "transformer.h.37.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
611
+ "transformer.h.37.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
612
+ "transformer.h.37.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
613
+ "transformer.h.37.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
614
+ "transformer.h.37.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
615
+ "transformer.h.37.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
616
+ "transformer.h.38.ln_attn.weight": "model-00002-of-00003.safetensors",
617
+ "transformer.h.38.ln_attn.bias": "model-00002-of-00003.safetensors",
618
+ "transformer.h.38.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
619
+ "transformer.h.38.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
620
+ "transformer.h.38.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
621
+ "transformer.h.38.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
622
+ "transformer.h.38.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
623
+ "transformer.h.38.self_attention.dense.scales": "model-00002-of-00003.safetensors",
624
+ "transformer.h.38.ln_mlp.weight": "model-00002-of-00003.safetensors",
625
+ "transformer.h.38.ln_mlp.bias": "model-00002-of-00003.safetensors",
626
+ "transformer.h.38.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
627
+ "transformer.h.38.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
628
+ "transformer.h.38.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
629
+ "transformer.h.38.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
630
+ "transformer.h.38.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
631
+ "transformer.h.38.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
632
+ "transformer.h.39.ln_attn.weight": "model-00002-of-00003.safetensors",
633
+ "transformer.h.39.ln_attn.bias": "model-00002-of-00003.safetensors",
634
+ "transformer.h.39.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
635
+ "transformer.h.39.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
636
+ "transformer.h.39.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
637
+ "transformer.h.39.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
638
+ "transformer.h.39.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
639
+ "transformer.h.39.self_attention.dense.scales": "model-00002-of-00003.safetensors",
640
+ "transformer.h.39.ln_mlp.weight": "model-00002-of-00003.safetensors",
641
+ "transformer.h.39.ln_mlp.bias": "model-00002-of-00003.safetensors",
642
+ "transformer.h.39.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
643
+ "transformer.h.39.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
644
+ "transformer.h.39.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
645
+ "transformer.h.39.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
646
+ "transformer.h.39.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
647
+ "transformer.h.39.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
648
+ "transformer.h.40.ln_attn.weight": "model-00002-of-00003.safetensors",
649
+ "transformer.h.40.ln_attn.bias": "model-00002-of-00003.safetensors",
650
+ "transformer.h.40.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
651
+ "transformer.h.40.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
652
+ "transformer.h.40.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
653
+ "transformer.h.40.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
654
+ "transformer.h.40.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
655
+ "transformer.h.40.self_attention.dense.scales": "model-00002-of-00003.safetensors",
656
+ "transformer.h.40.ln_mlp.weight": "model-00002-of-00003.safetensors",
657
+ "transformer.h.40.ln_mlp.bias": "model-00002-of-00003.safetensors",
658
+ "transformer.h.40.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
659
+ "transformer.h.40.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
660
+ "transformer.h.40.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
661
+ "transformer.h.40.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
662
+ "transformer.h.40.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
663
+ "transformer.h.40.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
664
+ "transformer.h.41.ln_attn.weight": "model-00002-of-00003.safetensors",
665
+ "transformer.h.41.ln_attn.bias": "model-00002-of-00003.safetensors",
666
+ "transformer.h.41.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
667
+ "transformer.h.41.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
668
+ "transformer.h.41.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
669
+ "transformer.h.41.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
670
+ "transformer.h.41.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
671
+ "transformer.h.41.self_attention.dense.scales": "model-00002-of-00003.safetensors",
672
+ "transformer.h.41.ln_mlp.weight": "model-00002-of-00003.safetensors",
673
+ "transformer.h.41.ln_mlp.bias": "model-00002-of-00003.safetensors",
674
+ "transformer.h.41.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
675
+ "transformer.h.41.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
676
+ "transformer.h.41.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
677
+ "transformer.h.41.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
678
+ "transformer.h.41.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
679
+ "transformer.h.41.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
680
+ "transformer.h.42.ln_attn.weight": "model-00002-of-00003.safetensors",
681
+ "transformer.h.42.ln_attn.bias": "model-00002-of-00003.safetensors",
682
+ "transformer.h.42.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
683
+ "transformer.h.42.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
684
+ "transformer.h.42.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
685
+ "transformer.h.42.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
686
+ "transformer.h.42.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
687
+ "transformer.h.42.self_attention.dense.scales": "model-00002-of-00003.safetensors",
688
+ "transformer.h.42.ln_mlp.weight": "model-00002-of-00003.safetensors",
689
+ "transformer.h.42.ln_mlp.bias": "model-00002-of-00003.safetensors",
690
+ "transformer.h.42.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
691
+ "transformer.h.42.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
692
+ "transformer.h.42.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
693
+ "transformer.h.42.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
694
+ "transformer.h.42.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
695
+ "transformer.h.42.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
696
+ "transformer.h.43.ln_attn.weight": "model-00002-of-00003.safetensors",
697
+ "transformer.h.43.ln_attn.bias": "model-00002-of-00003.safetensors",
698
+ "transformer.h.43.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
699
+ "transformer.h.43.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
700
+ "transformer.h.43.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
701
+ "transformer.h.43.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
702
+ "transformer.h.43.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
703
+ "transformer.h.43.self_attention.dense.scales": "model-00002-of-00003.safetensors",
704
+ "transformer.h.43.ln_mlp.weight": "model-00002-of-00003.safetensors",
705
+ "transformer.h.43.ln_mlp.bias": "model-00002-of-00003.safetensors",
706
+ "transformer.h.43.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
707
+ "transformer.h.43.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
708
+ "transformer.h.43.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
709
+ "transformer.h.43.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
710
+ "transformer.h.43.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
711
+ "transformer.h.43.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
712
+ "transformer.h.44.ln_attn.weight": "model-00002-of-00003.safetensors",
713
+ "transformer.h.44.ln_attn.bias": "model-00002-of-00003.safetensors",
714
+ "transformer.h.44.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
715
+ "transformer.h.44.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
716
+ "transformer.h.44.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
717
+ "transformer.h.44.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
718
+ "transformer.h.44.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
719
+ "transformer.h.44.self_attention.dense.scales": "model-00002-of-00003.safetensors",
720
+ "transformer.h.44.ln_mlp.weight": "model-00002-of-00003.safetensors",
721
+ "transformer.h.44.ln_mlp.bias": "model-00002-of-00003.safetensors",
722
+ "transformer.h.44.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
723
+ "transformer.h.44.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
724
+ "transformer.h.44.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
725
+ "transformer.h.44.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
726
+ "transformer.h.44.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
727
+ "transformer.h.44.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
728
+ "transformer.h.45.ln_attn.weight": "model-00002-of-00003.safetensors",
729
+ "transformer.h.45.ln_attn.bias": "model-00002-of-00003.safetensors",
730
+ "transformer.h.45.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
731
+ "transformer.h.45.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
732
+ "transformer.h.45.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
733
+ "transformer.h.45.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
734
+ "transformer.h.45.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
735
+ "transformer.h.45.self_attention.dense.scales": "model-00002-of-00003.safetensors",
736
+ "transformer.h.45.ln_mlp.weight": "model-00002-of-00003.safetensors",
737
+ "transformer.h.45.ln_mlp.bias": "model-00002-of-00003.safetensors",
738
+ "transformer.h.45.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
739
+ "transformer.h.45.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
740
+ "transformer.h.45.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
741
+ "transformer.h.45.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
742
+ "transformer.h.45.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
743
+ "transformer.h.45.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
744
+ "transformer.h.46.ln_attn.weight": "model-00002-of-00003.safetensors",
745
+ "transformer.h.46.ln_attn.bias": "model-00002-of-00003.safetensors",
746
+ "transformer.h.46.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
747
+ "transformer.h.46.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
748
+ "transformer.h.46.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
749
+ "transformer.h.46.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
750
+ "transformer.h.46.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
751
+ "transformer.h.46.self_attention.dense.scales": "model-00002-of-00003.safetensors",
752
+ "transformer.h.46.ln_mlp.weight": "model-00002-of-00003.safetensors",
753
+ "transformer.h.46.ln_mlp.bias": "model-00002-of-00003.safetensors",
754
+ "transformer.h.46.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
755
+ "transformer.h.46.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
756
+ "transformer.h.46.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
757
+ "transformer.h.46.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
758
+ "transformer.h.46.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
759
+ "transformer.h.46.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
760
+ "transformer.h.47.ln_attn.weight": "model-00002-of-00003.safetensors",
761
+ "transformer.h.47.ln_attn.bias": "model-00002-of-00003.safetensors",
762
+ "transformer.h.47.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
763
+ "transformer.h.47.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
764
+ "transformer.h.47.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
765
+ "transformer.h.47.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
766
+ "transformer.h.47.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
767
+ "transformer.h.47.self_attention.dense.scales": "model-00002-of-00003.safetensors",
768
+ "transformer.h.47.ln_mlp.weight": "model-00002-of-00003.safetensors",
769
+ "transformer.h.47.ln_mlp.bias": "model-00002-of-00003.safetensors",
770
+ "transformer.h.47.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
771
+ "transformer.h.47.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
772
+ "transformer.h.47.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
773
+ "transformer.h.47.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
774
+ "transformer.h.47.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
775
+ "transformer.h.47.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
776
+ "transformer.h.48.ln_attn.weight": "model-00002-of-00003.safetensors",
777
+ "transformer.h.48.ln_attn.bias": "model-00002-of-00003.safetensors",
778
+ "transformer.h.48.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
779
+ "transformer.h.48.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
780
+ "transformer.h.48.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
781
+ "transformer.h.48.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
782
+ "transformer.h.48.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
783
+ "transformer.h.48.self_attention.dense.scales": "model-00002-of-00003.safetensors",
784
+ "transformer.h.48.ln_mlp.weight": "model-00002-of-00003.safetensors",
785
+ "transformer.h.48.ln_mlp.bias": "model-00002-of-00003.safetensors",
786
+ "transformer.h.48.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
787
+ "transformer.h.48.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
788
+ "transformer.h.48.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
789
+ "transformer.h.48.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
790
+ "transformer.h.48.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
791
+ "transformer.h.48.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
792
+ "transformer.h.49.ln_attn.weight": "model-00002-of-00003.safetensors",
793
+ "transformer.h.49.ln_attn.bias": "model-00002-of-00003.safetensors",
794
+ "transformer.h.49.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
795
+ "transformer.h.49.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
796
+ "transformer.h.49.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
797
+ "transformer.h.49.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
798
+ "transformer.h.49.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
799
+ "transformer.h.49.self_attention.dense.scales": "model-00002-of-00003.safetensors",
800
+ "transformer.h.49.ln_mlp.weight": "model-00002-of-00003.safetensors",
801
+ "transformer.h.49.ln_mlp.bias": "model-00002-of-00003.safetensors",
802
+ "transformer.h.49.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
803
+ "transformer.h.49.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
804
+ "transformer.h.49.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
805
+ "transformer.h.49.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
806
+ "transformer.h.49.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
807
+ "transformer.h.49.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
808
+ "transformer.h.50.ln_attn.weight": "model-00002-of-00003.safetensors",
809
+ "transformer.h.50.ln_attn.bias": "model-00002-of-00003.safetensors",
810
+ "transformer.h.50.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
811
+ "transformer.h.50.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
812
+ "transformer.h.50.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
813
+ "transformer.h.50.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
814
+ "transformer.h.50.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
815
+ "transformer.h.50.self_attention.dense.scales": "model-00002-of-00003.safetensors",
816
+ "transformer.h.50.ln_mlp.weight": "model-00002-of-00003.safetensors",
817
+ "transformer.h.50.ln_mlp.bias": "model-00002-of-00003.safetensors",
818
+ "transformer.h.50.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
819
+ "transformer.h.50.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
820
+ "transformer.h.50.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
821
+ "transformer.h.50.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
822
+ "transformer.h.50.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
823
+ "transformer.h.50.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
824
+ "transformer.h.51.ln_attn.weight": "model-00002-of-00003.safetensors",
825
+ "transformer.h.51.ln_attn.bias": "model-00002-of-00003.safetensors",
826
+ "transformer.h.51.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
827
+ "transformer.h.51.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
828
+ "transformer.h.51.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
829
+ "transformer.h.51.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
830
+ "transformer.h.51.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
831
+ "transformer.h.51.self_attention.dense.scales": "model-00002-of-00003.safetensors",
832
+ "transformer.h.51.ln_mlp.weight": "model-00002-of-00003.safetensors",
833
+ "transformer.h.51.ln_mlp.bias": "model-00002-of-00003.safetensors",
834
+ "transformer.h.51.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
835
+ "transformer.h.51.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
836
+ "transformer.h.51.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
837
+ "transformer.h.51.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
838
+ "transformer.h.51.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
839
+ "transformer.h.51.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
840
+ "transformer.h.52.ln_attn.weight": "model-00002-of-00003.safetensors",
841
+ "transformer.h.52.ln_attn.bias": "model-00002-of-00003.safetensors",
842
+ "transformer.h.52.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
843
+ "transformer.h.52.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
844
+ "transformer.h.52.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
845
+ "transformer.h.52.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
846
+ "transformer.h.52.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
847
+ "transformer.h.52.self_attention.dense.scales": "model-00002-of-00003.safetensors",
848
+ "transformer.h.52.ln_mlp.weight": "model-00002-of-00003.safetensors",
849
+ "transformer.h.52.ln_mlp.bias": "model-00002-of-00003.safetensors",
850
+ "transformer.h.52.mlp.dense_h_to_4h.qweight": "model-00002-of-00003.safetensors",
851
+ "transformer.h.52.mlp.dense_h_to_4h.qzeros": "model-00002-of-00003.safetensors",
852
+ "transformer.h.52.mlp.dense_h_to_4h.scales": "model-00002-of-00003.safetensors",
853
+ "transformer.h.52.mlp.dense_4h_to_h.qweight": "model-00002-of-00003.safetensors",
854
+ "transformer.h.52.mlp.dense_4h_to_h.qzeros": "model-00002-of-00003.safetensors",
855
+ "transformer.h.52.mlp.dense_4h_to_h.scales": "model-00002-of-00003.safetensors",
856
+ "transformer.h.53.ln_attn.weight": "model-00002-of-00003.safetensors",
857
+ "transformer.h.53.ln_attn.bias": "model-00002-of-00003.safetensors",
858
+ "transformer.h.53.self_attention.query_key_value.qweight": "model-00002-of-00003.safetensors",
859
+ "transformer.h.53.self_attention.query_key_value.qzeros": "model-00002-of-00003.safetensors",
860
+ "transformer.h.53.self_attention.query_key_value.scales": "model-00002-of-00003.safetensors",
861
+ "transformer.h.53.self_attention.dense.qweight": "model-00002-of-00003.safetensors",
862
+ "transformer.h.53.self_attention.dense.qzeros": "model-00002-of-00003.safetensors",
863
+ "transformer.h.53.self_attention.dense.scales": "model-00002-of-00003.safetensors",
864
+ "transformer.h.53.ln_mlp.weight": "model-00002-of-00003.safetensors",
865
+ "transformer.h.53.ln_mlp.bias": "model-00002-of-00003.safetensors",
866
+ "transformer.h.53.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
867
+ "transformer.h.53.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
868
+ "transformer.h.53.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
869
+ "transformer.h.53.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
870
+ "transformer.h.53.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
871
+ "transformer.h.53.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
872
+ "transformer.h.54.ln_attn.weight": "model-00003-of-00003.safetensors",
873
+ "transformer.h.54.ln_attn.bias": "model-00003-of-00003.safetensors",
874
+ "transformer.h.54.self_attention.query_key_value.qweight": "model-00003-of-00003.safetensors",
875
+ "transformer.h.54.self_attention.query_key_value.qzeros": "model-00003-of-00003.safetensors",
876
+ "transformer.h.54.self_attention.query_key_value.scales": "model-00003-of-00003.safetensors",
877
+ "transformer.h.54.self_attention.dense.qweight": "model-00003-of-00003.safetensors",
878
+ "transformer.h.54.self_attention.dense.qzeros": "model-00003-of-00003.safetensors",
879
+ "transformer.h.54.self_attention.dense.scales": "model-00003-of-00003.safetensors",
880
+ "transformer.h.54.ln_mlp.weight": "model-00003-of-00003.safetensors",
881
+ "transformer.h.54.ln_mlp.bias": "model-00003-of-00003.safetensors",
882
+ "transformer.h.54.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
883
+ "transformer.h.54.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
884
+ "transformer.h.54.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
885
+ "transformer.h.54.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
886
+ "transformer.h.54.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
887
+ "transformer.h.54.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
888
+ "transformer.h.55.ln_attn.weight": "model-00003-of-00003.safetensors",
889
+ "transformer.h.55.ln_attn.bias": "model-00003-of-00003.safetensors",
890
+ "transformer.h.55.self_attention.query_key_value.qweight": "model-00003-of-00003.safetensors",
891
+ "transformer.h.55.self_attention.query_key_value.qzeros": "model-00003-of-00003.safetensors",
892
+ "transformer.h.55.self_attention.query_key_value.scales": "model-00003-of-00003.safetensors",
893
+ "transformer.h.55.self_attention.dense.qweight": "model-00003-of-00003.safetensors",
894
+ "transformer.h.55.self_attention.dense.qzeros": "model-00003-of-00003.safetensors",
895
+ "transformer.h.55.self_attention.dense.scales": "model-00003-of-00003.safetensors",
896
+ "transformer.h.55.ln_mlp.weight": "model-00003-of-00003.safetensors",
897
+ "transformer.h.55.ln_mlp.bias": "model-00003-of-00003.safetensors",
898
+ "transformer.h.55.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
899
+ "transformer.h.55.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
900
+ "transformer.h.55.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
901
+ "transformer.h.55.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
902
+ "transformer.h.55.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
903
+ "transformer.h.55.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
904
+ "transformer.h.56.ln_attn.weight": "model-00003-of-00003.safetensors",
905
+ "transformer.h.56.ln_attn.bias": "model-00003-of-00003.safetensors",
906
+ "transformer.h.56.self_attention.query_key_value.qweight": "model-00003-of-00003.safetensors",
907
+ "transformer.h.56.self_attention.query_key_value.qzeros": "model-00003-of-00003.safetensors",
908
+ "transformer.h.56.self_attention.query_key_value.scales": "model-00003-of-00003.safetensors",
909
+ "transformer.h.56.self_attention.dense.qweight": "model-00003-of-00003.safetensors",
910
+ "transformer.h.56.self_attention.dense.qzeros": "model-00003-of-00003.safetensors",
911
+ "transformer.h.56.self_attention.dense.scales": "model-00003-of-00003.safetensors",
912
+ "transformer.h.56.ln_mlp.weight": "model-00003-of-00003.safetensors",
913
+ "transformer.h.56.ln_mlp.bias": "model-00003-of-00003.safetensors",
914
+ "transformer.h.56.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
915
+ "transformer.h.56.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
916
+ "transformer.h.56.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
917
+ "transformer.h.56.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
918
+ "transformer.h.56.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
919
+ "transformer.h.56.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
920
+ "transformer.h.57.ln_attn.weight": "model-00003-of-00003.safetensors",
921
+ "transformer.h.57.ln_attn.bias": "model-00003-of-00003.safetensors",
922
+ "transformer.h.57.self_attention.query_key_value.qweight": "model-00003-of-00003.safetensors",
923
+ "transformer.h.57.self_attention.query_key_value.qzeros": "model-00003-of-00003.safetensors",
924
+ "transformer.h.57.self_attention.query_key_value.scales": "model-00003-of-00003.safetensors",
925
+ "transformer.h.57.self_attention.dense.qweight": "model-00003-of-00003.safetensors",
926
+ "transformer.h.57.self_attention.dense.qzeros": "model-00003-of-00003.safetensors",
927
+ "transformer.h.57.self_attention.dense.scales": "model-00003-of-00003.safetensors",
928
+ "transformer.h.57.ln_mlp.weight": "model-00003-of-00003.safetensors",
929
+ "transformer.h.57.ln_mlp.bias": "model-00003-of-00003.safetensors",
930
+ "transformer.h.57.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
931
+ "transformer.h.57.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
932
+ "transformer.h.57.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
933
+ "transformer.h.57.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
934
+ "transformer.h.57.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
935
+ "transformer.h.57.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
936
+ "transformer.h.58.ln_attn.weight": "model-00003-of-00003.safetensors",
937
+ "transformer.h.58.ln_attn.bias": "model-00003-of-00003.safetensors",
938
+ "transformer.h.58.self_attention.query_key_value.qweight": "model-00003-of-00003.safetensors",
939
+ "transformer.h.58.self_attention.query_key_value.qzeros": "model-00003-of-00003.safetensors",
940
+ "transformer.h.58.self_attention.query_key_value.scales": "model-00003-of-00003.safetensors",
941
+ "transformer.h.58.self_attention.dense.qweight": "model-00003-of-00003.safetensors",
942
+ "transformer.h.58.self_attention.dense.qzeros": "model-00003-of-00003.safetensors",
943
+ "transformer.h.58.self_attention.dense.scales": "model-00003-of-00003.safetensors",
944
+ "transformer.h.58.ln_mlp.weight": "model-00003-of-00003.safetensors",
945
+ "transformer.h.58.ln_mlp.bias": "model-00003-of-00003.safetensors",
946
+ "transformer.h.58.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
947
+ "transformer.h.58.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
948
+ "transformer.h.58.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
949
+ "transformer.h.58.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
950
+ "transformer.h.58.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
951
+ "transformer.h.58.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
952
+ "transformer.h.59.ln_attn.weight": "model-00003-of-00003.safetensors",
953
+ "transformer.h.59.ln_attn.bias": "model-00003-of-00003.safetensors",
954
+ "transformer.h.59.self_attention.query_key_value.qweight": "model-00003-of-00003.safetensors",
955
+ "transformer.h.59.self_attention.query_key_value.qzeros": "model-00003-of-00003.safetensors",
956
+ "transformer.h.59.self_attention.query_key_value.scales": "model-00003-of-00003.safetensors",
957
+ "transformer.h.59.self_attention.dense.qweight": "model-00003-of-00003.safetensors",
958
+ "transformer.h.59.self_attention.dense.qzeros": "model-00003-of-00003.safetensors",
959
+ "transformer.h.59.self_attention.dense.scales": "model-00003-of-00003.safetensors",
960
+ "transformer.h.59.ln_mlp.weight": "model-00003-of-00003.safetensors",
961
+ "transformer.h.59.ln_mlp.bias": "model-00003-of-00003.safetensors",
962
+ "transformer.h.59.mlp.dense_h_to_4h.qweight": "model-00003-of-00003.safetensors",
963
+ "transformer.h.59.mlp.dense_h_to_4h.qzeros": "model-00003-of-00003.safetensors",
964
+ "transformer.h.59.mlp.dense_h_to_4h.scales": "model-00003-of-00003.safetensors",
965
+ "transformer.h.59.mlp.dense_4h_to_h.qweight": "model-00003-of-00003.safetensors",
966
+ "transformer.h.59.mlp.dense_4h_to_h.qzeros": "model-00003-of-00003.safetensors",
967
+ "transformer.h.59.mlp.dense_4h_to_h.scales": "model-00003-of-00003.safetensors",
968
+ "transformer.ln_f.weight": "model-00003-of-00003.safetensors",
969
+ "transformer.ln_f.bias": "model-00003-of-00003.safetensors"
970
+ }
971
+ }
modeling_RW.py ADDED
@@ -0,0 +1,1134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # port of models described in RW
2
+ # We use the bloom model as a starting point for these model.
3
+ # Please refer to the bloom models for usage instructions.
4
+
5
+ import math
6
+ import warnings
7
+ from typing import Optional, Tuple, Union
8
+
9
+ import torch
10
+ import torch.utils.checkpoint
11
+ from torch import nn
12
+ from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, LayerNorm, MSELoss
13
+ from torch.nn import functional as F
14
+
15
+ from transformers.modeling_outputs import (
16
+ BaseModelOutputWithPastAndCrossAttentions,
17
+ CausalLMOutputWithCrossAttentions,
18
+ QuestionAnsweringModelOutput,
19
+ SequenceClassifierOutputWithPast,
20
+ TokenClassifierOutput,
21
+ )
22
+ from transformers.modeling_utils import PreTrainedModel
23
+ from transformers.utils import logging
24
+ from .configuration_RW import RWConfig
25
+
26
+ logger = logging.get_logger(__name__)
27
+
28
+ # NOTE: Unfortunately we did not fuse matmul and bias during training, this means that there's one additional quantization to bfloat16 between the operations.
29
+ # In order not to degrade the quality of our HF-port, we keep these characteristics in the final model.
30
+ class Linear(nn.Linear):
31
+ def forward(self, input: torch.Tensor) -> torch.Tensor:
32
+ ret = input @ self.weight.T
33
+ if self.bias is None:
34
+ return ret
35
+ else:
36
+ return ret + self.bias
37
+
38
+
39
+ from einops import rearrange
40
+
41
+ # rotary pos emb helpers (torch.jit.script does not seem to support staticmethod...)
42
+ def rotate_half(x):
43
+ x1, x2 = x[..., : x.shape[-1] // 2], x[..., x.shape[-1] // 2 :]
44
+ return torch.cat((-x2, x1), dim=x1.ndim - 1) # dim=-1 triggers a bug in torch < 1.8.0
45
+
46
+
47
+ class RotaryEmbedding(torch.nn.Module):
48
+ """Implementation of RotaryEmbedding from GPT-NeoX.
49
+ This implementation is design to operate on queries and keys that are compatible with
50
+ [batch_size, n_heads_per_partition, seq_len, head_dim] (e.g. MinGPTAttention format).
51
+ """
52
+
53
+ def __init__(
54
+ self,
55
+ head_dim: int,
56
+ base=10000,
57
+ position_interpolation_factor=1,
58
+ embedding_factor=None
59
+ ):
60
+ super().__init__()
61
+ inv_freq = 1.0 / (base ** (torch.arange(0, head_dim, 2).float() / head_dim))
62
+ self.position_interpolation_factor = position_interpolation_factor
63
+ self.embedding_factor = embedding_factor
64
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
65
+ self.head_dim = head_dim
66
+ self.seq_len_cached = None
67
+ self.batch_size_cached = None
68
+ self.cos_cached: torch.Tensor | None = None
69
+ self.sin_cached: torch.Tensor | None = None
70
+
71
+ def cos_sin(
72
+ self,
73
+ seq_len: int,
74
+ device="cuda",
75
+ dtype=torch.bfloat16,
76
+ ) -> torch.Tensor:
77
+ if seq_len != self.seq_len_cached:
78
+ self.seq_len_cached = seq_len
79
+ t = torch.arange(seq_len, device=device).type_as(self.inv_freq)
80
+ freqs = torch.einsum("i,j->ij", t, self.inv_freq) / self.position_interpolation_factor
81
+ emb = torch.cat((freqs, freqs), dim=-1).to(device)
82
+
83
+ if dtype in [torch.float16, torch.bfloat16]:
84
+ emb = emb.float()
85
+
86
+ self.cos_cached = emb.cos()[None, :, :]
87
+ self.sin_cached = emb.sin()[None, :, :]
88
+
89
+ self.cos_cached = self.cos_cached.type(dtype)
90
+ self.sin_cached = self.sin_cached.type(dtype)
91
+
92
+ return self.cos_cached, self.sin_cached
93
+
94
+ def forward(self, q, k):
95
+ batch, seq_len, head_dim = q.shape
96
+ cos, sin = self.cos_sin(seq_len, q.device, q.dtype)
97
+ if self.embedding_factor is not None:
98
+ cos = cos * self.embedding_factor
99
+ sin = sin * self.embedding_factor
100
+ return (q * cos) + (rotate_half(q) * sin), (k * cos) + (rotate_half(k) * sin)
101
+
102
+
103
+ def _make_causal_mask(
104
+ input_ids_shape: torch.Size, device: torch.device, past_key_values_length: int
105
+ ) -> torch.BoolTensor:
106
+ batch_size, target_length = input_ids_shape
107
+ mask = torch.empty((target_length, target_length + past_key_values_length), dtype=torch.bool, device=device)
108
+ # ONNX doesn't support `torch.Tensor.triu` properly, thus we use this workaround
109
+ seq_ids = torch.arange(target_length, device=device)
110
+ mask[:, past_key_values_length:] = seq_ids[:, None] < seq_ids[None, :]
111
+
112
+ if past_key_values_length > 0:
113
+ mask[:, :past_key_values_length] = False
114
+
115
+ expanded_mask = mask[None, None, :, :].expand(batch_size, 1, target_length, target_length + past_key_values_length)
116
+ return expanded_mask
117
+
118
+
119
+ def _expand_mask(mask: torch.Tensor, tgt_length: int) -> torch.BoolTensor:
120
+ batch_size, src_length = mask.shape
121
+ tgt_length = tgt_length if tgt_length is not None else src_length
122
+
123
+ expanded_mask = ~(mask[:, None, None, :].to(torch.bool))
124
+ return expanded_mask.expand(batch_size, 1, tgt_length, src_length)
125
+
126
+
127
+ def build_alibi_tensor(attention_mask: torch.Tensor, num_heads: int, dtype: torch.dtype) -> torch.Tensor:
128
+ batch_size, seq_length = attention_mask.shape
129
+ closest_power_of_2 = 2 ** math.floor(math.log2(num_heads))
130
+ base = torch.tensor(
131
+ 2 ** (-(2 ** -(math.log2(closest_power_of_2) - 3))), device=attention_mask.device, dtype=torch.float32
132
+ )
133
+ powers = torch.arange(1, 1 + closest_power_of_2, device=attention_mask.device, dtype=torch.int32)
134
+ slopes = torch.pow(base, powers)
135
+
136
+ if closest_power_of_2 != num_heads:
137
+ extra_base = torch.tensor(
138
+ 2 ** (-(2 ** -(math.log2(2 * closest_power_of_2) - 3))), device=attention_mask.device, dtype=torch.float32
139
+ )
140
+ num_remaining_heads = min(closest_power_of_2, num_heads - closest_power_of_2)
141
+ extra_powers = torch.arange(1, 1 + 2 * num_remaining_heads, 2, device=attention_mask.device, dtype=torch.int32)
142
+ slopes = torch.cat([slopes, torch.pow(extra_base, extra_powers)], dim=0)
143
+
144
+ # Note: alibi will added to the attention bias that will be applied to the query, key product of attention
145
+ # => therefore alibi will have to be of shape (batch_size, num_heads, query_length, key_length)
146
+ # => here we set (batch_size=1, num_heads=num_heads, query_length=1, key_length=max_length)
147
+ # => the query_length dimension will then be broadcasted correctly
148
+ # This is more or less identical to T5's relative position bias:
149
+ # https://github.com/huggingface/transformers/blob/f681437203baa7671de3174b0fa583c349d9d5e1/src/transformers/models/t5/modeling_t5.py#L527
150
+ arange_tensor = ((attention_mask.cumsum(dim=-1) - 1) * attention_mask)[:, None, :]
151
+ alibi = slopes[..., None].bfloat16() * arange_tensor
152
+ return alibi.reshape(batch_size * num_heads, 1, seq_length).to(dtype)
153
+
154
+
155
+ def dropout_add(x: torch.Tensor, residual: torch.Tensor, prob: float, training: bool) -> torch.Tensor:
156
+ out = F.dropout(x, p=prob, training=training)
157
+ out = residual + out
158
+ return out
159
+
160
+
161
+ class Attention(nn.Module):
162
+ def __init__(self, config: RWConfig):
163
+ super().__init__()
164
+
165
+ self.hidden_size = config.hidden_size
166
+ self.num_heads = config.n_head
167
+ self.head_dim = self.hidden_size // self.num_heads
168
+ self.split_size = self.hidden_size
169
+ self.hidden_dropout = config.hidden_dropout
170
+
171
+ if self.head_dim * self.num_heads != self.hidden_size:
172
+ raise ValueError(
173
+ f"`hidden_size` must be divisible by num_heads (got `hidden_size`: {self.hidden_size} and `num_heads`:"
174
+ f" {self.num_heads})."
175
+ )
176
+
177
+ # create rotary embedding and apply context scaling if any
178
+ base = 10000
179
+ scale = 1 if config.vanilla_scaling_factor is None else config.vanilla_scaling_factor
180
+ if config.ntk_scaling_factor is not None:
181
+ base = base * (config.ntk_scaling_factor ** (self.head_dim / (self.head_dim - 2)))
182
+ embedding_scale = None if config.embedding_scaling_factor is None else 0.1 * math.log(config.embedding_scaling_factor) + 1
183
+ self.maybe_rotary = RotaryEmbedding(config.head_dim, base, scale, embedding_scale) if config.rotary else lambda q, k: (q, k)
184
+
185
+ # Layer-wise attention scaling
186
+ self.inv_norm_factor = 1.0 / math.sqrt(self.head_dim)
187
+ self.beta = self.inv_norm_factor
188
+ self.num_kv = config.n_head if not config.multi_query else config.n_head_kv
189
+ self.query_key_value = Linear(
190
+ self.hidden_size,
191
+ (self.num_kv * 2 + config.n_head) * self.head_dim,
192
+ bias=config.bias,
193
+ )
194
+ self.multi_query = config.multi_query
195
+ self.dense = Linear(self.hidden_size, self.hidden_size, bias=config.bias)
196
+ self.attention_dropout = nn.Dropout(config.attention_dropout)
197
+
198
+
199
+ def _split_heads(self, fused_qkv: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
200
+ """
201
+ Split the last dimension into (num_heads, head_dim) without making any copies, results share same memory
202
+ storage as `fused_qkv`
203
+
204
+ Args:
205
+ fused_qkv (`torch.tensor`, *required*): [batch_size, seq_length, (num_heads + 2 * num_kv) * head_dim]
206
+
207
+ Returns:
208
+ query: [batch_size, seq_length, num_heads, head_dim]
209
+ key: [batch_size, seq_length, num_heads, head_dim]
210
+ value: [batch_size, seq_length, num_heads, head_dim]
211
+ """
212
+ if not self.multi_query:
213
+ batch_size, seq_length, _ = fused_qkv.shape
214
+ fused_qkv = fused_qkv.view(batch_size, seq_length, self.num_heads, 3, self.head_dim)
215
+ return fused_qkv[..., 0, :], fused_qkv[..., 1, :], fused_qkv[..., 2, :]
216
+ else:
217
+ batch, seq_len, _ = fused_qkv.shape
218
+ qkv = fused_qkv.view(batch, seq_len, -1, self.num_heads // self.num_kv + 2, 64)
219
+ q = qkv[:, :, :, :-2]
220
+ k = qkv[:, :, :, [-2]]
221
+ v = qkv[:, :, :, [-1]]
222
+ k = torch.broadcast_to(k, q.shape)
223
+ v = torch.broadcast_to(v, q.shape)
224
+
225
+
226
+ q, k, v = [
227
+ rearrange(
228
+ x,
229
+ "batch seq_len group num_heads head_dim ->\
230
+ batch seq_len (group num_heads) head_dim",
231
+ head_dim=self.head_dim,
232
+ )
233
+ for x in [q, k, v]
234
+ ]
235
+ return q, k, v
236
+
237
+ def _merge_heads(self, x: torch.Tensor) -> torch.Tensor:
238
+ """
239
+ Merge heads together over the last dimenstion
240
+
241
+ Args:
242
+ x: (`torch.tensor`, *required*): [batch_size * num_heads, seq_length, head_dim]
243
+
244
+ Returns:
245
+ torch.tensor: [batch_size, seq_length, num_heads * head_dim]
246
+ """
247
+ # What we want to achieve is:
248
+ # batch_size * num_heads, seq_length, head_dim -> batch_size, seq_length, num_heads * head_dim
249
+ batch_size_and_num_heads, seq_length, _ = x.shape
250
+ batch_size = batch_size_and_num_heads // self.num_heads
251
+
252
+ # First view to decompose the batch size
253
+ # batch_size * num_heads, seq_length, head_dim -> batch_size, num_heads, seq_length, head_dim
254
+ x = x.view(batch_size, self.num_heads, seq_length, self.head_dim)
255
+
256
+ # batch_size, num_heads, seq_length, head_dim -> batch_size, seq_length, num_heads, head_dim
257
+ x = x.permute(0, 2, 1, 3)
258
+
259
+ # batch_size, seq_length, num_heads, head_dim -> batch_size, seq_length, num_heads * head_dim
260
+ return x.reshape(batch_size, seq_length, self.num_heads * self.head_dim)
261
+
262
+ def forward(
263
+ self,
264
+ hidden_states: torch.Tensor,
265
+ alibi: torch.Tensor,
266
+ attention_mask: torch.Tensor,
267
+ layer_past: Optional[Tuple[torch.Tensor, torch.Tensor]] = None,
268
+ head_mask: Optional[torch.Tensor] = None,
269
+ use_cache: bool = False,
270
+ output_attentions: bool = False,
271
+ ):
272
+ fused_qkv = self.query_key_value(hidden_states) # [batch_size, seq_length, 3 x hidden_size]
273
+
274
+ # 3 x [batch_size, seq_length, num_heads, head_dim]
275
+ (query_layer, key_layer, value_layer) = self._split_heads(fused_qkv)
276
+
277
+ batch_size, q_length, _, _ = query_layer.shape
278
+
279
+ query_layer = query_layer.transpose(1, 2).reshape(batch_size * self.num_heads, q_length, self.head_dim)
280
+ key_layer = key_layer.transpose(1, 2).reshape(
281
+ batch_size * self.num_heads,
282
+ q_length,
283
+ self.head_dim,
284
+ )
285
+ value_layer = value_layer.transpose(1, 2).reshape(batch_size * self.num_heads, q_length, self.head_dim)
286
+
287
+ query_layer, key_layer = self.maybe_rotary(query_layer, key_layer)
288
+
289
+ if layer_past is not None:
290
+ past_key, past_value = layer_past
291
+ # concatenate along seq_length dimension:
292
+ # - key: [batch_size * self.num_heads, head_dim, kv_length]
293
+ # - value: [batch_size * self.num_heads, kv_length, head_dim]
294
+ key_layer = torch.cat((past_key, key_layer), dim=1)
295
+ value_layer = torch.cat((past_value, value_layer), dim=1)
296
+
297
+ _, kv_length, _ = key_layer.shape
298
+
299
+ if use_cache is True:
300
+ present = (key_layer, value_layer)
301
+ else:
302
+ present = None
303
+
304
+ if alibi is None:
305
+ query_layer_ = query_layer.reshape(batch_size, self.num_heads, -1, self.head_dim)
306
+ key_layer_ = key_layer.reshape(batch_size, self.num_heads, -1, self.head_dim)
307
+ value_layer_ = value_layer.reshape(batch_size, self.num_heads, -1, self.head_dim)
308
+
309
+ attn_output = F.scaled_dot_product_attention(
310
+ query_layer_, key_layer_, value_layer_, None, 0.0, is_causal=True
311
+ )
312
+
313
+ x = attn_output.view(batch_size, self.num_heads, q_length, self.head_dim)
314
+ x = x.permute(0, 2, 1, 3)
315
+ attn_output = x.reshape(batch_size, q_length, self.num_heads * self.head_dim)
316
+
317
+ output_tensor = self.dense(attn_output)
318
+
319
+ outputs = (output_tensor, present)
320
+ assert not output_attentions # not supported.
321
+ return outputs
322
+ else:
323
+ attention_mask_float = (attention_mask * 1.0).masked_fill(attention_mask, -1e9).to(torch.bfloat16)
324
+ matmul_result = query_layer @ key_layer.transpose(-1, -2)
325
+
326
+ # change view to [batch_size, num_heads, q_length, kv_length]
327
+ attention_scores = matmul_result.view(batch_size, self.num_heads, q_length, kv_length)
328
+
329
+ # cast attention scores to fp32, compute scaled softmax and cast back to initial dtype - [batch_size, num_heads, q_length, kv_length]
330
+ input_dtype = attention_scores.dtype
331
+ # `float16` has a minimum value of -65504.0, whereas `bfloat16` and `float32` have a minimum value of `-3.4e+38`
332
+ if input_dtype == torch.float16 or input_dtype == torch.bfloat16:
333
+ attention_scores = attention_scores.to(torch.float32)
334
+ # attn_weights = torch.masked_fill(attention_scores, attention_mask, torch.finfo(attention_scores.dtype).min)
335
+ attention_probs = F.softmax(
336
+ (attention_scores + alibi) * self.inv_norm_factor + attention_mask_float,
337
+ dim=-1,
338
+ dtype=hidden_states.dtype,
339
+ )
340
+ # [batch_size, num_heads, q_length, kv_length]
341
+ attention_probs = self.attention_dropout(attention_probs)
342
+
343
+ if head_mask is not None:
344
+ attention_probs = attention_probs * head_mask
345
+
346
+ # change view [batch_size x num_heads, q_length, kv_length]
347
+ attention_probs_reshaped = attention_probs.view(batch_size * self.num_heads, q_length, kv_length)
348
+
349
+ # matmul: [batch_size * num_heads, q_length, head_dim]
350
+ context_layer = attention_probs_reshaped @ value_layer
351
+
352
+ # change view [batch_size, num_heads, q_length, head_dim]
353
+ context_layer = self._merge_heads(context_layer)
354
+
355
+ output_tensor = self.dense(context_layer)
356
+
357
+ outputs = (output_tensor, present)
358
+ if output_attentions:
359
+ outputs += (attention_probs,)
360
+
361
+ return outputs
362
+
363
+
364
+ class MLP(nn.Module):
365
+ def __init__(self, config: RWConfig):
366
+ super().__init__()
367
+ hidden_size = config.hidden_size
368
+
369
+ self.dense_h_to_4h = Linear(hidden_size, 4 * hidden_size, bias=config.bias)
370
+ self.act = nn.GELU()
371
+ self.dense_4h_to_h = Linear(4 * hidden_size, hidden_size, bias=config.bias)
372
+ self.hidden_dropout = config.hidden_dropout
373
+
374
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
375
+ x = self.act(self.dense_h_to_4h(x))
376
+ x = self.dense_4h_to_h(x)
377
+ return x
378
+
379
+
380
+ class DecoderLayer(nn.Module):
381
+ def __init__(self, config: RWConfig):
382
+ super().__init__()
383
+ hidden_size = config.hidden_size
384
+
385
+ self.ln_attn = LayerNorm(hidden_size, eps=config.layer_norm_epsilon)
386
+ self.num_heads = config.n_head
387
+ self.self_attention = Attention(config)
388
+
389
+ self.ln_mlp = LayerNorm(hidden_size, eps=config.layer_norm_epsilon)
390
+
391
+ self.mlp = MLP(config)
392
+
393
+ self.apply_residual_connection_post_layernorm = config.apply_residual_connection_post_layernorm
394
+ self.hidden_dropout = config.hidden_dropout
395
+
396
+ self.config = config
397
+
398
+ def forward(
399
+ self,
400
+ hidden_states: torch.Tensor,
401
+ alibi: torch.Tensor,
402
+ attention_mask: torch.Tensor,
403
+ layer_past: Optional[Tuple[torch.Tensor, torch.Tensor]] = None,
404
+ head_mask: Optional[torch.Tensor] = None,
405
+ use_cache: bool = False,
406
+ output_attentions: bool = False,
407
+ ):
408
+ # hidden_states: [batch_size, seq_length, hidden_size]
409
+
410
+ # Layer norm at the beginning of the transformer layer.
411
+ layernorm_output = self.ln_attn(hidden_states)
412
+
413
+ # Layer norm post the self attention.
414
+ residual = hidden_states
415
+
416
+ # Self attention.
417
+ attn_outputs = self.self_attention(
418
+ layernorm_output,
419
+ layer_past=layer_past,
420
+ attention_mask=attention_mask,
421
+ alibi=alibi,
422
+ head_mask=head_mask,
423
+ use_cache=use_cache,
424
+ output_attentions=output_attentions,
425
+ )
426
+
427
+ attention_output = attn_outputs[0]
428
+
429
+ if not self.config.parallel_attn:
430
+ residual = dropout_add(attention_output, residual, self.config.attention_dropout, training=self.training)
431
+ layernorm_output = self.ln_mlp(residual)
432
+ elif not self.config.single_ln:
433
+ layernorm_output = self.ln_mlp(residual)
434
+
435
+ outputs = attn_outputs[1:]
436
+
437
+ # MLP.
438
+ mlp_output = self.mlp(layernorm_output)
439
+
440
+ if self.config.parallel_attn:
441
+ mlp_output += attention_output
442
+
443
+ output = dropout_add(mlp_output, residual, self.config.hidden_dropout, training=self.training)
444
+
445
+ if use_cache:
446
+ outputs = (output,) + outputs
447
+ else:
448
+ outputs = (output,) + outputs[1:]
449
+
450
+ return outputs # hidden_states, present, attentions
451
+
452
+
453
+ class RWPreTrainedModel(PreTrainedModel):
454
+ _keys_to_ignore_on_load_missing = [r"h.*.self_attention.scale_mask_softmax.causal_mask", r"lm_head.weight"]
455
+ """
456
+ An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
457
+ models.
458
+ """
459
+
460
+ config_class = RWConfig
461
+ base_model_prefix = "transformer"
462
+ supports_gradient_checkpointing = True
463
+ _no_split_modules = ["DecoderLayer"]
464
+
465
+ def __init__(self, *inputs, **kwargs):
466
+ super().__init__(*inputs, **kwargs)
467
+
468
+ def _init_weights(self, module: nn.Module):
469
+ """Initialize the weights."""
470
+ if isinstance(module, nn.Linear) or isinstance(module, Linear):
471
+ # Slightly different from the TF version which uses truncated_normal for initialization
472
+ # cf https://github.com/pytorch/pytorch/pull/5617
473
+ module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
474
+ if module.bias is not None:
475
+ module.bias.data.zero_()
476
+ elif isinstance(module, nn.Embedding):
477
+ module.weight.data.normal_(mean=0.0, std=self.config.initializer_range)
478
+ if module.padding_idx is not None:
479
+ module.weight.data[module.padding_idx].zero_()
480
+ elif isinstance(module, LayerNorm):
481
+ module.bias.data.zero_()
482
+ module.weight.data.fill_(1.0)
483
+
484
+ def _set_gradient_checkpointing(self, module: nn.Module, value: bool = False):
485
+ if isinstance(module, RWModel):
486
+ module.gradient_checkpointing = value
487
+
488
+ @staticmethod
489
+ def _convert_to_standard_cache(
490
+ past_key_value: Tuple[Tuple[torch.Tensor, torch.Tensor]], batch_size: int
491
+ ) -> Tuple[Tuple[torch.Tensor, torch.Tensor]]:
492
+ """
493
+ Standardizes the format of the cache so as to match most implementations, i.e. to tuple(tuple([batch_size,
494
+ num_heads, ...]))
495
+ """
496
+ batch_size_times_num_heads, head_dim, seq_length = past_key_value[0][0].shape
497
+ num_heads = batch_size_times_num_heads // batch_size
498
+ # key: [batch_size * num_heads, head_dim, seq_length] -> [batch_size, num_heads, head_dim, seq_length]
499
+ # value: [batch_size * num_heads, seq_length, head_dim] -> [batch_size, num_heads, seq_length, head_dim]
500
+ return tuple(
501
+ (
502
+ layer_past[0].view(batch_size, num_heads, head_dim, seq_length),
503
+ layer_past[1].view(batch_size, num_heads, seq_length, head_dim),
504
+ )
505
+ for layer_past in past_key_value
506
+ )
507
+
508
+ @staticmethod
509
+ def _convert_to_rw_cache(
510
+ past_key_value: Tuple[Tuple[torch.Tensor, torch.Tensor]]
511
+ ) -> Tuple[Tuple[torch.Tensor, torch.Tensor]]:
512
+ batch_size, num_heads, head_dim, seq_length = past_key_value[0][0].shape
513
+ batch_size_times_num_heads = batch_size * num_heads
514
+ # key: [batch_size, num_heads, head_dim, seq_length] -> [batch_size * num_heads, head_dim, seq_length]
515
+ # value: [batch_size, num_heads, seq_length, head_dim] -> [batch_size * num_heads, seq_length, head_dim]
516
+ return tuple(
517
+ (
518
+ layer_past[0].view(batch_size_times_num_heads, head_dim, seq_length),
519
+ layer_past[1].view(batch_size_times_num_heads, seq_length, head_dim),
520
+ )
521
+ for layer_past in past_key_value
522
+ )
523
+
524
+
525
+ class RWModel(RWPreTrainedModel):
526
+ def __init__(self, config: RWConfig):
527
+ super().__init__(config)
528
+
529
+ self.embed_dim = config.hidden_size
530
+ self.num_heads = config.n_head
531
+ self.alibi = config.alibi
532
+
533
+ # Embedding + LN Embedding
534
+ self.word_embeddings = nn.Embedding(config.vocab_size, self.embed_dim)
535
+
536
+ # Transformer blocks
537
+ self.h = nn.ModuleList([DecoderLayer(config) for _ in range(config.num_hidden_layers)])
538
+
539
+ # Final Layer Norm
540
+ self.ln_f = LayerNorm(self.embed_dim, eps=config.layer_norm_epsilon)
541
+
542
+ self.gradient_checkpointing = False
543
+
544
+ # Initialize weights and apply final processing
545
+ self.post_init()
546
+
547
+ def get_input_embeddings(self):
548
+ return self.word_embeddings
549
+
550
+ def _prepare_attn_mask(
551
+ self, attention_mask: torch.Tensor, input_shape: Tuple[int, int], past_key_values_length: int
552
+ ) -> torch.BoolTensor:
553
+ # create causal mask
554
+ # [batch_size, seq_length] -> [batch_size, 1, tgt_length, src_length]
555
+ combined_attention_mask = None
556
+ device = attention_mask.device
557
+ _, src_length = input_shape
558
+
559
+ if src_length > 1:
560
+ combined_attention_mask = _make_causal_mask(
561
+ input_shape, device=device, past_key_values_length=past_key_values_length
562
+ )
563
+
564
+ # [batch_size, seq_length] -> [batch_size, 1, tgt_length, src_length]
565
+ expanded_attn_mask = _expand_mask(attention_mask, tgt_length=src_length)
566
+ combined_attention_mask = (
567
+ expanded_attn_mask if combined_attention_mask is None else expanded_attn_mask | combined_attention_mask
568
+ )
569
+
570
+ return combined_attention_mask
571
+
572
+ def set_input_embeddings(self, new_embeddings: torch.Tensor):
573
+ self.word_embeddings = new_embeddings
574
+
575
+ def forward(
576
+ self,
577
+ input_ids: Optional[torch.LongTensor] = None,
578
+ past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
579
+ attention_mask: Optional[torch.Tensor] = None,
580
+ head_mask: Optional[torch.LongTensor] = None,
581
+ inputs_embeds: Optional[torch.LongTensor] = None,
582
+ use_cache: Optional[bool] = None,
583
+ output_attentions: Optional[bool] = None,
584
+ output_hidden_states: Optional[bool] = None,
585
+ return_dict: Optional[bool] = None,
586
+ **deprecated_arguments,
587
+ ) -> Union[Tuple[torch.Tensor, ...], BaseModelOutputWithPastAndCrossAttentions]:
588
+ if deprecated_arguments.pop("position_ids", False) is not False:
589
+ # `position_ids` could have been `torch.Tensor` or `None` so defaulting pop to `False` allows to detect if users were passing explicitly `None`
590
+ warnings.warn(
591
+ "`position_ids` have no functionality in BLOOM and will be removed in v5.0.0. You can safely ignore"
592
+ " passing `position_ids`.",
593
+ FutureWarning,
594
+ )
595
+ if len(deprecated_arguments) > 0:
596
+ raise ValueError(f"Got unexpected arguments: {deprecated_arguments}")
597
+
598
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
599
+ output_hidden_states = (
600
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
601
+ )
602
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
603
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
604
+
605
+ if input_ids is not None and inputs_embeds is not None:
606
+ raise ValueError("You cannot specify both input_ids and inputs_embeds at the same time")
607
+ elif input_ids is not None:
608
+ batch_size, seq_length = input_ids.shape
609
+ elif inputs_embeds is not None:
610
+ batch_size, seq_length, _ = inputs_embeds.shape
611
+ else:
612
+ raise ValueError("You have to specify either input_ids or inputs_embeds")
613
+
614
+ if past_key_values is None:
615
+ past_key_values = tuple([None] * len(self.h))
616
+
617
+ # Prepare head mask if needed
618
+ # 1.0 in head_mask indicate we keep the head
619
+ # attention_probs has shape batch_size x num_heads x N x N
620
+ # head_mask has shape n_layer x batch x num_heads x N x N
621
+ head_mask = self.get_head_mask(head_mask, self.config.n_layer)
622
+
623
+ if inputs_embeds is None:
624
+ inputs_embeds = self.word_embeddings(input_ids)
625
+
626
+ hidden_states = inputs_embeds
627
+
628
+ presents = () if use_cache else None
629
+ all_self_attentions = () if output_attentions else None
630
+ all_hidden_states = () if output_hidden_states else None
631
+
632
+ # Compute alibi tensor: check build_alibi_tensor documentation
633
+ seq_length_with_past = seq_length
634
+ past_key_values_length = 0
635
+ if past_key_values[0] is not None:
636
+ past_key_values_length = past_key_values[0][0].shape[2]
637
+ seq_length_with_past = seq_length_with_past + past_key_values_length
638
+ if attention_mask is None:
639
+ attention_mask = torch.ones((batch_size, seq_length_with_past), device=hidden_states.device)
640
+ else:
641
+ attention_mask = attention_mask.to(hidden_states.device)
642
+
643
+ if self.alibi:
644
+ alibi = build_alibi_tensor(attention_mask, self.num_heads, dtype=hidden_states.dtype)
645
+ else:
646
+ alibi = None
647
+
648
+ causal_mask = self._prepare_attn_mask(
649
+ attention_mask,
650
+ input_shape=(batch_size, seq_length),
651
+ past_key_values_length=past_key_values_length,
652
+ )
653
+
654
+ for i, (block, layer_past) in enumerate(zip(self.h, past_key_values)):
655
+
656
+ if output_hidden_states:
657
+ all_hidden_states = all_hidden_states + (hidden_states,)
658
+
659
+ if self.gradient_checkpointing and self.training:
660
+
661
+ if use_cache:
662
+ logger.warning(
663
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..."
664
+ )
665
+ use_cache = False
666
+
667
+ def create_custom_forward(module):
668
+ def custom_forward(*inputs):
669
+ # None for past_key_value
670
+ return module(*inputs, use_cache=use_cache, output_attentions=output_attentions)
671
+
672
+ return custom_forward
673
+
674
+ outputs = torch.utils.checkpoint.checkpoint(
675
+ create_custom_forward(block),
676
+ hidden_states,
677
+ alibi,
678
+ causal_mask,
679
+ head_mask[i],
680
+ )
681
+ else:
682
+ outputs = block(
683
+ hidden_states,
684
+ layer_past=layer_past,
685
+ attention_mask=causal_mask,
686
+ head_mask=head_mask[i],
687
+ use_cache=use_cache,
688
+ output_attentions=output_attentions,
689
+ alibi=alibi,
690
+ )
691
+
692
+ hidden_states = outputs[0]
693
+ if use_cache is True:
694
+ presents = presents + (outputs[1],)
695
+
696
+ if output_attentions:
697
+ all_self_attentions = all_self_attentions + (outputs[2 if use_cache else 1],)
698
+
699
+ # Add last hidden state
700
+ hidden_states = self.ln_f(hidden_states)
701
+
702
+ if output_hidden_states:
703
+ all_hidden_states = all_hidden_states + (hidden_states,)
704
+
705
+ if not return_dict:
706
+ return tuple(v for v in [hidden_states, presents, all_hidden_states, all_self_attentions] if v is not None)
707
+
708
+ return BaseModelOutputWithPastAndCrossAttentions(
709
+ last_hidden_state=hidden_states,
710
+ past_key_values=presents,
711
+ hidden_states=all_hidden_states,
712
+ attentions=all_self_attentions,
713
+ )
714
+
715
+
716
+ class RWForCausalLM(RWPreTrainedModel):
717
+ _keys_to_ignore_on_load_missing = [r"h.*.self_attention.scale_mask_softmax.causal_mask", r"lm_head.weight"]
718
+
719
+ def __init__(self, config: RWConfig):
720
+ super().__init__(config)
721
+ self.transformer = RWModel(config)
722
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
723
+
724
+ # Initialize weights and apply final processing
725
+ self.post_init()
726
+
727
+ def get_output_embeddings(self):
728
+ return self.lm_head
729
+
730
+ def set_output_embeddings(self, new_embeddings: torch.Tensor):
731
+ self.lm_head = new_embeddings
732
+
733
+ def prepare_inputs_for_generation(
734
+ self,
735
+ input_ids: torch.LongTensor,
736
+ past: Optional[torch.Tensor] = None,
737
+ attention_mask: Optional[torch.Tensor] = None,
738
+ **kwargs,
739
+ ) -> dict:
740
+ # only last token for input_ids if past is not None
741
+ if past:
742
+ input_ids = input_ids[:, -1].unsqueeze(-1)
743
+
744
+ # the cache may be in the stardard format (e.g. in contrastive search), convert to our's format if needed
745
+ if past[0][0].shape[0] == input_ids.shape[0]:
746
+ past = self._convert_to_rw_cache(past)
747
+
748
+ return {
749
+ "input_ids": input_ids,
750
+ "past_key_values": past,
751
+ "use_cache": kwargs.get("use_cache"),
752
+ "attention_mask": attention_mask,
753
+ }
754
+
755
+ def forward(
756
+ self,
757
+ input_ids: Optional[torch.LongTensor] = None,
758
+ past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
759
+ attention_mask: Optional[torch.Tensor] = None,
760
+ head_mask: Optional[torch.Tensor] = None,
761
+ inputs_embeds: Optional[torch.Tensor] = None,
762
+ labels: Optional[torch.Tensor] = None,
763
+ use_cache: Optional[bool] = None,
764
+ output_attentions: Optional[bool] = None,
765
+ output_hidden_states: Optional[bool] = None,
766
+ return_dict: Optional[bool] = None,
767
+ **deprecated_arguments,
768
+ ) -> Union[Tuple[torch.Tensor], CausalLMOutputWithCrossAttentions]:
769
+ r"""
770
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
771
+ Labels for language modeling. Note that the labels **are shifted** inside the model, i.e. you can set
772
+ `labels = input_ids` Indices are selected in `[-100, 0, ..., config.vocab_size]` All labels set to `-100`
773
+ are ignored (masked), the loss is only computed for labels in `[0, ..., config.vocab_size]`
774
+ """
775
+ if deprecated_arguments.pop("position_ids", False) is not False:
776
+ # `position_ids` could have been `torch.Tensor` or `None` so defaulting pop to `False` allows to detect if users were passing explicitly `None`
777
+ warnings.warn(
778
+ "`position_ids` have no functionality in BLOOM and will be removed in v5.0.0. You can safely ignore"
779
+ " passing `position_ids`.",
780
+ FutureWarning,
781
+ )
782
+ if len(deprecated_arguments) > 0:
783
+ raise ValueError(f"Got unexpected arguments: {deprecated_arguments}")
784
+
785
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
786
+
787
+ transformer_outputs = self.transformer(
788
+ input_ids,
789
+ past_key_values=past_key_values,
790
+ attention_mask=attention_mask,
791
+ head_mask=head_mask,
792
+ inputs_embeds=inputs_embeds,
793
+ use_cache=use_cache,
794
+ output_attentions=output_attentions,
795
+ output_hidden_states=output_hidden_states,
796
+ return_dict=return_dict,
797
+ )
798
+ hidden_states = transformer_outputs[0]
799
+
800
+ lm_logits = self.lm_head(hidden_states)
801
+
802
+ loss = None
803
+ if labels is not None:
804
+ # Shift so that tokens < n predict n
805
+ shift_logits = lm_logits[..., :-1, :].contiguous()
806
+ shift_labels = labels[..., 1:].contiguous()
807
+ batch_size, seq_length, vocab_size = shift_logits.shape
808
+ # Flatten the tokens
809
+ loss_fct = CrossEntropyLoss()
810
+ loss = loss_fct(
811
+ shift_logits.view(batch_size * seq_length, vocab_size), shift_labels.view(batch_size * seq_length)
812
+ )
813
+
814
+ if not return_dict:
815
+ output = (lm_logits,) + transformer_outputs[1:]
816
+ return ((loss,) + output) if loss is not None else output
817
+
818
+ return CausalLMOutputWithCrossAttentions(
819
+ loss=loss,
820
+ logits=lm_logits,
821
+ past_key_values=transformer_outputs.past_key_values,
822
+ hidden_states=transformer_outputs.hidden_states,
823
+ attentions=transformer_outputs.attentions,
824
+ )
825
+
826
+ def _reorder_cache(
827
+ self, past: Tuple[Tuple[torch.Tensor, torch.Tensor], ...], beam_idx: torch.LongTensor
828
+ ) -> Tuple[Tuple[torch.Tensor, torch.Tensor], ...]:
829
+ """
830
+ This function is used to re-order the `past_key_values` cache if [`~PreTrainedModel.beam_search`] or
831
+ [`~PreTrainedModel.beam_sample`] is called. This is required to match `past_key_values` with the correct
832
+ beam_idx at every generation step.
833
+
834
+ Output shares the same memory storage as `past`.
835
+ """
836
+ standardized_past = self._convert_to_standard_cache(past, batch_size=len(beam_idx))
837
+
838
+ # Get a copy of `beam_idx` on all the devices where we need those indices.
839
+ device_to_beam_idx = {
840
+ past_state.device: beam_idx.to(past_state.device) for layer_past in past for past_state in layer_past
841
+ }
842
+ reordered_past = tuple(
843
+ (
844
+ layer_past[0].index_select(0, device_to_beam_idx[layer_past[0].device]),
845
+ layer_past[1].index_select(0, device_to_beam_idx[layer_past[0].device]),
846
+ )
847
+ for layer_past in standardized_past
848
+ )
849
+ return self._convert_to_rw_cache(reordered_past)
850
+
851
+
852
+ class RWForSequenceClassification(RWPreTrainedModel):
853
+ _keys_to_ignore_on_load_missing = [r"h.*.self_attention.scale_mask_softmax.causal_mask", r"lm_head.weight"]
854
+
855
+ def __init__(self, config: RWConfig):
856
+ super().__init__(config)
857
+ self.num_labels = config.num_labels
858
+ self.transformer = RWModel(config)
859
+ self.score = nn.Linear(config.hidden_size, config.num_labels, bias=False)
860
+
861
+ # Initialize weights and apply final processing
862
+ self.post_init()
863
+
864
+ def forward(
865
+ self,
866
+ input_ids: Optional[torch.LongTensor] = None,
867
+ past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
868
+ attention_mask: Optional[torch.Tensor] = None,
869
+ head_mask: Optional[torch.Tensor] = None,
870
+ inputs_embeds: Optional[torch.Tensor] = None,
871
+ labels: Optional[torch.Tensor] = None,
872
+ use_cache: Optional[bool] = None,
873
+ output_attentions: Optional[bool] = None,
874
+ output_hidden_states: Optional[bool] = None,
875
+ return_dict: Optional[bool] = None,
876
+ **deprecated_arguments,
877
+ ) -> Union[Tuple[torch.Tensor], SequenceClassifierOutputWithPast]:
878
+ r"""
879
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
880
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
881
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
882
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
883
+ """
884
+ if deprecated_arguments.pop("position_ids", False) is not False:
885
+ # `position_ids` could have been `torch.Tensor` or `None` so defaulting pop to `False` allows to detect if users were passing explicitly `None`
886
+ warnings.warn(
887
+ "`position_ids` have no functionality in BLOOM and will be removed in v5.0.0. You can safely ignore"
888
+ " passing `position_ids`.",
889
+ FutureWarning,
890
+ )
891
+ if len(deprecated_arguments) > 0:
892
+ raise ValueError(f"Got unexpected arguments: {deprecated_arguments}")
893
+
894
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
895
+
896
+ transformer_outputs = self.transformer(
897
+ input_ids,
898
+ past_key_values=past_key_values,
899
+ attention_mask=attention_mask,
900
+ head_mask=head_mask,
901
+ inputs_embeds=inputs_embeds,
902
+ use_cache=use_cache,
903
+ output_attentions=output_attentions,
904
+ output_hidden_states=output_hidden_states,
905
+ return_dict=return_dict,
906
+ )
907
+
908
+ hidden_states = transformer_outputs[0]
909
+ logits = self.score(hidden_states)
910
+
911
+ if input_ids is not None:
912
+ batch_size = input_ids.shape[0]
913
+ else:
914
+ batch_size = inputs_embeds.shape[0]
915
+
916
+ if self.config.pad_token_id is None and batch_size != 1:
917
+ raise ValueError("Cannot handle batch sizes > 1 if no padding token is defined.")
918
+ if self.config.pad_token_id is None:
919
+ sequence_lengths = -1
920
+ else:
921
+ if input_ids is not None:
922
+ sequence_lengths = torch.ne(input_ids, self.config.pad_token_id).sum(dim=-1) - 1
923
+ else:
924
+ sequence_lengths = -1
925
+ logger.warning(
926
+ f"{self.__class__.__name__} will not detect padding tokens in `inputs_embeds`. Results may be "
927
+ "unexpected if using padding tokens in conjunction with `inputs_embeds.`"
928
+ )
929
+
930
+ pooled_logits = logits[torch.arange(batch_size, device=logits.device), sequence_lengths]
931
+
932
+ loss = None
933
+ if labels is not None:
934
+ if self.config.problem_type is None:
935
+ if self.num_labels == 1:
936
+ self.config.problem_type = "regression"
937
+ elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
938
+ self.config.problem_type = "single_label_classification"
939
+ else:
940
+ self.config.problem_type = "multi_label_classification"
941
+
942
+ if self.config.problem_type == "regression":
943
+ loss_fct = MSELoss()
944
+ if self.num_labels == 1:
945
+ loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
946
+ else:
947
+ loss = loss_fct(pooled_logits, labels)
948
+ elif self.config.problem_type == "single_label_classification":
949
+ loss_fct = CrossEntropyLoss()
950
+ loss = loss_fct(pooled_logits, labels)
951
+ elif self.config.problem_type == "multi_label_classification":
952
+ loss_fct = BCEWithLogitsLoss()
953
+ loss = loss_fct(pooled_logits, labels)
954
+ if not return_dict:
955
+ output = (pooled_logits,) + transformer_outputs[1:]
956
+ return ((loss,) + output) if loss is not None else output
957
+
958
+ return SequenceClassifierOutputWithPast(
959
+ loss=loss,
960
+ logits=pooled_logits,
961
+ past_key_values=transformer_outputs.past_key_values,
962
+ hidden_states=transformer_outputs.hidden_states,
963
+ attentions=transformer_outputs.attentions,
964
+ )
965
+
966
+
967
+ class RWForTokenClassification(RWPreTrainedModel):
968
+ _keys_to_ignore_on_load_missing = [r"h.*.self_attention.scale_mask_softmax.causal_mask", r"lm_head.weight"]
969
+
970
+ def __init__(self, config: RWConfig):
971
+ super().__init__(config)
972
+ self.num_labels = config.num_labels
973
+
974
+ self.transformer = RWModel(config)
975
+ if hasattr(config, "classifier_dropout") and config.classifier_dropout is not None:
976
+ classifier_dropout = config.classifier_dropout
977
+ elif hasattr(config, "hidden_dropout") and config.hidden_dropout is not None:
978
+ classifier_dropout = config.hidden_dropout
979
+ else:
980
+ classifier_dropout = 0.1
981
+ self.dropout = nn.Dropout(classifier_dropout)
982
+ self.classifier = nn.Linear(config.hidden_size, config.num_labels)
983
+
984
+ # Initialize weights and apply final processing
985
+ self.post_init()
986
+
987
+ def forward(
988
+ self,
989
+ input_ids: Optional[torch.LongTensor] = None,
990
+ past_key_values: Optional[Tuple[Tuple[torch.Tensor, torch.Tensor], ...]] = None,
991
+ attention_mask: Optional[torch.Tensor] = None,
992
+ head_mask: Optional[torch.Tensor] = None,
993
+ inputs_embeds: Optional[torch.Tensor] = None,
994
+ labels: Optional[torch.Tensor] = None,
995
+ use_cache: Optional[bool] = None,
996
+ output_attentions: Optional[bool] = None,
997
+ output_hidden_states: Optional[bool] = None,
998
+ return_dict: Optional[bool] = None,
999
+ **deprecated_arguments,
1000
+ ) -> Union[Tuple[torch.Tensor], TokenClassifierOutput]:
1001
+ r"""
1002
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1003
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1004
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1005
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1006
+ """
1007
+ if deprecated_arguments.pop("position_ids", False) is not False:
1008
+ # `position_ids` could have been `torch.Tensor` or `None` so defaulting pop to `False` allows to detect if users were passing explicitly `None`
1009
+ warnings.warn(
1010
+ "`position_ids` have no functionality in BLOOM and will be removed in v5.0.0. You can safely ignore"
1011
+ " passing `position_ids`.",
1012
+ FutureWarning,
1013
+ )
1014
+ if len(deprecated_arguments) > 0:
1015
+ raise ValueError(f"Got unexpected arguments: {deprecated_arguments}")
1016
+
1017
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1018
+
1019
+ transformer_outputs = self.transformer(
1020
+ input_ids,
1021
+ past_key_values=past_key_values,
1022
+ attention_mask=attention_mask,
1023
+ head_mask=head_mask,
1024
+ inputs_embeds=inputs_embeds,
1025
+ use_cache=use_cache,
1026
+ output_attentions=output_attentions,
1027
+ output_hidden_states=output_hidden_states,
1028
+ return_dict=return_dict,
1029
+ )
1030
+
1031
+ hidden_states = transformer_outputs[0]
1032
+ hidden_states = self.dropout(hidden_states)
1033
+ logits = self.classifier(hidden_states)
1034
+
1035
+ loss = None
1036
+ if labels is not None:
1037
+ batch_size, seq_length = labels.shape
1038
+ loss_fct = CrossEntropyLoss()
1039
+ loss = loss_fct(logits.view(batch_size * seq_length, self.num_labels), labels.view(batch_size * seq_length))
1040
+
1041
+ if not return_dict:
1042
+ output = (logits,) + transformer_outputs[2:]
1043
+ return ((loss,) + output) if loss is not None else output
1044
+
1045
+ return TokenClassifierOutput(
1046
+ loss=loss,
1047
+ logits=logits,
1048
+ hidden_states=transformer_outputs.hidden_states,
1049
+ attentions=transformer_outputs.attentions,
1050
+ )
1051
+
1052
+
1053
+ class RWForQuestionAnswering(RWPreTrainedModel):
1054
+ _keys_to_ignore_on_load_missing = [r"h.*.self_attention.scale_mask_softmax.causal_mask", r"lm_head.weight"]
1055
+
1056
+ def __init__(self, config):
1057
+ super().__init__(config)
1058
+ self.transformer = RWModel(config)
1059
+ self.qa_outputs = nn.Linear(config.hidden_size, 2)
1060
+
1061
+ # Initialize weights and apply final processing
1062
+ self.post_init()
1063
+
1064
+ def forward(
1065
+ self,
1066
+ input_ids: Optional[torch.LongTensor] = None,
1067
+ attention_mask: Optional[torch.FloatTensor] = None,
1068
+ position_ids: Optional[torch.LongTensor] = None,
1069
+ head_mask: Optional[torch.FloatTensor] = None,
1070
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1071
+ start_positions: Optional[torch.LongTensor] = None,
1072
+ end_positions: Optional[torch.LongTensor] = None,
1073
+ output_attentions: Optional[bool] = None,
1074
+ output_hidden_states: Optional[bool] = None,
1075
+ return_dict: Optional[bool] = None,
1076
+ ) -> Union[Tuple, QuestionAnsweringModelOutput]:
1077
+ r"""
1078
+ start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1079
+ Labels for position (index) of the start of the labelled span for computing the token classification loss.
1080
+ Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
1081
+ are not taken into account for computing the loss.
1082
+ end_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1083
+ Labels for position (index) of the end of the labelled span for computing the token classification loss.
1084
+ Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
1085
+ are not taken into account for computing the loss.
1086
+ """
1087
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1088
+
1089
+ outputs = self.transformer(
1090
+ input_ids,
1091
+ attention_mask=attention_mask,
1092
+ position_ids=position_ids,
1093
+ head_mask=head_mask,
1094
+ inputs_embeds=inputs_embeds,
1095
+ output_attentions=output_attentions,
1096
+ output_hidden_states=output_hidden_states,
1097
+ return_dict=return_dict,
1098
+ )
1099
+
1100
+ sequence_output = outputs[0]
1101
+
1102
+ logits = self.qa_outputs(sequence_output)
1103
+ start_logits, end_logits = logits.split(1, dim=-1)
1104
+ start_logits = start_logits.squeeze(-1).contiguous()
1105
+ end_logits = end_logits.squeeze(-1).contiguous()
1106
+
1107
+ total_loss = None
1108
+ if start_positions is not None and end_positions is not None:
1109
+ # If we are on multi-GPU, split add a dimension
1110
+ if len(start_positions.size()) > 1:
1111
+ start_positions = start_positions.squeeze(-1)
1112
+ if len(end_positions.size()) > 1:
1113
+ end_positions = end_positions.squeeze(-1)
1114
+ # sometimes the start/end positions are outside our model inputs, we ignore these terms
1115
+ ignored_index = start_logits.size(1)
1116
+ start_positions = start_positions.clamp(0, ignored_index)
1117
+ end_positions = end_positions.clamp(0, ignored_index)
1118
+
1119
+ loss_fct = CrossEntropyLoss(ignore_index=ignored_index)
1120
+ start_loss = loss_fct(start_logits, start_positions)
1121
+ end_loss = loss_fct(end_logits, end_positions)
1122
+ total_loss = (start_loss + end_loss) / 2
1123
+
1124
+ if not return_dict:
1125
+ output = (start_logits, end_logits) + outputs[2:]
1126
+ return ((total_loss,) + output) if total_loss is not None else output
1127
+
1128
+ return QuestionAnsweringModelOutput(
1129
+ loss=total_loss,
1130
+ start_logits=start_logits,
1131
+ end_logits=end_logits,
1132
+ hidden_states=outputs.hidden_states,
1133
+ attentions=outputs.attentions,
1134
+ )
quant_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "zero_point": true,
3
+ "q_group_size": 128,
4
+ "w_bit": 4,
5
+ "version": "GEMM"
6
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ ">>TITLE<<",
4
+ ">>ABSTRACT<<",
5
+ ">>INTRODUCTION<<",
6
+ ">>SUMMARY<<",
7
+ ">>COMMENT<<",
8
+ ">>ANSWER<<",
9
+ ">>QUESTION<<",
10
+ ">>DOMAIN<<",
11
+ ">>PREFIX<<",
12
+ ">>SUFFIX<<",
13
+ ">>MIDDLE<<",
14
+ "<start_system>",
15
+ "<start_user>",
16
+ "<start_assistant>",
17
+ "<end_message>"
18
+ ],
19
+ "eos_token": "<end_message>"
20
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "eos_token": "<end_message>",
4
+ "model_max_length": 8192,
5
+ "special_tokens_map_file": null,
6
+ "tokenizer_class": "PreTrainedTokenizerFast"
7
+ }