jeffreygao commited on
Commit
0263bca
1 Parent(s): 9cf2530

Add checkpoint

Browse files
added_tokens.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "[SEA]": 100003,
3
+ "[SEH]": 100002,
4
+ "[|AI|]:": 100001,
5
+ "[|Human|]:": 100000
6
+ }
config.json ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/data/juicefs_sharing_data/public_data/yyf_11164103/llm_models/bluelm-7b/BlueLM-7B-Chat-32K-Function/",
3
+ "architectures": [
4
+ "BlueLMForCausalLM"
5
+ ],
6
+ "auto_map": {
7
+ "AutoConfig": "configuration_bluelm.BlueLMConfig",
8
+ "AutoModelForCausalLM": "modeling_bluelm.BlueLMForCausalLM"
9
+ },
10
+ "bos_token_id": 1,
11
+ "eos_token_id": 2,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 4096,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 11008,
16
+ "max_position_embeddings": 2048,
17
+ "model_type": "BlueLM",
18
+ "num_attention_heads": 32,
19
+ "num_hidden_layers": 32,
20
+ "num_key_value_heads": 32,
21
+ "pad_token_id": 3,
22
+ "pretraining_tp": 1,
23
+ "quantization_config": {
24
+ "bits": 4,
25
+ "group_size": 128,
26
+ "modules_to_not_convert": null,
27
+ "quant_method": "awq",
28
+ "version": "gemm",
29
+ "zero_point": true
30
+ },
31
+ "rms_norm_eps": 1e-06,
32
+ "rope_scaling": {
33
+ "factor": 16.0,
34
+ "power": 0.3,
35
+ "type": "ntkmixed"
36
+ },
37
+ "rope_theta": 10000.0,
38
+ "tie_word_embeddings": false,
39
+ "torch_dtype": "float16",
40
+ "transformers_version": "4.38.2",
41
+ "use_cache": false,
42
+ "use_stable_embedding": true,
43
+ "vocab_size": 100096
44
+ }
configuration_bluelm.py ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2023 vivo.
2
+ #
3
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
4
+ #
5
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
6
+ # and OPT implementations in this library. It has been modified from its
7
+ # original forms to accommodate minor architectural differences compared
8
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+
22
+ """ BlueLM model configuration"""
23
+
24
+ from transformers.configuration_utils import PretrainedConfig
25
+
26
+ BlueLM_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
27
+
28
+
29
+ class BlueLMConfig(PretrainedConfig):
30
+ r"""
31
+ This is the configuration class to store the configuration of a [`BlueLMModel`]. It is used to instantiate an BlueLM
32
+ model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
33
+ defaults will yield a similar configuration to that of the BlueLM-7B.
34
+
35
+ Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
36
+ documentation from [`PretrainedConfig`] for more information.
37
+
38
+
39
+ Args:
40
+ vocab_size (`int`, *optional*, defaults to 32000):
41
+ Vocabulary size of the BlueLM model. Defines the number of different tokens that can be represented by the
42
+ `inputs_ids` passed when calling [`BlueLMModel`]
43
+ hidden_size (`int`, *optional*, defaults to 4096):
44
+ Dimension of the hidden representations.
45
+ intermediate_size (`int`, *optional*, defaults to 11008):
46
+ Dimension of the MLP representations.
47
+ num_hidden_layers (`int`, *optional*, defaults to 32):
48
+ Number of hidden layers in the Transformer encoder.
49
+ num_attention_heads (`int`, *optional*, defaults to 32):
50
+ Number of attention heads for each attention layer in the Transformer encoder.
51
+ num_key_value_heads (`int`, *optional*):
52
+ This is the number of key_value heads that should be used to implement Grouped Query Attention. If
53
+ `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
54
+ `num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
55
+ converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
56
+ by meanpooling all the original heads within that group. For more details checkout [this
57
+ paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
58
+ `num_attention_heads`.
59
+ pretraining_tp (`int`, *optional*, defaults to `1`):
60
+ Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
61
+ document](https://huggingface.co/docs/transformers/parallelism) to understand more about it. This value is
62
+ necessary to ensure exact reproducibility of the pretraining results. Please refer to [this
63
+ issue](https://github.com/pytorch/pytorch/issues/76232).
64
+ hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
65
+ The non-linear activation function (function or string) in the decoder.
66
+ max_position_embeddings (`int`, *optional*, defaults to 2048):
67
+ The maximum sequence length that this model might ever be used with.
68
+ initializer_range (`float`, *optional*, defaults to 0.02):
69
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
70
+ rms_norm_eps (`float`, *optional*, defaults to 1e-12):
71
+ The epsilon used by the rms normalization layers.
72
+ use_cache (`bool`, *optional*, defaults to `True`):
73
+ Whether or not the model should return the last key/values attentions (not used by all models). Only
74
+ relevant if `config.is_decoder=True`.
75
+ tie_word_embeddings(`bool`, *optional*, defaults to `False`):
76
+ Whether to tie weight embeddings
77
+ rope_theta (`float`, *optional*, defaults to 10000.0):
78
+ The base period of the RoPE embeddings.
79
+ rope_scaling (`Dict`, *optional*):
80
+ Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
81
+ strategies: linear and dynamic. Their scaling factor must be an float greater than 1. The expected format
82
+ is `{"type": strategy name, "factor": scaling factor}`. When using this flag, don't update
83
+ `max_position_embeddings` to the expected new maximum. See the following thread for more information on how
84
+ these scaling strategies behave:
85
+ https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/. This is an
86
+ experimental feature, subject to breaking API changes in future versions.
87
+
88
+ """
89
+
90
+ model_type = "BlueLM"
91
+ keys_to_ignore_at_inference = ["past_key_values"]
92
+
93
+ def __init__(
94
+ self,
95
+ vocab_size=100096,
96
+ hidden_size=4096,
97
+ intermediate_size=11008,
98
+ num_hidden_layers=32,
99
+ num_attention_heads=32,
100
+ num_key_value_heads=None,
101
+ hidden_act="silu",
102
+ max_position_embeddings=2048,
103
+ initializer_range=0.02,
104
+ rms_norm_eps=1e-6,
105
+ use_cache=True,
106
+ pad_token_id=None,
107
+ bos_token_id=1,
108
+ eos_token_id=2,
109
+ pretraining_tp=1,
110
+ tie_word_embeddings=False,
111
+ rope_theta=10000.0,
112
+ rope_scaling=None,
113
+ use_stable_embedding=True,
114
+ **kwargs,
115
+ ):
116
+ self.vocab_size = vocab_size
117
+ self.max_position_embeddings = max_position_embeddings
118
+ self.hidden_size = hidden_size
119
+ self.intermediate_size = intermediate_size
120
+ self.num_hidden_layers = num_hidden_layers
121
+ self.num_attention_heads = num_attention_heads
122
+ self.use_stable_embedding = use_stable_embedding
123
+ # for backward compatibility
124
+ if num_key_value_heads is None:
125
+ num_key_value_heads = num_attention_heads
126
+
127
+ self.num_key_value_heads = num_key_value_heads
128
+ self.hidden_act = hidden_act
129
+ self.initializer_range = initializer_range
130
+ self.rms_norm_eps = rms_norm_eps
131
+ self.pretraining_tp = pretraining_tp
132
+ self.use_cache = use_cache
133
+ self.rope_theta = rope_theta
134
+ self.rope_scaling = rope_scaling
135
+ self._rope_scaling_validation()
136
+
137
+ super().__init__(
138
+ pad_token_id=pad_token_id,
139
+ bos_token_id=bos_token_id,
140
+ eos_token_id=eos_token_id,
141
+ tie_word_embeddings=tie_word_embeddings,
142
+ **kwargs,
143
+ )
144
+
145
+ def _rope_scaling_validation(self):
146
+ """
147
+ Validate the `rope_scaling` configuration.
148
+ """
149
+ if self.rope_scaling is None:
150
+ return
151
+
152
+ if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 3:
153
+ raise ValueError(
154
+ "`rope_scaling` must be a dictionary with with three fields, `type` , `factor` , `power`, "
155
+ f"got {self.rope_scaling}"
156
+ )
157
+ rope_scaling_type = self.rope_scaling.get("type", None)
158
+ rope_scaling_factor = self.rope_scaling.get("factor", None)
159
+ if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic","ntkmixed"]:
160
+ raise ValueError(
161
+ f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
162
+ )
163
+ if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
164
+ raise ValueError(f"`rope_scaling`'s factor field must be an float > 1, got {rope_scaling_factor}")
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "do_sample": true,
5
+ "eos_token_id": 2,
6
+ "pad_token_id": 3,
7
+ "transformers_version": "4.38.2"
8
+ }
modeling_bluelm.py ADDED
@@ -0,0 +1,1000 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ """ PyTorch BlueLM model."""
21
+ import math
22
+ from typing import List, Optional, Tuple, Union
23
+
24
+ import torch
25
+ import torch.utils.checkpoint
26
+ from torch import nn
27
+ from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
28
+
29
+ from transformers.activations import ACT2FN
30
+ from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast, SequenceClassifierOutputWithPast
31
+ from transformers.modeling_utils import PreTrainedModel
32
+ from transformers.utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
33
+ from .configuration_bluelm import BlueLMConfig
34
+ from flash_attn.flash_attn_interface import (
35
+ flash_attn_func,
36
+ flash_attn_kvpacked_func,
37
+ flash_attn_qkvpacked_func,
38
+ flash_attn_varlen_kvpacked_func,
39
+ )
40
+
41
+ try:
42
+ from xformers import ops as xops
43
+ except ImportError:
44
+ xops = None
45
+ # print("xformers is not installed correctly.")
46
+
47
+ try:
48
+ from apex.normalization import MixedFusedRMSNorm
49
+ except ImportError:
50
+ MixedFusedRMSNorm = None
51
+ # print("Please install nvidia apex from source (https://github.com/NVIDIA/apex#linux) or use ngc container.")
52
+
53
+
54
+ logger = logging.get_logger(__name__)
55
+
56
+ _CONFIG_FOR_DOC = "BlueLmConfig"
57
+
58
+
59
+ def _make_causal_mask(input_ids_shape: torch.Size, dtype: torch.dtype, past_key_values_length: int = 0):
60
+ """
61
+ Make causal mask used for bi-directional self-attention.
62
+ """
63
+ bsz, tgt_len = input_ids_shape
64
+ mask = torch.full((tgt_len, tgt_len), torch.tensor(torch.finfo(dtype).min))
65
+ mask_cond = torch.arange(mask.size(-1))
66
+ mask.masked_fill_(mask_cond < (mask_cond + 1).view(mask.size(-1), 1), 0)
67
+ mask = mask.to(dtype)
68
+
69
+ if past_key_values_length > 0:
70
+ mask = torch.cat([torch.zeros(tgt_len, past_key_values_length, dtype=dtype), mask], dim=-1)
71
+ return mask[None, None, :, :].expand(bsz, 1, tgt_len, tgt_len + past_key_values_length)
72
+
73
+
74
+ def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Optional[int] = None):
75
+ """
76
+ Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
77
+ """
78
+ bsz, src_len = mask.size()
79
+ tgt_len = tgt_len if tgt_len is not None else src_len
80
+
81
+ expanded_mask = mask[:, None, None, :].expand(bsz, 1, tgt_len, src_len).to(dtype)
82
+
83
+ inverted_mask = 1.0 - expanded_mask
84
+
85
+ return inverted_mask.masked_fill(inverted_mask.to(torch.bool), torch.finfo(dtype).min)
86
+
87
+
88
+ class BlueLMRMSNorm(nn.Module):
89
+ def __init__(self, hidden_size, eps=1e-6):
90
+ """
91
+ BlueLMRMSNorm is equivalent to T5LayerNorm
92
+ """
93
+ super().__init__()
94
+ self.weight = nn.Parameter(torch.ones(hidden_size))
95
+ self.variance_epsilon = eps
96
+
97
+ def forward(self, hidden_states):
98
+ variance = hidden_states.to(torch.float32).pow(2).mean(-1, keepdim=True)
99
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
100
+
101
+ # convert into half-precision if necessary
102
+ if self.weight.dtype in [torch.float16, torch.bfloat16]:
103
+ hidden_states = hidden_states.to(self.weight.dtype)
104
+
105
+ return self.weight * hidden_states
106
+
107
+
108
+ class BlueLMRotaryEmbedding(torch.nn.Module):
109
+ def __init__(self, dim, max_position_embeddings=2048, base=10000, device=None, k=16, b=0.3):
110
+ super().__init__()
111
+ # hard code bluedLM-long support 32k window size only
112
+ max_position_embeddings = 2048 * k
113
+ a = math.log(k) / ((dim / 2) ** b)
114
+ inv_freq = 1.0 / (base ** (torch.arange(0, dim, 2).float().to(device) / dim)) \
115
+ / torch.exp(a * torch.arange(1, dim / 2 + 1).float() ** b)
116
+
117
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
118
+ assert self.inv_freq.dtype == torch.float32 # inv_freq must be float32 for ensuring numeric precision
119
+
120
+ # Build here to make `torch.jit.trace` work.
121
+ self.max_seq_len_cached = max_position_embeddings
122
+ t = torch.arange(self.max_seq_len_cached, device=self.inv_freq.device, dtype=self.inv_freq.dtype)
123
+ freqs = torch.einsum("i,j->ij", t, self.inv_freq)
124
+ # Different from paper, but it uses a different permutation in order to obtain the same calculation
125
+ emb = torch.cat((freqs, freqs), dim=-1)
126
+ self.register_buffer("cos_cached", emb.cos()[None, :, None, :], persistent=False)
127
+ self.register_buffer("sin_cached", emb.sin()[None, :, None, :], persistent=False)
128
+
129
+ def forward(self, x, seq_len=None):
130
+ # x: [bs, num_attention_heads, seq_len, head_size]
131
+ # This `if` block is unlikely to be run after we build sin/cos in `__init__`. Keep the logic here just in case.
132
+ if seq_len > self.max_seq_len_cached:
133
+ self.max_seq_len_cached = seq_len
134
+ t = torch.arange(self.max_seq_len_cached, device=x.device, dtype=self.inv_freq.dtype)
135
+ freqs = torch.einsum("i,j->ij", t, self.inv_freq)
136
+ # Different from paper, but it uses a different permutation in order to obtain the same calculation
137
+ emb = torch.cat((freqs, freqs), dim=-1).to(x.device)
138
+ self.register_buffer("cos_cached", emb.cos()[None, :, None, :], persistent=False)
139
+ self.register_buffer("sin_cached", emb.sin()[None, :, None, :], persistent=False)
140
+ return (
141
+ self.cos_cached[:, :seq_len, ...].to(dtype=x.dtype),
142
+ self.sin_cached[:, :seq_len, ...].to(dtype=x.dtype),
143
+ )
144
+
145
+
146
+ def rotate_half(x):
147
+ """Rotates half the hidden dims of the input."""
148
+ x1 = x[..., : x.shape[-1] // 2]
149
+ x2 = x[..., x.shape[-1] // 2 :]
150
+ return torch.cat((-x2, x1), dim=-1)
151
+
152
+
153
+ def apply_rotary_pos_emb(q, k, cos, sin, offset: int = 0):
154
+ cos = cos[:, offset : q.shape[1] + offset, ...]
155
+ sin = sin[:, offset : q.shape[1] + offset, ...]
156
+ q_embed = (q * cos) + (rotate_half(q) * sin)
157
+ k_embed = (k * cos) + (rotate_half(k) * sin)
158
+ return q_embed, k_embed
159
+
160
+
161
+ class BlueLMMLP(nn.Module):
162
+ def __init__(
163
+ self,
164
+ hidden_size: int,
165
+ intermediate_size: int,
166
+ hidden_act: str,
167
+ dropout_prob: float,
168
+ ):
169
+ super().__init__()
170
+ self.gate_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
171
+ self.down_proj = nn.Linear(intermediate_size, hidden_size, bias=False)
172
+ self.up_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
173
+ self.act_fn = ACT2FN[hidden_act]
174
+ self.dropout = nn.Dropout(dropout_prob)
175
+
176
+ def forward(self, x):
177
+ return self.dropout(self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x)))
178
+
179
+
180
+ class BlueLMAttention(nn.Module):
181
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
182
+
183
+ def __init__(
184
+ self,
185
+ hidden_size: int,
186
+ num_heads: int,
187
+ dropout_prob: float,
188
+ ):
189
+ super().__init__()
190
+ self.hidden_size = hidden_size
191
+ self.num_heads = num_heads
192
+ self.head_dim = hidden_size // num_heads
193
+ self.dropout_prob = dropout_prob
194
+
195
+ if (self.head_dim * num_heads) != self.hidden_size:
196
+ raise ValueError(
197
+ f"hidden_size must be divisible by num_heads (got `hidden_size`: {self.hidden_size}"
198
+ f" and `num_heads`: {num_heads})."
199
+ )
200
+ self.q_proj = nn.Linear(
201
+ hidden_size,
202
+ num_heads * self.head_dim,
203
+ bias=False,
204
+ )
205
+ self.k_proj = nn.Linear(
206
+ hidden_size,
207
+ num_heads * self.head_dim,
208
+ bias=False,
209
+ )
210
+ self.v_proj = nn.Linear(
211
+ hidden_size,
212
+ num_heads * self.head_dim,
213
+ bias=False,
214
+ )
215
+ self.o_proj = nn.Linear(
216
+ num_heads * self.head_dim,
217
+ hidden_size,
218
+ bias=False,
219
+ )
220
+ self.register_buffer(
221
+ "norm_factor",
222
+ torch.sqrt(torch.tensor(self.head_dim, dtype=torch.float32)).to(torch.get_default_dtype()),
223
+ persistent=False,
224
+ )
225
+ self.rotary_emb = BlueLMRotaryEmbedding(self.head_dim)
226
+ if xops is not None:
227
+ self.causal_mask = xops.LowerTriangularMask()
228
+
229
+ def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
230
+ return tensor.view(bsz, seq_len, self.num_heads, self.head_dim).contiguous()
231
+
232
+ def forward(
233
+ self,
234
+ hidden_states: torch.Tensor,
235
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
236
+ attention_mask: Optional[torch.Tensor] = None,
237
+ output_attentions: bool = False,
238
+ use_cache: bool = False,
239
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
240
+ """Input shape: Batch x Time x Channel"""
241
+
242
+ bsz, q_len, h_size = hidden_states.size()
243
+ has_layer_past = past_key_value is not None
244
+
245
+ query_states = self.q_proj(hidden_states).view(bsz, q_len, self.num_heads, self.head_dim)
246
+ key_states = self.k_proj(hidden_states).view(bsz, q_len, self.num_heads, self.head_dim)
247
+ value_states = self.v_proj(hidden_states).view(bsz, q_len, self.num_heads, self.head_dim)
248
+
249
+ kv_seq_len = key_states.shape[1]
250
+ offset = 0
251
+ if past_key_value is not None:
252
+ offset = past_key_value[0].shape[1]
253
+ kv_seq_len += offset
254
+ cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
255
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, offset=offset)
256
+ # [bsz, t, nh, hd]
257
+
258
+ if has_layer_past:
259
+ # reuse k, v, self_attention
260
+ key_states = torch.cat([past_key_value[0], key_states], dim=1)
261
+ value_states = torch.cat([past_key_value[1], value_states], dim=1)
262
+
263
+ past_key_value = (key_states, value_states) if use_cache else None
264
+
265
+ if xops is not None and self.training:
266
+ attn_weights = None
267
+ attn_output = xops.memory_efficient_attention(
268
+ query_states, key_states, value_states, attn_bias=self.causal_mask, p=self.dropout_prob,
269
+ op=xops.fmha.MemoryEfficientAttentionFlashAttentionOp
270
+ )
271
+ else:
272
+ # [bsz, t, nh, hd]
273
+ kv = torch.stack([key_states, value_states], 2)
274
+ attn_outputs = flash_attn_kvpacked_func(
275
+ query_states, kv, dropout_p=0.0, softmax_scale=1.0/self.norm_factor, causal=(not has_layer_past), return_attn_probs=output_attentions)
276
+ attn_output = attn_outputs[0] if output_attentions else attn_outputs
277
+ attn_weights = attn_outputs[2] if output_attentions else None
278
+
279
+
280
+ if attn_output.size() != (bsz, q_len, self.num_heads, self.head_dim):
281
+ raise ValueError(
282
+ f"`attn_output` should be of size {(bsz, q_len, self.num_heads, self.head_dim)}, but is"
283
+ f" {attn_output.size()}"
284
+ )
285
+
286
+ attn_output = attn_output.reshape(bsz, q_len, self.hidden_size)
287
+
288
+ attn_output = self.o_proj(attn_output)
289
+
290
+ if not output_attentions:
291
+ attn_weights = None
292
+
293
+ return attn_output, attn_weights, past_key_value
294
+
295
+
296
+ class BlueLMDecoderLayer(nn.Module):
297
+ def __init__(self, config: BlueLMConfig):
298
+ super().__init__()
299
+ self.hidden_size = config.hidden_size
300
+ self.self_attn = BlueLMAttention(
301
+ hidden_size=self.hidden_size,
302
+ num_heads=config.num_attention_heads,
303
+ dropout_prob=0,
304
+ )
305
+ self.mlp = BlueLMMLP(
306
+ hidden_size=self.hidden_size,
307
+ intermediate_size=config.intermediate_size,
308
+ hidden_act=config.hidden_act,
309
+ dropout_prob=0,
310
+ )
311
+ if MixedFusedRMSNorm is None:
312
+ self.input_layernorm = BlueLMRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
313
+ self.post_attention_layernorm = BlueLMRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
314
+ else:
315
+ self.input_layernorm = MixedFusedRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
316
+ self.post_attention_layernorm = MixedFusedRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
317
+
318
+ def forward(
319
+ self,
320
+ hidden_states: torch.Tensor,
321
+ attention_mask: Optional[torch.Tensor] = None,
322
+ output_attentions: Optional[bool] = False,
323
+ use_cache: Optional[bool] = False,
324
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
325
+ ) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]]:
326
+ """
327
+ Args:
328
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
329
+ attention_mask (`torch.FloatTensor`, *optional*): attention mask of size
330
+ `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
331
+ output_attentions (`bool`, *optional*):
332
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
333
+ returned tensors for more detail.
334
+ use_cache (`bool`, *optional*):
335
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
336
+ (see `past_key_values`).
337
+ past_key_value (`Tuple(torch.FloatTensor)`, *optional*): cached past key and value projection states
338
+ """
339
+
340
+ residual = hidden_states
341
+
342
+ hidden_states = self.input_layernorm(hidden_states)
343
+
344
+ # Self Attention
345
+ hidden_states, self_attn_weights, present_key_value = self.self_attn(
346
+ hidden_states=hidden_states,
347
+ past_key_value=past_key_value,
348
+ attention_mask=attention_mask,
349
+ output_attentions=output_attentions,
350
+ use_cache=use_cache,
351
+ )
352
+ hidden_states = residual + hidden_states
353
+
354
+ # Fully Connected
355
+ residual = hidden_states
356
+ hidden_states = self.post_attention_layernorm(hidden_states)
357
+ hidden_states = self.mlp(hidden_states)
358
+ hidden_states = residual + hidden_states
359
+
360
+ outputs = (hidden_states,)
361
+
362
+ if output_attentions:
363
+ outputs += (self_attn_weights,)
364
+
365
+ if use_cache:
366
+ outputs += (present_key_value,)
367
+
368
+ return outputs
369
+
370
+
371
+ BlueLM_START_DOCSTRING = r"""
372
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
373
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
374
+ etc.)
375
+
376
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
377
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
378
+ and behavior.
379
+
380
+ Parameters:
381
+ config ([`BlueLMConfig`]):
382
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
383
+ load the weights associated with the model, only the configuration. Check out the
384
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
385
+ """
386
+
387
+
388
+ @add_start_docstrings(
389
+ "The bare BlueLM Model outputting raw hidden-states without any specific head on top.",
390
+ BlueLM_START_DOCSTRING,
391
+ )
392
+ class BlueLMPreTrainedModel(PreTrainedModel):
393
+ config_class = BlueLMConfig
394
+ base_model_prefix = "model"
395
+ supports_gradient_checkpointing = True
396
+ _no_split_modules = ["BlueLMDecoderLayer"]
397
+ _keys_to_ignore_on_load_unexpected = [r"decoder\.version"]
398
+
399
+ def _init_weights(self, module):
400
+ std = self.config.initializer_range
401
+ if isinstance(module, nn.Linear):
402
+ # module.weight.data.normal_(mean=0.0, std=std)
403
+ torch.nn.init.xavier_normal_(module.weight.data)
404
+ if module.bias is not None:
405
+ module.bias.data.zero_()
406
+ elif isinstance(module, nn.Embedding):
407
+ if self.config.use_stable_embedding:
408
+ torch.nn.init.xavier_normal_(module.weight.data)
409
+ else:
410
+ module.weight.data.normal_(mean=0.0, std=std)
411
+ if module.padding_idx is not None:
412
+ module.weight.data[module.padding_idx].zero_()
413
+
414
+ def _set_gradient_checkpointing(self, module, value=False):
415
+ if isinstance(module, BlueLMModel):
416
+ module.gradient_checkpointing = value
417
+
418
+
419
+ BlueLM_INPUTS_DOCSTRING = r"""
420
+ Args:
421
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
422
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
423
+ it.
424
+
425
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
426
+ [`PreTrainedTokenizer.__call__`] for details.
427
+
428
+ [What are input IDs?](../glossary#input-ids)
429
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
430
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
431
+
432
+ - 1 for tokens that are **not masked**,
433
+ - 0 for tokens that are **masked**.
434
+
435
+ [What are attention masks?](../glossary#attention-mask)
436
+
437
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
438
+ [`PreTrainedTokenizer.__call__`] for details.
439
+
440
+ If `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
441
+ `past_key_values`).
442
+
443
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
444
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
445
+ information on the default strategy.
446
+
447
+ - 1 indicates the head is **not masked**,
448
+ - 0 indicates the head is **masked**.
449
+
450
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
451
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of shape
452
+ `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
453
+ `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.
454
+
455
+ Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
456
+ blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
457
+
458
+ If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those that
459
+ don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of all
460
+ `decoder_input_ids` of shape `(batch_size, sequence_length)`.
461
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
462
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
463
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
464
+ model's internal embedding lookup matrix.
465
+ use_cache (`bool`, *optional*):
466
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
467
+ `past_key_values`).
468
+ output_attentions (`bool`, *optional*):
469
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
470
+ tensors for more detail.
471
+ output_hidden_states (`bool`, *optional*):
472
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
473
+ more detail.
474
+ return_dict (`bool`, *optional*):
475
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
476
+ """
477
+
478
+
479
+ @add_start_docstrings(
480
+ "The bare BlueLM Model outputting raw hidden-states without any specific head on top.",
481
+ BlueLM_START_DOCSTRING,
482
+ )
483
+ class BlueLMModel(BlueLMPreTrainedModel):
484
+ """
485
+ Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`BlueLMDecoderLayer`]
486
+
487
+ Args:
488
+ config: BlueLMConfig
489
+ """
490
+
491
+ def __init__(self, config: BlueLMConfig):
492
+ super().__init__(config)
493
+ self.padding_idx = config.pad_token_id
494
+ self.vocab_size = config.vocab_size
495
+
496
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
497
+ if config.use_stable_embedding:
498
+ self.embed_layer_norm = nn.LayerNorm(config.hidden_size,eps=1e-06)
499
+ else:
500
+ self.embed_layer_norm = None
501
+ self.layers = nn.ModuleList([BlueLMDecoderLayer(config) for _ in range(config.num_hidden_layers)])
502
+ if MixedFusedRMSNorm is None:
503
+ self.norm = BlueLMRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
504
+ else:
505
+ self.norm = MixedFusedRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
506
+
507
+ self.gradient_checkpointing = False
508
+ # Initialize weights and apply final processing
509
+ self.post_init()
510
+
511
+ def get_input_embeddings(self):
512
+ return self.embed_tokens
513
+
514
+ def set_input_embeddings(self, value):
515
+ self.embed_tokens = value
516
+
517
+ # Copied from transformers.models.bart.modeling_bart.BartDecoder._prepare_decoder_attention_mask
518
+ def _prepare_decoder_attention_mask(self, attention_mask, input_shape, inputs_embeds, past_key_values_length):
519
+ # create causal mask
520
+ # [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
521
+ combined_attention_mask = None
522
+ if input_shape[-1] > 1:
523
+ combined_attention_mask = _make_causal_mask(
524
+ input_shape, inputs_embeds.dtype, past_key_values_length=past_key_values_length
525
+ ).to(inputs_embeds.device)
526
+
527
+ if attention_mask is not None:
528
+ # [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
529
+ expanded_attn_mask = _expand_mask(attention_mask, inputs_embeds.dtype, tgt_len=input_shape[-1]).to(
530
+ inputs_embeds.device
531
+ )
532
+ combined_attention_mask = (
533
+ expanded_attn_mask if combined_attention_mask is None else expanded_attn_mask + combined_attention_mask
534
+ )
535
+
536
+ return combined_attention_mask
537
+
538
+ def forward(
539
+ self,
540
+ input_ids: torch.LongTensor = None,
541
+ attention_mask: Optional[torch.Tensor] = None,
542
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
543
+ inputs_embeds: Optional[torch.FloatTensor] = None,
544
+ use_cache: Optional[bool] = None,
545
+ output_attentions: Optional[bool] = None,
546
+ output_hidden_states: Optional[bool] = None,
547
+ return_dict: Optional[bool] = None,
548
+ ) -> Union[Tuple, BaseModelOutputWithPast]:
549
+ r"""
550
+ Args:
551
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
552
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
553
+ provide it.
554
+
555
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
556
+ [`PreTrainedTokenizer.__call__`] for details.
557
+
558
+ [What are input IDs?](../glossary#input-ids)
559
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
560
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
561
+
562
+ - 1 for tokens that are **not masked**,
563
+ - 0 for tokens that are **masked**.
564
+
565
+ [What are attention masks?](../glossary#attention-mask)
566
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
567
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
568
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of
569
+
570
+ Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
571
+ cross-attention blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
572
+
573
+ If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those
574
+ that don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of
575
+ all `decoder_input_ids` of shape `(batch_size, sequence_length)`.
576
+ use_cache (`bool`, *optional*):
577
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
578
+ (see `past_key_values`).
579
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
580
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation.
581
+ This is useful if you want more control over how to convert `input_ids` indices into associated vectors
582
+ than the model's internal embedding lookup matrix.
583
+ output_attentions (`bool`, *optional*):
584
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
585
+ returned tensors for more detail.
586
+ output_hidden_states (`bool`, *optional*):
587
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
588
+ for more detail.
589
+ return_dict (`bool`, *optional*):
590
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
591
+ """
592
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
593
+ output_hidden_states = (
594
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
595
+ )
596
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
597
+
598
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
599
+
600
+ # retrieve input_ids and inputs_embeds
601
+ if input_ids is not None and inputs_embeds is not None:
602
+ raise ValueError("You cannot specify both decoder_input_ids and decoder_inputs_embeds at the same time")
603
+ elif input_ids is not None:
604
+ batch_size, seq_length = input_ids.shape
605
+ elif inputs_embeds is not None:
606
+ batch_size, seq_length, _ = inputs_embeds.shape
607
+ else:
608
+ raise ValueError("You have to specify either decoder_input_ids or decoder_inputs_embeds")
609
+ seq_length_with_past = seq_length
610
+ past_key_values_length = 0
611
+ if past_key_values is not None:
612
+ past_key_values_length = past_key_values[0][0].shape[2]
613
+ seq_length_with_past = seq_length_with_past + past_key_values_length
614
+ if inputs_embeds is None:
615
+ inputs_embeds = self.embed_tokens(input_ids)
616
+ if self.embed_layer_norm:
617
+ inputs_embeds = self.embed_layer_norm(inputs_embeds)
618
+ # embed positions
619
+ if xops is not None and self.training:
620
+ attention_mask = None
621
+ else:
622
+ if attention_mask is None:
623
+ attention_mask = torch.ones(
624
+ (batch_size, seq_length_with_past), dtype=torch.bool, device=inputs_embeds.device
625
+ )
626
+ attention_mask = self._prepare_decoder_attention_mask(
627
+ attention_mask, (batch_size, seq_length), inputs_embeds, past_key_values_length
628
+ )
629
+
630
+ hidden_states = inputs_embeds
631
+
632
+ if self.gradient_checkpointing and self.training:
633
+ if use_cache:
634
+ logger.warning_once(
635
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`..."
636
+ )
637
+ use_cache = False
638
+
639
+ # decoder layers
640
+ all_hidden_states = () if output_hidden_states else None
641
+ all_self_attns = () if output_attentions else None
642
+ next_decoder_cache = () if use_cache else None
643
+
644
+ for idx, decoder_layer in enumerate(self.layers):
645
+ if output_hidden_states:
646
+ all_hidden_states += (hidden_states,)
647
+
648
+ past_key_value = past_key_values[idx] if past_key_values is not None else None
649
+
650
+ if self.gradient_checkpointing and self.training:
651
+
652
+ def create_custom_forward(module):
653
+ def custom_forward(*inputs):
654
+ # None for past_key_value
655
+ return module(*inputs, output_attentions, None)
656
+
657
+ return custom_forward
658
+
659
+ layer_outputs = torch.utils.checkpoint.checkpoint(
660
+ create_custom_forward(decoder_layer),
661
+ hidden_states,
662
+ attention_mask,
663
+ None,
664
+ )
665
+ else:
666
+ layer_outputs = decoder_layer(
667
+ hidden_states,
668
+ attention_mask=attention_mask,
669
+ past_key_value=past_key_value,
670
+ output_attentions=output_attentions,
671
+ use_cache=use_cache,
672
+ )
673
+
674
+ hidden_states = layer_outputs[0]
675
+
676
+ if use_cache:
677
+ next_decoder_cache += (layer_outputs[2 if output_attentions else 1],)
678
+
679
+ if output_attentions:
680
+ all_self_attns += (layer_outputs[1],)
681
+
682
+ hidden_states = self.norm(hidden_states)
683
+
684
+ # add hidden states from the last decoder layer
685
+ if output_hidden_states:
686
+ all_hidden_states += (hidden_states,)
687
+
688
+ next_cache = next_decoder_cache if use_cache else None
689
+ if not return_dict:
690
+ return tuple(v for v in [hidden_states, next_cache, all_hidden_states, all_self_attns] if v is not None)
691
+ return BaseModelOutputWithPast(
692
+ last_hidden_state=hidden_states,
693
+ past_key_values=next_cache,
694
+ hidden_states=all_hidden_states,
695
+ attentions=all_self_attns,
696
+ )
697
+
698
+
699
+ class BlueLMForCausalLM(BlueLMPreTrainedModel):
700
+ _keys_to_ignore_on_load_missing = [r"lm_head.weight"]
701
+
702
+ def __init__(self, config):
703
+ super().__init__(config)
704
+ self.model = BlueLMModel(config)
705
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
706
+
707
+ # Initialize weights and apply final processing
708
+ self.post_init()
709
+
710
+ def get_input_embeddings(self):
711
+ return self.model.embed_tokens
712
+
713
+ def set_input_embeddings(self, value):
714
+ self.model.embed_tokens = value
715
+
716
+ def get_output_embeddings(self):
717
+ return self.lm_head
718
+
719
+ def set_output_embeddings(self, new_embeddings):
720
+ self.lm_head = new_embeddings
721
+
722
+ def set_decoder(self, decoder):
723
+ self.model = decoder
724
+
725
+ def get_decoder(self):
726
+ return self.model
727
+
728
+ @replace_return_docstrings(output_type=CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
729
+ def forward(
730
+ self,
731
+ input_ids: torch.LongTensor = None,
732
+ attention_mask: Optional[torch.Tensor] = None,
733
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
734
+ inputs_embeds: Optional[torch.FloatTensor] = None,
735
+ labels: Optional[torch.LongTensor] = None,
736
+ use_cache: Optional[bool] = None,
737
+ output_attentions: Optional[bool] = None,
738
+ output_hidden_states: Optional[bool] = None,
739
+ return_dict: Optional[bool] = None,
740
+ ) -> Union[Tuple, CausalLMOutputWithPast]:
741
+ r"""
742
+ Args:
743
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
744
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
745
+ provide it.
746
+
747
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
748
+ [`PreTrainedTokenizer.__call__`] for details.
749
+
750
+ [What are input IDs?](../glossary#input-ids)
751
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
752
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
753
+
754
+ - 1 for tokens that are **not masked**,
755
+ - 0 for tokens that are **masked**.
756
+
757
+ [What are attention masks?](../glossary#attention-mask)
758
+ past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
759
+ Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
760
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of
761
+ shape `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`. The two additional
762
+ tensors are only required when the model is used as a decoder in a Sequence to Sequence model.
763
+
764
+ Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
765
+ cross-attention blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
766
+
767
+ If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those
768
+ that don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of
769
+ all `decoder_input_ids` of shape `(batch_size, sequence_length)`.
770
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
771
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation.
772
+ This is useful if you want more control over how to convert `input_ids` indices into associated vectors
773
+ than the model's internal embedding lookup matrix.
774
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
775
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
776
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
777
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
778
+ use_cache (`bool`, *optional*):
779
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
780
+ (see `past_key_values`).
781
+ output_attentions (`bool`, *optional*):
782
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
783
+ returned tensors for more detail.
784
+ output_hidden_states (`bool`, *optional*):
785
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
786
+ for more detail.
787
+ return_dict (`bool`, *optional*):
788
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
789
+
790
+ Returns:
791
+
792
+ Example:
793
+
794
+ ```python
795
+ >>> from transformers import AutoTokenizer, BlueLMForCausalLM
796
+
797
+ >>> model = BlueLMForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
798
+ >>> tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
799
+
800
+ >>> prompt = "Hey, are you consciours? Can you talk to me?"
801
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
802
+
803
+ >>> # Generate
804
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
805
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
806
+ "Hey, are you consciours? Can you talk to me?\nI'm not consciours, but I can talk to you."
807
+ ```"""
808
+
809
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
810
+ output_hidden_states = (
811
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
812
+ )
813
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
814
+
815
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
816
+ outputs = self.model(
817
+ input_ids=input_ids,
818
+ attention_mask=attention_mask,
819
+ past_key_values=past_key_values,
820
+ inputs_embeds=inputs_embeds,
821
+ use_cache=use_cache,
822
+ output_attentions=output_attentions,
823
+ output_hidden_states=output_hidden_states,
824
+ return_dict=return_dict,
825
+ )
826
+
827
+ hidden_states = outputs[0]
828
+ logits = self.lm_head(hidden_states)
829
+
830
+ loss = None
831
+ if labels is not None:
832
+ # Shift so that tokens < n predict n
833
+ shift_logits = logits[..., :-1, :].contiguous()
834
+ shift_labels = labels[..., 1:].contiguous()
835
+ # Flatten the tokens
836
+ loss_fct = CrossEntropyLoss()
837
+ shift_logits = shift_logits.view(-1, self.config.vocab_size)
838
+ shift_labels = shift_labels.view(-1)
839
+ # Enable model/pipeline parallelism
840
+ shift_labels = shift_labels.to(shift_logits.device)
841
+ loss = loss_fct(shift_logits, shift_labels)
842
+
843
+ if not return_dict:
844
+ output = (logits,) + outputs[1:]
845
+ return (loss,) + output if loss is not None else output
846
+
847
+ return CausalLMOutputWithPast(
848
+ loss=loss,
849
+ logits=logits,
850
+ past_key_values=outputs.past_key_values,
851
+ hidden_states=outputs.hidden_states,
852
+ attentions=outputs.attentions,
853
+ )
854
+
855
+ def prepare_inputs_for_generation(
856
+ self, input_ids, past_key_values=None, attention_mask=None, inputs_embeds=None, **kwargs
857
+ ):
858
+ if past_key_values:
859
+ input_ids = input_ids[:, -1:]
860
+
861
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
862
+ if inputs_embeds is not None and past_key_values is None:
863
+ model_inputs = {"inputs_embeds": inputs_embeds}
864
+ else:
865
+ model_inputs = {"input_ids": input_ids}
866
+
867
+ model_inputs.update(
868
+ {
869
+ "past_key_values": past_key_values,
870
+ "use_cache": kwargs.get("use_cache"),
871
+ "attention_mask": attention_mask,
872
+ }
873
+ )
874
+ return model_inputs
875
+
876
+ @staticmethod
877
+ def _reorder_cache(past_key_values, beam_idx):
878
+ reordered_past = ()
879
+ for layer_past in past_key_values:
880
+ reordered_past += (tuple(past_state.index_select(0, beam_idx) for past_state in layer_past),)
881
+ return reordered_past
882
+
883
+
884
+ @add_start_docstrings(
885
+ """
886
+ The BlueLM Model transformer with a sequence classification head on top (linear layer).
887
+
888
+ [`BlueLMForSequenceClassification`] uses the last token in order to do the classification, as other causal models
889
+ (e.g. GPT-2) do.
890
+
891
+ Since it does classification on the last token, it requires to know the position of the last token. If a
892
+ `pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
893
+ no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
894
+ padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
895
+ each row of the batch).
896
+ """,
897
+ BlueLM_START_DOCSTRING,
898
+ )
899
+ class BlueLMForSequenceClassification(BlueLMPreTrainedModel):
900
+ _keys_to_ignore_on_load_missing = [r"lm_head.weight"]
901
+
902
+ def __init__(self, config):
903
+ super().__init__(config)
904
+ self.num_labels = config.num_labels
905
+ self.model = BlueLMModel(config)
906
+ self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
907
+
908
+ # Initialize weights and apply final processing
909
+ self.post_init()
910
+
911
+ def get_input_embeddings(self):
912
+ return self.model.embed_tokens
913
+
914
+ def set_input_embeddings(self, value):
915
+ self.model.embed_tokens = value
916
+
917
+ @add_start_docstrings_to_model_forward(BlueLM_INPUTS_DOCSTRING)
918
+ def forward(
919
+ self,
920
+ input_ids: torch.LongTensor = None,
921
+ attention_mask: Optional[torch.Tensor] = None,
922
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
923
+ inputs_embeds: Optional[torch.FloatTensor] = None,
924
+ labels: Optional[torch.LongTensor] = None,
925
+ use_cache: Optional[bool] = None,
926
+ output_attentions: Optional[bool] = None,
927
+ output_hidden_states: Optional[bool] = None,
928
+ return_dict: Optional[bool] = None,
929
+ ) -> Union[Tuple, SequenceClassifierOutputWithPast]:
930
+ r"""
931
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
932
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
933
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
934
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
935
+ """
936
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
937
+
938
+ transformer_outputs = self.model(
939
+ input_ids,
940
+ past_key_values=past_key_values,
941
+ attention_mask=attention_mask,
942
+ inputs_embeds=inputs_embeds,
943
+ use_cache=use_cache,
944
+ output_attentions=output_attentions,
945
+ output_hidden_states=output_hidden_states,
946
+ return_dict=return_dict,
947
+ )
948
+ hidden_states = transformer_outputs[0]
949
+ logits = self.score(hidden_states)
950
+
951
+ if input_ids is not None:
952
+ batch_size = input_ids.shape[0]
953
+ else:
954
+ batch_size = inputs_embeds.shape[0]
955
+
956
+ if self.config.pad_token_id is None and batch_size != 1:
957
+ raise ValueError("Cannot handle batch sizes > 1 if no padding token is defined.")
958
+ if self.config.pad_token_id is None:
959
+ sequence_lengths = -1
960
+ else:
961
+ if input_ids is not None:
962
+ sequence_lengths = (torch.ne(input_ids, self.config.pad_token_id).sum(-1) - 1).to(logits.device)
963
+ else:
964
+ sequence_lengths = -1
965
+
966
+ pooled_logits = logits[torch.arange(batch_size, device=logits.device), sequence_lengths]
967
+
968
+ loss = None
969
+ if labels is not None:
970
+ if self.config.problem_type is None:
971
+ if self.num_labels == 1:
972
+ self.config.problem_type = "regression"
973
+ elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
974
+ self.config.problem_type = "single_label_classification"
975
+ else:
976
+ self.config.problem_type = "multi_label_classification"
977
+
978
+ if self.config.problem_type == "regression":
979
+ loss_fct = MSELoss()
980
+ if self.num_labels == 1:
981
+ loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
982
+ else:
983
+ loss = loss_fct(pooled_logits, labels)
984
+ elif self.config.problem_type == "single_label_classification":
985
+ loss_fct = CrossEntropyLoss()
986
+ loss = loss_fct(pooled_logits.view(-1, self.num_labels), labels.view(-1))
987
+ elif self.config.problem_type == "multi_label_classification":
988
+ loss_fct = BCEWithLogitsLoss()
989
+ loss = loss_fct(pooled_logits, labels)
990
+ if not return_dict:
991
+ output = (pooled_logits,) + transformer_outputs[1:]
992
+ return ((loss,) + output) if loss is not None else output
993
+
994
+ return SequenceClassifierOutputWithPast(
995
+ loss=loss,
996
+ logits=pooled_logits,
997
+ past_key_values=transformer_outputs.past_key_values,
998
+ hidden_states=transformer_outputs.hidden_states,
999
+ attentions=transformer_outputs.attentions,
1000
+ )
pytorch_model-00001-of-00003.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25535bd2bc4fdebcc0cc9061cd22be68766605650b8e5747d1a3e7af62ecf6dc
3
+ size 1994246840
pytorch_model-00002-of-00003.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84529cf4bc7708a29ae113c8b90767412b88029acdf717c374bdb098957c6a72
3
+ size 1998123957
pytorch_model-00003-of-00003.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3a82df69c11b9755f6575e0c71cb09cc87aa81fa815651c32553af56fc490e3
3
+ size 1012889758
pytorch_model.bin.index.json ADDED
@@ -0,0 +1,748 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 5005008896
4
+ },
5
+ "weight_map": {
6
+ "model.embed_tokens.weight": "pytorch_model-00001-of-00003.bin",
7
+ "model.embed_layer_norm.weight": "pytorch_model-00001-of-00003.bin",
8
+ "model.embed_layer_norm.bias": "pytorch_model-00001-of-00003.bin",
9
+ "model.layers.0.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
10
+ "model.layers.0.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
11
+ "model.layers.0.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
12
+ "model.layers.0.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
13
+ "model.layers.0.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
14
+ "model.layers.0.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
15
+ "model.layers.0.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
16
+ "model.layers.0.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
17
+ "model.layers.0.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
18
+ "model.layers.0.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
19
+ "model.layers.0.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
20
+ "model.layers.0.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
21
+ "model.layers.0.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
22
+ "model.layers.0.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
23
+ "model.layers.0.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
24
+ "model.layers.0.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
25
+ "model.layers.0.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
26
+ "model.layers.0.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
27
+ "model.layers.0.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
28
+ "model.layers.0.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
29
+ "model.layers.0.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
30
+ "model.layers.0.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
31
+ "model.layers.0.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
32
+ "model.layers.1.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
33
+ "model.layers.1.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
34
+ "model.layers.1.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
35
+ "model.layers.1.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
36
+ "model.layers.1.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
37
+ "model.layers.1.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
38
+ "model.layers.1.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
39
+ "model.layers.1.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
40
+ "model.layers.1.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
41
+ "model.layers.1.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
42
+ "model.layers.1.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
43
+ "model.layers.1.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
44
+ "model.layers.1.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
45
+ "model.layers.1.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
46
+ "model.layers.1.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
47
+ "model.layers.1.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
48
+ "model.layers.1.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
49
+ "model.layers.1.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
50
+ "model.layers.1.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
51
+ "model.layers.1.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
52
+ "model.layers.1.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
53
+ "model.layers.1.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
54
+ "model.layers.1.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
55
+ "model.layers.2.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
56
+ "model.layers.2.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
57
+ "model.layers.2.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
58
+ "model.layers.2.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
59
+ "model.layers.2.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
60
+ "model.layers.2.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
61
+ "model.layers.2.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
62
+ "model.layers.2.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
63
+ "model.layers.2.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
64
+ "model.layers.2.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
65
+ "model.layers.2.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
66
+ "model.layers.2.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
67
+ "model.layers.2.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
68
+ "model.layers.2.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
69
+ "model.layers.2.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
70
+ "model.layers.2.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
71
+ "model.layers.2.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
72
+ "model.layers.2.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
73
+ "model.layers.2.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
74
+ "model.layers.2.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
75
+ "model.layers.2.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
76
+ "model.layers.2.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
77
+ "model.layers.2.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
78
+ "model.layers.3.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
79
+ "model.layers.3.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
80
+ "model.layers.3.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
81
+ "model.layers.3.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
82
+ "model.layers.3.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
83
+ "model.layers.3.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
84
+ "model.layers.3.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
85
+ "model.layers.3.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
86
+ "model.layers.3.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
87
+ "model.layers.3.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
88
+ "model.layers.3.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
89
+ "model.layers.3.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
90
+ "model.layers.3.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
91
+ "model.layers.3.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
92
+ "model.layers.3.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
93
+ "model.layers.3.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
94
+ "model.layers.3.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
95
+ "model.layers.3.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
96
+ "model.layers.3.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
97
+ "model.layers.3.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
98
+ "model.layers.3.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
99
+ "model.layers.3.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
100
+ "model.layers.3.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
101
+ "model.layers.4.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
102
+ "model.layers.4.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
103
+ "model.layers.4.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
104
+ "model.layers.4.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
105
+ "model.layers.4.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
106
+ "model.layers.4.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
107
+ "model.layers.4.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
108
+ "model.layers.4.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
109
+ "model.layers.4.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
110
+ "model.layers.4.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
111
+ "model.layers.4.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
112
+ "model.layers.4.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
113
+ "model.layers.4.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
114
+ "model.layers.4.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
115
+ "model.layers.4.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
116
+ "model.layers.4.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
117
+ "model.layers.4.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
118
+ "model.layers.4.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
119
+ "model.layers.4.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
120
+ "model.layers.4.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
121
+ "model.layers.4.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
122
+ "model.layers.4.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
123
+ "model.layers.4.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
124
+ "model.layers.5.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
125
+ "model.layers.5.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
126
+ "model.layers.5.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
127
+ "model.layers.5.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
128
+ "model.layers.5.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
129
+ "model.layers.5.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
130
+ "model.layers.5.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
131
+ "model.layers.5.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
132
+ "model.layers.5.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
133
+ "model.layers.5.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
134
+ "model.layers.5.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
135
+ "model.layers.5.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
136
+ "model.layers.5.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
137
+ "model.layers.5.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
138
+ "model.layers.5.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
139
+ "model.layers.5.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
140
+ "model.layers.5.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
141
+ "model.layers.5.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
142
+ "model.layers.5.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
143
+ "model.layers.5.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
144
+ "model.layers.5.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
145
+ "model.layers.5.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
146
+ "model.layers.5.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
147
+ "model.layers.6.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
148
+ "model.layers.6.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
149
+ "model.layers.6.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
150
+ "model.layers.6.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
151
+ "model.layers.6.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
152
+ "model.layers.6.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
153
+ "model.layers.6.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
154
+ "model.layers.6.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
155
+ "model.layers.6.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
156
+ "model.layers.6.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
157
+ "model.layers.6.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
158
+ "model.layers.6.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
159
+ "model.layers.6.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
160
+ "model.layers.6.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
161
+ "model.layers.6.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
162
+ "model.layers.6.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
163
+ "model.layers.6.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
164
+ "model.layers.6.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
165
+ "model.layers.6.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
166
+ "model.layers.6.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
167
+ "model.layers.6.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
168
+ "model.layers.6.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
169
+ "model.layers.6.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
170
+ "model.layers.7.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
171
+ "model.layers.7.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
172
+ "model.layers.7.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
173
+ "model.layers.7.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
174
+ "model.layers.7.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
175
+ "model.layers.7.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
176
+ "model.layers.7.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
177
+ "model.layers.7.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
178
+ "model.layers.7.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
179
+ "model.layers.7.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
180
+ "model.layers.7.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
181
+ "model.layers.7.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
182
+ "model.layers.7.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
183
+ "model.layers.7.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
184
+ "model.layers.7.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
185
+ "model.layers.7.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
186
+ "model.layers.7.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
187
+ "model.layers.7.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
188
+ "model.layers.7.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
189
+ "model.layers.7.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
190
+ "model.layers.7.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
191
+ "model.layers.7.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
192
+ "model.layers.7.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
193
+ "model.layers.8.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
194
+ "model.layers.8.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
195
+ "model.layers.8.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
196
+ "model.layers.8.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
197
+ "model.layers.8.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
198
+ "model.layers.8.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
199
+ "model.layers.8.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
200
+ "model.layers.8.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
201
+ "model.layers.8.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
202
+ "model.layers.8.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
203
+ "model.layers.8.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
204
+ "model.layers.8.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
205
+ "model.layers.8.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
206
+ "model.layers.8.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
207
+ "model.layers.8.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
208
+ "model.layers.8.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
209
+ "model.layers.8.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
210
+ "model.layers.8.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
211
+ "model.layers.8.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
212
+ "model.layers.8.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
213
+ "model.layers.8.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
214
+ "model.layers.8.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
215
+ "model.layers.8.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
216
+ "model.layers.9.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
217
+ "model.layers.9.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
218
+ "model.layers.9.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
219
+ "model.layers.9.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
220
+ "model.layers.9.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
221
+ "model.layers.9.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
222
+ "model.layers.9.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
223
+ "model.layers.9.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
224
+ "model.layers.9.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
225
+ "model.layers.9.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
226
+ "model.layers.9.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
227
+ "model.layers.9.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
228
+ "model.layers.9.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
229
+ "model.layers.9.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
230
+ "model.layers.9.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
231
+ "model.layers.9.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
232
+ "model.layers.9.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
233
+ "model.layers.9.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
234
+ "model.layers.9.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
235
+ "model.layers.9.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
236
+ "model.layers.9.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
237
+ "model.layers.9.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
238
+ "model.layers.9.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
239
+ "model.layers.10.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
240
+ "model.layers.10.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
241
+ "model.layers.10.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
242
+ "model.layers.10.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
243
+ "model.layers.10.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
244
+ "model.layers.10.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
245
+ "model.layers.10.self_attn.v_proj.qweight": "pytorch_model-00001-of-00003.bin",
246
+ "model.layers.10.self_attn.v_proj.qzeros": "pytorch_model-00001-of-00003.bin",
247
+ "model.layers.10.self_attn.v_proj.scales": "pytorch_model-00001-of-00003.bin",
248
+ "model.layers.10.self_attn.o_proj.qweight": "pytorch_model-00001-of-00003.bin",
249
+ "model.layers.10.self_attn.o_proj.qzeros": "pytorch_model-00001-of-00003.bin",
250
+ "model.layers.10.self_attn.o_proj.scales": "pytorch_model-00001-of-00003.bin",
251
+ "model.layers.10.mlp.gate_proj.qweight": "pytorch_model-00001-of-00003.bin",
252
+ "model.layers.10.mlp.gate_proj.qzeros": "pytorch_model-00001-of-00003.bin",
253
+ "model.layers.10.mlp.gate_proj.scales": "pytorch_model-00001-of-00003.bin",
254
+ "model.layers.10.mlp.down_proj.qweight": "pytorch_model-00001-of-00003.bin",
255
+ "model.layers.10.mlp.down_proj.qzeros": "pytorch_model-00001-of-00003.bin",
256
+ "model.layers.10.mlp.down_proj.scales": "pytorch_model-00001-of-00003.bin",
257
+ "model.layers.10.mlp.up_proj.qweight": "pytorch_model-00001-of-00003.bin",
258
+ "model.layers.10.mlp.up_proj.qzeros": "pytorch_model-00001-of-00003.bin",
259
+ "model.layers.10.mlp.up_proj.scales": "pytorch_model-00001-of-00003.bin",
260
+ "model.layers.10.input_layernorm.weight": "pytorch_model-00001-of-00003.bin",
261
+ "model.layers.10.post_attention_layernorm.weight": "pytorch_model-00001-of-00003.bin",
262
+ "model.layers.11.self_attn.q_proj.qweight": "pytorch_model-00001-of-00003.bin",
263
+ "model.layers.11.self_attn.q_proj.qzeros": "pytorch_model-00001-of-00003.bin",
264
+ "model.layers.11.self_attn.q_proj.scales": "pytorch_model-00001-of-00003.bin",
265
+ "model.layers.11.self_attn.k_proj.qweight": "pytorch_model-00001-of-00003.bin",
266
+ "model.layers.11.self_attn.k_proj.qzeros": "pytorch_model-00001-of-00003.bin",
267
+ "model.layers.11.self_attn.k_proj.scales": "pytorch_model-00001-of-00003.bin",
268
+ "model.layers.11.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
269
+ "model.layers.11.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
270
+ "model.layers.11.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
271
+ "model.layers.11.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
272
+ "model.layers.11.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
273
+ "model.layers.11.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
274
+ "model.layers.11.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
275
+ "model.layers.11.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
276
+ "model.layers.11.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
277
+ "model.layers.11.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
278
+ "model.layers.11.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
279
+ "model.layers.11.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
280
+ "model.layers.11.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
281
+ "model.layers.11.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
282
+ "model.layers.11.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
283
+ "model.layers.11.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
284
+ "model.layers.11.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
285
+ "model.layers.12.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
286
+ "model.layers.12.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
287
+ "model.layers.12.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
288
+ "model.layers.12.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
289
+ "model.layers.12.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
290
+ "model.layers.12.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
291
+ "model.layers.12.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
292
+ "model.layers.12.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
293
+ "model.layers.12.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
294
+ "model.layers.12.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
295
+ "model.layers.12.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
296
+ "model.layers.12.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
297
+ "model.layers.12.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
298
+ "model.layers.12.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
299
+ "model.layers.12.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
300
+ "model.layers.12.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
301
+ "model.layers.12.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
302
+ "model.layers.12.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
303
+ "model.layers.12.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
304
+ "model.layers.12.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
305
+ "model.layers.12.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
306
+ "model.layers.12.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
307
+ "model.layers.12.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
308
+ "model.layers.13.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
309
+ "model.layers.13.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
310
+ "model.layers.13.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
311
+ "model.layers.13.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
312
+ "model.layers.13.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
313
+ "model.layers.13.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
314
+ "model.layers.13.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
315
+ "model.layers.13.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
316
+ "model.layers.13.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
317
+ "model.layers.13.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
318
+ "model.layers.13.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
319
+ "model.layers.13.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
320
+ "model.layers.13.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
321
+ "model.layers.13.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
322
+ "model.layers.13.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
323
+ "model.layers.13.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
324
+ "model.layers.13.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
325
+ "model.layers.13.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
326
+ "model.layers.13.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
327
+ "model.layers.13.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
328
+ "model.layers.13.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
329
+ "model.layers.13.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
330
+ "model.layers.13.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
331
+ "model.layers.14.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
332
+ "model.layers.14.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
333
+ "model.layers.14.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
334
+ "model.layers.14.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
335
+ "model.layers.14.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
336
+ "model.layers.14.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
337
+ "model.layers.14.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
338
+ "model.layers.14.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
339
+ "model.layers.14.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
340
+ "model.layers.14.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
341
+ "model.layers.14.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
342
+ "model.layers.14.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
343
+ "model.layers.14.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
344
+ "model.layers.14.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
345
+ "model.layers.14.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
346
+ "model.layers.14.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
347
+ "model.layers.14.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
348
+ "model.layers.14.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
349
+ "model.layers.14.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
350
+ "model.layers.14.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
351
+ "model.layers.14.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
352
+ "model.layers.14.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
353
+ "model.layers.14.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
354
+ "model.layers.15.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
355
+ "model.layers.15.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
356
+ "model.layers.15.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
357
+ "model.layers.15.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
358
+ "model.layers.15.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
359
+ "model.layers.15.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
360
+ "model.layers.15.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
361
+ "model.layers.15.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
362
+ "model.layers.15.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
363
+ "model.layers.15.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
364
+ "model.layers.15.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
365
+ "model.layers.15.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
366
+ "model.layers.15.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
367
+ "model.layers.15.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
368
+ "model.layers.15.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
369
+ "model.layers.15.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
370
+ "model.layers.15.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
371
+ "model.layers.15.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
372
+ "model.layers.15.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
373
+ "model.layers.15.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
374
+ "model.layers.15.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
375
+ "model.layers.15.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
376
+ "model.layers.15.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
377
+ "model.layers.16.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
378
+ "model.layers.16.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
379
+ "model.layers.16.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
380
+ "model.layers.16.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
381
+ "model.layers.16.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
382
+ "model.layers.16.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
383
+ "model.layers.16.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
384
+ "model.layers.16.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
385
+ "model.layers.16.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
386
+ "model.layers.16.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
387
+ "model.layers.16.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
388
+ "model.layers.16.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
389
+ "model.layers.16.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
390
+ "model.layers.16.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
391
+ "model.layers.16.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
392
+ "model.layers.16.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
393
+ "model.layers.16.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
394
+ "model.layers.16.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
395
+ "model.layers.16.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
396
+ "model.layers.16.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
397
+ "model.layers.16.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
398
+ "model.layers.16.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
399
+ "model.layers.16.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
400
+ "model.layers.17.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
401
+ "model.layers.17.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
402
+ "model.layers.17.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
403
+ "model.layers.17.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
404
+ "model.layers.17.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
405
+ "model.layers.17.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
406
+ "model.layers.17.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
407
+ "model.layers.17.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
408
+ "model.layers.17.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
409
+ "model.layers.17.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
410
+ "model.layers.17.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
411
+ "model.layers.17.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
412
+ "model.layers.17.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
413
+ "model.layers.17.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
414
+ "model.layers.17.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
415
+ "model.layers.17.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
416
+ "model.layers.17.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
417
+ "model.layers.17.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
418
+ "model.layers.17.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
419
+ "model.layers.17.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
420
+ "model.layers.17.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
421
+ "model.layers.17.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
422
+ "model.layers.17.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
423
+ "model.layers.18.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
424
+ "model.layers.18.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
425
+ "model.layers.18.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
426
+ "model.layers.18.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
427
+ "model.layers.18.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
428
+ "model.layers.18.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
429
+ "model.layers.18.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
430
+ "model.layers.18.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
431
+ "model.layers.18.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
432
+ "model.layers.18.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
433
+ "model.layers.18.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
434
+ "model.layers.18.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
435
+ "model.layers.18.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
436
+ "model.layers.18.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
437
+ "model.layers.18.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
438
+ "model.layers.18.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
439
+ "model.layers.18.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
440
+ "model.layers.18.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
441
+ "model.layers.18.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
442
+ "model.layers.18.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
443
+ "model.layers.18.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
444
+ "model.layers.18.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
445
+ "model.layers.18.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
446
+ "model.layers.19.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
447
+ "model.layers.19.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
448
+ "model.layers.19.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
449
+ "model.layers.19.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
450
+ "model.layers.19.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
451
+ "model.layers.19.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
452
+ "model.layers.19.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
453
+ "model.layers.19.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
454
+ "model.layers.19.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
455
+ "model.layers.19.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
456
+ "model.layers.19.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
457
+ "model.layers.19.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
458
+ "model.layers.19.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
459
+ "model.layers.19.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
460
+ "model.layers.19.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
461
+ "model.layers.19.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
462
+ "model.layers.19.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
463
+ "model.layers.19.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
464
+ "model.layers.19.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
465
+ "model.layers.19.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
466
+ "model.layers.19.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
467
+ "model.layers.19.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
468
+ "model.layers.19.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
469
+ "model.layers.20.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
470
+ "model.layers.20.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
471
+ "model.layers.20.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
472
+ "model.layers.20.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
473
+ "model.layers.20.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
474
+ "model.layers.20.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
475
+ "model.layers.20.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
476
+ "model.layers.20.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
477
+ "model.layers.20.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
478
+ "model.layers.20.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
479
+ "model.layers.20.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
480
+ "model.layers.20.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
481
+ "model.layers.20.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
482
+ "model.layers.20.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
483
+ "model.layers.20.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
484
+ "model.layers.20.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
485
+ "model.layers.20.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
486
+ "model.layers.20.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
487
+ "model.layers.20.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
488
+ "model.layers.20.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
489
+ "model.layers.20.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
490
+ "model.layers.20.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
491
+ "model.layers.20.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
492
+ "model.layers.21.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
493
+ "model.layers.21.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
494
+ "model.layers.21.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
495
+ "model.layers.21.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
496
+ "model.layers.21.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
497
+ "model.layers.21.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
498
+ "model.layers.21.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
499
+ "model.layers.21.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
500
+ "model.layers.21.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
501
+ "model.layers.21.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
502
+ "model.layers.21.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
503
+ "model.layers.21.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
504
+ "model.layers.21.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
505
+ "model.layers.21.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
506
+ "model.layers.21.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
507
+ "model.layers.21.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
508
+ "model.layers.21.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
509
+ "model.layers.21.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
510
+ "model.layers.21.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
511
+ "model.layers.21.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
512
+ "model.layers.21.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
513
+ "model.layers.21.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
514
+ "model.layers.21.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
515
+ "model.layers.22.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
516
+ "model.layers.22.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
517
+ "model.layers.22.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
518
+ "model.layers.22.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
519
+ "model.layers.22.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
520
+ "model.layers.22.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
521
+ "model.layers.22.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
522
+ "model.layers.22.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
523
+ "model.layers.22.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
524
+ "model.layers.22.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
525
+ "model.layers.22.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
526
+ "model.layers.22.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
527
+ "model.layers.22.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
528
+ "model.layers.22.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
529
+ "model.layers.22.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
530
+ "model.layers.22.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
531
+ "model.layers.22.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
532
+ "model.layers.22.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
533
+ "model.layers.22.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
534
+ "model.layers.22.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
535
+ "model.layers.22.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
536
+ "model.layers.22.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
537
+ "model.layers.22.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
538
+ "model.layers.23.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
539
+ "model.layers.23.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
540
+ "model.layers.23.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
541
+ "model.layers.23.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
542
+ "model.layers.23.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
543
+ "model.layers.23.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
544
+ "model.layers.23.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
545
+ "model.layers.23.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
546
+ "model.layers.23.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
547
+ "model.layers.23.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
548
+ "model.layers.23.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
549
+ "model.layers.23.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
550
+ "model.layers.23.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
551
+ "model.layers.23.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
552
+ "model.layers.23.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
553
+ "model.layers.23.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
554
+ "model.layers.23.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
555
+ "model.layers.23.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
556
+ "model.layers.23.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
557
+ "model.layers.23.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
558
+ "model.layers.23.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
559
+ "model.layers.23.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
560
+ "model.layers.23.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
561
+ "model.layers.24.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
562
+ "model.layers.24.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
563
+ "model.layers.24.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
564
+ "model.layers.24.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
565
+ "model.layers.24.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
566
+ "model.layers.24.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
567
+ "model.layers.24.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
568
+ "model.layers.24.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
569
+ "model.layers.24.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
570
+ "model.layers.24.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
571
+ "model.layers.24.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
572
+ "model.layers.24.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
573
+ "model.layers.24.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
574
+ "model.layers.24.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
575
+ "model.layers.24.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
576
+ "model.layers.24.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
577
+ "model.layers.24.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
578
+ "model.layers.24.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
579
+ "model.layers.24.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
580
+ "model.layers.24.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
581
+ "model.layers.24.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
582
+ "model.layers.24.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
583
+ "model.layers.24.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
584
+ "model.layers.25.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
585
+ "model.layers.25.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
586
+ "model.layers.25.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
587
+ "model.layers.25.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
588
+ "model.layers.25.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
589
+ "model.layers.25.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
590
+ "model.layers.25.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
591
+ "model.layers.25.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
592
+ "model.layers.25.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
593
+ "model.layers.25.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
594
+ "model.layers.25.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
595
+ "model.layers.25.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
596
+ "model.layers.25.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
597
+ "model.layers.25.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
598
+ "model.layers.25.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
599
+ "model.layers.25.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
600
+ "model.layers.25.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
601
+ "model.layers.25.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
602
+ "model.layers.25.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
603
+ "model.layers.25.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
604
+ "model.layers.25.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
605
+ "model.layers.25.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
606
+ "model.layers.25.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
607
+ "model.layers.26.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
608
+ "model.layers.26.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
609
+ "model.layers.26.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
610
+ "model.layers.26.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
611
+ "model.layers.26.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
612
+ "model.layers.26.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
613
+ "model.layers.26.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
614
+ "model.layers.26.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
615
+ "model.layers.26.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
616
+ "model.layers.26.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
617
+ "model.layers.26.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
618
+ "model.layers.26.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
619
+ "model.layers.26.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
620
+ "model.layers.26.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
621
+ "model.layers.26.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
622
+ "model.layers.26.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
623
+ "model.layers.26.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
624
+ "model.layers.26.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
625
+ "model.layers.26.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
626
+ "model.layers.26.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
627
+ "model.layers.26.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
628
+ "model.layers.26.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
629
+ "model.layers.26.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
630
+ "model.layers.27.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
631
+ "model.layers.27.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
632
+ "model.layers.27.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
633
+ "model.layers.27.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
634
+ "model.layers.27.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
635
+ "model.layers.27.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
636
+ "model.layers.27.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
637
+ "model.layers.27.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
638
+ "model.layers.27.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
639
+ "model.layers.27.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
640
+ "model.layers.27.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
641
+ "model.layers.27.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
642
+ "model.layers.27.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
643
+ "model.layers.27.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
644
+ "model.layers.27.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
645
+ "model.layers.27.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
646
+ "model.layers.27.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
647
+ "model.layers.27.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
648
+ "model.layers.27.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
649
+ "model.layers.27.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
650
+ "model.layers.27.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
651
+ "model.layers.27.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
652
+ "model.layers.27.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
653
+ "model.layers.28.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
654
+ "model.layers.28.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
655
+ "model.layers.28.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
656
+ "model.layers.28.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
657
+ "model.layers.28.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
658
+ "model.layers.28.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
659
+ "model.layers.28.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
660
+ "model.layers.28.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
661
+ "model.layers.28.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
662
+ "model.layers.28.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
663
+ "model.layers.28.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
664
+ "model.layers.28.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
665
+ "model.layers.28.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
666
+ "model.layers.28.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
667
+ "model.layers.28.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
668
+ "model.layers.28.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
669
+ "model.layers.28.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
670
+ "model.layers.28.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
671
+ "model.layers.28.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
672
+ "model.layers.28.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
673
+ "model.layers.28.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
674
+ "model.layers.28.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
675
+ "model.layers.28.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
676
+ "model.layers.29.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
677
+ "model.layers.29.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
678
+ "model.layers.29.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
679
+ "model.layers.29.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
680
+ "model.layers.29.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
681
+ "model.layers.29.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
682
+ "model.layers.29.self_attn.v_proj.qweight": "pytorch_model-00002-of-00003.bin",
683
+ "model.layers.29.self_attn.v_proj.qzeros": "pytorch_model-00002-of-00003.bin",
684
+ "model.layers.29.self_attn.v_proj.scales": "pytorch_model-00002-of-00003.bin",
685
+ "model.layers.29.self_attn.o_proj.qweight": "pytorch_model-00002-of-00003.bin",
686
+ "model.layers.29.self_attn.o_proj.qzeros": "pytorch_model-00002-of-00003.bin",
687
+ "model.layers.29.self_attn.o_proj.scales": "pytorch_model-00002-of-00003.bin",
688
+ "model.layers.29.mlp.gate_proj.qweight": "pytorch_model-00002-of-00003.bin",
689
+ "model.layers.29.mlp.gate_proj.qzeros": "pytorch_model-00002-of-00003.bin",
690
+ "model.layers.29.mlp.gate_proj.scales": "pytorch_model-00002-of-00003.bin",
691
+ "model.layers.29.mlp.down_proj.qweight": "pytorch_model-00002-of-00003.bin",
692
+ "model.layers.29.mlp.down_proj.qzeros": "pytorch_model-00002-of-00003.bin",
693
+ "model.layers.29.mlp.down_proj.scales": "pytorch_model-00002-of-00003.bin",
694
+ "model.layers.29.mlp.up_proj.qweight": "pytorch_model-00002-of-00003.bin",
695
+ "model.layers.29.mlp.up_proj.qzeros": "pytorch_model-00002-of-00003.bin",
696
+ "model.layers.29.mlp.up_proj.scales": "pytorch_model-00002-of-00003.bin",
697
+ "model.layers.29.input_layernorm.weight": "pytorch_model-00002-of-00003.bin",
698
+ "model.layers.29.post_attention_layernorm.weight": "pytorch_model-00002-of-00003.bin",
699
+ "model.layers.30.self_attn.q_proj.qweight": "pytorch_model-00002-of-00003.bin",
700
+ "model.layers.30.self_attn.q_proj.qzeros": "pytorch_model-00002-of-00003.bin",
701
+ "model.layers.30.self_attn.q_proj.scales": "pytorch_model-00002-of-00003.bin",
702
+ "model.layers.30.self_attn.k_proj.qweight": "pytorch_model-00002-of-00003.bin",
703
+ "model.layers.30.self_attn.k_proj.qzeros": "pytorch_model-00002-of-00003.bin",
704
+ "model.layers.30.self_attn.k_proj.scales": "pytorch_model-00002-of-00003.bin",
705
+ "model.layers.30.self_attn.v_proj.qweight": "pytorch_model-00003-of-00003.bin",
706
+ "model.layers.30.self_attn.v_proj.qzeros": "pytorch_model-00003-of-00003.bin",
707
+ "model.layers.30.self_attn.v_proj.scales": "pytorch_model-00003-of-00003.bin",
708
+ "model.layers.30.self_attn.o_proj.qweight": "pytorch_model-00003-of-00003.bin",
709
+ "model.layers.30.self_attn.o_proj.qzeros": "pytorch_model-00003-of-00003.bin",
710
+ "model.layers.30.self_attn.o_proj.scales": "pytorch_model-00003-of-00003.bin",
711
+ "model.layers.30.mlp.gate_proj.qweight": "pytorch_model-00003-of-00003.bin",
712
+ "model.layers.30.mlp.gate_proj.qzeros": "pytorch_model-00003-of-00003.bin",
713
+ "model.layers.30.mlp.gate_proj.scales": "pytorch_model-00003-of-00003.bin",
714
+ "model.layers.30.mlp.down_proj.qweight": "pytorch_model-00003-of-00003.bin",
715
+ "model.layers.30.mlp.down_proj.qzeros": "pytorch_model-00003-of-00003.bin",
716
+ "model.layers.30.mlp.down_proj.scales": "pytorch_model-00003-of-00003.bin",
717
+ "model.layers.30.mlp.up_proj.qweight": "pytorch_model-00003-of-00003.bin",
718
+ "model.layers.30.mlp.up_proj.qzeros": "pytorch_model-00003-of-00003.bin",
719
+ "model.layers.30.mlp.up_proj.scales": "pytorch_model-00003-of-00003.bin",
720
+ "model.layers.30.input_layernorm.weight": "pytorch_model-00003-of-00003.bin",
721
+ "model.layers.30.post_attention_layernorm.weight": "pytorch_model-00003-of-00003.bin",
722
+ "model.layers.31.self_attn.q_proj.qweight": "pytorch_model-00003-of-00003.bin",
723
+ "model.layers.31.self_attn.q_proj.qzeros": "pytorch_model-00003-of-00003.bin",
724
+ "model.layers.31.self_attn.q_proj.scales": "pytorch_model-00003-of-00003.bin",
725
+ "model.layers.31.self_attn.k_proj.qweight": "pytorch_model-00003-of-00003.bin",
726
+ "model.layers.31.self_attn.k_proj.qzeros": "pytorch_model-00003-of-00003.bin",
727
+ "model.layers.31.self_attn.k_proj.scales": "pytorch_model-00003-of-00003.bin",
728
+ "model.layers.31.self_attn.v_proj.qweight": "pytorch_model-00003-of-00003.bin",
729
+ "model.layers.31.self_attn.v_proj.qzeros": "pytorch_model-00003-of-00003.bin",
730
+ "model.layers.31.self_attn.v_proj.scales": "pytorch_model-00003-of-00003.bin",
731
+ "model.layers.31.self_attn.o_proj.qweight": "pytorch_model-00003-of-00003.bin",
732
+ "model.layers.31.self_attn.o_proj.qzeros": "pytorch_model-00003-of-00003.bin",
733
+ "model.layers.31.self_attn.o_proj.scales": "pytorch_model-00003-of-00003.bin",
734
+ "model.layers.31.mlp.gate_proj.qweight": "pytorch_model-00003-of-00003.bin",
735
+ "model.layers.31.mlp.gate_proj.qzeros": "pytorch_model-00003-of-00003.bin",
736
+ "model.layers.31.mlp.gate_proj.scales": "pytorch_model-00003-of-00003.bin",
737
+ "model.layers.31.mlp.down_proj.qweight": "pytorch_model-00003-of-00003.bin",
738
+ "model.layers.31.mlp.down_proj.qzeros": "pytorch_model-00003-of-00003.bin",
739
+ "model.layers.31.mlp.down_proj.scales": "pytorch_model-00003-of-00003.bin",
740
+ "model.layers.31.mlp.up_proj.qweight": "pytorch_model-00003-of-00003.bin",
741
+ "model.layers.31.mlp.up_proj.qzeros": "pytorch_model-00003-of-00003.bin",
742
+ "model.layers.31.mlp.up_proj.scales": "pytorch_model-00003-of-00003.bin",
743
+ "model.layers.31.input_layernorm.weight": "pytorch_model-00003-of-00003.bin",
744
+ "model.layers.31.post_attention_layernorm.weight": "pytorch_model-00003-of-00003.bin",
745
+ "model.norm.weight": "pytorch_model-00003-of-00003.bin",
746
+ "lm_head.weight": "pytorch_model-00003-of-00003.bin"
747
+ }
748
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "[|Human|]:",
4
+ "[|AI|]:",
5
+ "[SEH]",
6
+ "[SEA]"
7
+ ],
8
+ "bos_token": {
9
+ "content": "<s>",
10
+ "lstrip": false,
11
+ "normalized": true,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ },
15
+ "eos_token": {
16
+ "content": "</s>",
17
+ "lstrip": false,
18
+ "normalized": true,
19
+ "rstrip": false,
20
+ "single_word": false
21
+ },
22
+ "pad_token": {
23
+ "content": "<pad>",
24
+ "lstrip": false,
25
+ "normalized": true,
26
+ "rstrip": false,
27
+ "single_word": false
28
+ },
29
+ "unk_token": {
30
+ "content": "<unk>",
31
+ "lstrip": false,
32
+ "normalized": true,
33
+ "rstrip": false,
34
+ "single_word": false
35
+ }
36
+ }
tokenization_bluelm.py ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2023 vivo.
2
+ #
3
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
4
+ #
5
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
6
+ # and OPT implementations in this library. It has been modified from its
7
+ # original forms to accommodate minor architectural differences compared
8
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+
22
+ """Tokenization classes for BlueLM."""
23
+ import os
24
+ from shutil import copyfile
25
+ from typing import Any, Dict, List, Optional, Tuple
26
+
27
+ import sentencepiece as spm
28
+
29
+ from transformers.tokenization_utils import AddedToken, PreTrainedTokenizer
30
+ from transformers.utils import logging
31
+
32
+
33
+ logger = logging.get_logger(__name__)
34
+
35
+ VOCAB_FILES_NAMES = {"vocab_file": "tokenizer.model"}
36
+
37
+ PRETRAINED_VOCAB_FILES_MAP = {
38
+ "vocab_file": {},
39
+ "tokenizer_file": {},
40
+ }
41
+ PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES = {}
42
+
43
+
44
+ class BlueLMTokenizer(PreTrainedTokenizer):
45
+ """
46
+ Construct a BlueLM tokenizer. Based on byte-level Byte-Pair-Encoding.
47
+
48
+ Args:
49
+ vocab_file (`str`):
50
+ Path to the vocabulary file.
51
+ """
52
+
53
+ vocab_files_names = VOCAB_FILES_NAMES
54
+ pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
55
+ max_model_input_sizes = PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
56
+ model_input_names = ["input_ids", "attention_mask"]
57
+
58
+ def __init__(
59
+ self,
60
+ vocab_file,
61
+ unk_token="<unk>",
62
+ bos_token="<s>",
63
+ eos_token="</s>",
64
+ pad_token=None,
65
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
66
+ add_bos_token=True,
67
+ add_eos_token=False,
68
+ clean_up_tokenization_spaces=False,
69
+ **kwargs,
70
+ ):
71
+ self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
72
+ bos_token = AddedToken(bos_token, lstrip=False, rstrip=False) if isinstance(bos_token, str) else bos_token
73
+ eos_token = AddedToken(eos_token, lstrip=False, rstrip=False) if isinstance(eos_token, str) else eos_token
74
+ unk_token = AddedToken(unk_token, lstrip=False, rstrip=False) if isinstance(unk_token, str) else unk_token
75
+ pad_token = AddedToken(pad_token, lstrip=False, rstrip=False) if isinstance(pad_token, str) else pad_token
76
+ self.vocab_file = vocab_file
77
+ self.add_bos_token = add_bos_token
78
+ self.add_eos_token = add_eos_token
79
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
80
+ self.sp_model.Load(vocab_file)
81
+ super().__init__(
82
+ bos_token=bos_token,
83
+ eos_token=eos_token,
84
+ unk_token=unk_token,
85
+ pad_token=pad_token,
86
+ add_bos_token=add_bos_token,
87
+ add_eos_token=add_eos_token,
88
+ sp_model_kwargs=self.sp_model_kwargs,
89
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
90
+ **kwargs,
91
+ )
92
+
93
+ def __getstate__(self):
94
+ state = self.__dict__.copy()
95
+ state["sp_model"] = None
96
+ return state
97
+
98
+ def __setstate__(self, d):
99
+ self.__dict__ = d
100
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
101
+ self.sp_model.Load(self.vocab_file)
102
+
103
+ @property
104
+ def vocab_size(self):
105
+ """Returns vocab size"""
106
+ return self.sp_model.get_piece_size()
107
+
108
+ def get_vocab(self):
109
+ """Returns vocab as a dict"""
110
+ vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
111
+ vocab.update(self.added_tokens_encoder)
112
+ return vocab
113
+
114
+ def _tokenize(self, text):
115
+ """Returns a tokenized string."""
116
+ return self.sp_model.encode(text, out_type=str)
117
+
118
+ def _convert_token_to_id(self, token):
119
+ """Converts a token (str) in an id using the vocab."""
120
+ return self.sp_model.piece_to_id(token)
121
+
122
+ def _convert_id_to_token(self, index):
123
+ """Converts an index (integer) in a token (str) using the vocab."""
124
+ token = self.sp_model.IdToPiece(index)
125
+ return token
126
+
127
+ def convert_tokens_to_string(self, tokens):
128
+ """Converts a sequence of tokens (string) in a single string."""
129
+ current_sub_tokens = []
130
+ out_string = ""
131
+ prev_is_special = False
132
+ for i, token in enumerate(tokens):
133
+ # make sure that special tokens are not decoded using sentencepiece model
134
+ if token in self.all_special_tokens:
135
+ if not prev_is_special and i != 0:
136
+ out_string += " "
137
+ out_string += self.sp_model.decode(current_sub_tokens) + token
138
+ prev_is_special = True
139
+ current_sub_tokens = []
140
+ else:
141
+ current_sub_tokens.append(token)
142
+ prev_is_special = False
143
+ out_string += self.sp_model.decode(current_sub_tokens)
144
+ return out_string
145
+
146
+ def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
147
+ """
148
+ Save the vocabulary and special tokens file to a directory.
149
+
150
+ Args:
151
+ save_directory (`str`):
152
+ The directory in which to save the vocabulary.
153
+
154
+ Returns:
155
+ `Tuple(str)`: Paths to the files saved.
156
+ """
157
+ if not os.path.isdir(save_directory):
158
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
159
+ return
160
+ out_vocab_file = os.path.join(
161
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
162
+ )
163
+
164
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
165
+ copyfile(self.vocab_file, out_vocab_file)
166
+ elif not os.path.isfile(self.vocab_file):
167
+ with open(out_vocab_file, "wb") as fi:
168
+ content_spiece_model = self.sp_model.serialized_model_proto()
169
+ fi.write(content_spiece_model)
170
+
171
+ return (out_vocab_file,)
172
+
173
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
174
+ bos_token_id = [self.bos_token_id] if self.add_bos_token else []
175
+ eos_token_id = [self.eos_token_id] if self.add_eos_token else []
176
+
177
+ output = bos_token_id + token_ids_0 + eos_token_id
178
+
179
+ if token_ids_1 is not None:
180
+ output = output + bos_token_id + token_ids_1 + eos_token_id
181
+
182
+ return output
183
+
184
+ def get_special_tokens_mask(
185
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
186
+ ) -> List[int]:
187
+ """
188
+ Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
189
+ special tokens using the tokenizer `prepare_for_model` method.
190
+
191
+ Args:
192
+ token_ids_0 (`List[int]`):
193
+ List of IDs.
194
+ token_ids_1 (`List[int]`, *optional*):
195
+ Optional second list of IDs for sequence pairs.
196
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
197
+ Whether or not the token list is already formatted with special tokens for the model.
198
+
199
+ Returns:
200
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
201
+ """
202
+ if already_has_special_tokens:
203
+ return super().get_special_tokens_mask(
204
+ token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
205
+ )
206
+
207
+ bos_token_id = [1] if self.add_bos_token else []
208
+ eos_token_id = [1] if self.add_eos_token else []
209
+
210
+ if token_ids_1 is None:
211
+ return bos_token_id + ([0] * len(token_ids_0)) + eos_token_id
212
+ return (
213
+ bos_token_id
214
+ + ([0] * len(token_ids_0))
215
+ + eos_token_id
216
+ + bos_token_id
217
+ + ([0] * len(token_ids_1))
218
+ + eos_token_id
219
+ )
220
+
221
+ def create_token_type_ids_from_sequences(
222
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
223
+ ) -> List[int]:
224
+ """
225
+ Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT
226
+ sequence pair mask has the following format:
227
+
228
+ ```
229
+ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
230
+ | first sequence | second sequence |
231
+ ```
232
+
233
+ if token_ids_1 is None, only returns the first portion of the mask (0s).
234
+
235
+ Args:
236
+ token_ids_0 (`List[int]`):
237
+ List of ids.
238
+ token_ids_1 (`List[int]`, *optional*):
239
+ Optional second list of IDs for sequence pairs.
240
+
241
+ Returns:
242
+ `List[int]`: List of [token type IDs](../glossary#token-type-ids) according to the given sequence(s).
243
+ """
244
+ bos_token_id = [self.bos_token_id] if self.add_bos_token else []
245
+ eos_token_id = [self.eos_token_id] if self.add_eos_token else []
246
+
247
+ output = [0] * len(bos_token_id + token_ids_0 + eos_token_id)
248
+
249
+ if token_ids_1 is not None:
250
+ output += [1] * len(bos_token_id + token_ids_1 + eos_token_id)
251
+
252
+ return output
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5ed07a4a6a74d6a69f56478892da8a06fbaa29dc27ff4d957fda6237643150b
3
+ size 1609668
tokenizer_config.json ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": true,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "3": {
30
+ "content": "<pad>",
31
+ "lstrip": false,
32
+ "normalized": true,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "100000": {
38
+ "content": "[|Human|]:",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "100001": {
46
+ "content": "[|AI|]:",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "100002": {
54
+ "content": "[SEH]",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "100003": {
62
+ "content": "[SEA]",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ }
69
+ },
70
+ "additional_special_tokens": [
71
+ "[|Human|]:",
72
+ "[|AI|]:",
73
+ "[SEH]",
74
+ "[SEA]"
75
+ ],
76
+ "auto_map": {
77
+ "AutoTokenizer": [
78
+ "tokenization_bluelm.BlueLMTokenizer",
79
+ null
80
+ ]
81
+ },
82
+ "bos_token": "<s>",
83
+ "clean_up_tokenization_spaces": false,
84
+ "eos_token": "</s>",
85
+ "model_max_length": 1000000000000000019884624838656,
86
+ "pad_token": "<pad>",
87
+ "sp_model_kwargs": {},
88
+ "tokenizer_class": "BlueLMTokenizer",
89
+ "unk_token": "<unk>"
90
+ }