DanielJacob
commited on
Upload SVDLlamaForCausalLM
Browse files- config.json +34 -0
- configuration_svd_llama.py +206 -0
- generation_config.json +10 -0
- model-00001-of-00003.safetensors +3 -0
- model-00002-of-00003.safetensors +3 -0
- model-00003-of-00003.safetensors +3 -0
- model.safetensors.index.json +522 -0
- modeling_svd_llama.py +356 -0
config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "huggingface_repos/meta-llama2-7b-svd80",
|
3 |
+
"architectures": [
|
4 |
+
"SVDLlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"auto_map": {
|
9 |
+
"AutoConfig": "configuration_svd_llama.SVDLlamaConfig",
|
10 |
+
"AutoModelForCausalLM": "modeling_svd_llama.SVDLlamaForCausalLM"
|
11 |
+
},
|
12 |
+
"bos_token_id": 1,
|
13 |
+
"eos_token_id": 2,
|
14 |
+
"hidden_act": "silu",
|
15 |
+
"hidden_size": 4096,
|
16 |
+
"initializer_range": 0.02,
|
17 |
+
"intermediate_size": 11008,
|
18 |
+
"max_position_embeddings": 4096,
|
19 |
+
"mlp_bias": false,
|
20 |
+
"model_type": "llama",
|
21 |
+
"num_attention_heads": 32,
|
22 |
+
"num_hidden_layers": 32,
|
23 |
+
"num_key_value_heads": 32,
|
24 |
+
"pretraining_tp": 1,
|
25 |
+
"ratio": 0.8,
|
26 |
+
"rms_norm_eps": 1e-05,
|
27 |
+
"rope_scaling": null,
|
28 |
+
"rope_theta": 10000.0,
|
29 |
+
"tie_word_embeddings": false,
|
30 |
+
"torch_dtype": "float16",
|
31 |
+
"transformers_version": "4.44.2",
|
32 |
+
"use_cache": true,
|
33 |
+
"vocab_size": 32000
|
34 |
+
}
|
configuration_svd_llama.py
ADDED
@@ -0,0 +1,206 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"""LLaMA model configuration"""
|
21 |
+
|
22 |
+
from transformers.configuration_utils import PretrainedConfig
|
23 |
+
from transformers.modeling_rope_utils import rope_config_validation
|
24 |
+
|
25 |
+
|
26 |
+
class SVDLlamaConfig(PretrainedConfig):
|
27 |
+
r"""
|
28 |
+
This is the configuration class to store the configuration of a [`LlamaModel`]. It is used to instantiate an LLaMA
|
29 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
30 |
+
defaults will yield a similar configuration to that of the LLaMA-7B.
|
31 |
+
|
32 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
33 |
+
documentation from [`PretrainedConfig`] for more information.
|
34 |
+
|
35 |
+
|
36 |
+
Args:
|
37 |
+
vocab_size (`int`, *optional*, defaults to 32000):
|
38 |
+
Vocabulary size of the LLaMA model. Defines the number of different tokens that can be represented by the
|
39 |
+
`inputs_ids` passed when calling [`LlamaModel`]
|
40 |
+
hidden_size (`int`, *optional*, defaults to 4096):
|
41 |
+
Dimension of the hidden representations.
|
42 |
+
intermediate_size (`int`, *optional*, defaults to 11008):
|
43 |
+
Dimension of the MLP representations.
|
44 |
+
num_hidden_layers (`int`, *optional*, defaults to 32):
|
45 |
+
Number of hidden layers in the Transformer decoder.
|
46 |
+
num_attention_heads (`int`, *optional*, defaults to 32):
|
47 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
48 |
+
num_key_value_heads (`int`, *optional*):
|
49 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
50 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
51 |
+
`num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
52 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
53 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
54 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
55 |
+
`num_attention_heads`.
|
56 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
57 |
+
The non-linear activation function (function or string) in the decoder.
|
58 |
+
max_position_embeddings (`int`, *optional*, defaults to 2048):
|
59 |
+
The maximum sequence length that this model might ever be used with. Llama 1 supports up to 2048 tokens,
|
60 |
+
Llama 2 up to 4096, CodeLlama up to 16384.
|
61 |
+
initializer_range (`float`, *optional*, defaults to 0.02):
|
62 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
63 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
64 |
+
The epsilon used by the rms normalization layers.
|
65 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
66 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
67 |
+
relevant if `config.is_decoder=True`.
|
68 |
+
pad_token_id (`int`, *optional*):
|
69 |
+
Padding token id.
|
70 |
+
bos_token_id (`int`, *optional*, defaults to 1):
|
71 |
+
Beginning of stream token id.
|
72 |
+
eos_token_id (`int`, *optional*, defaults to 2):
|
73 |
+
End of stream token id.
|
74 |
+
pretraining_tp (`int`, *optional*, defaults to 1):
|
75 |
+
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to [this
|
76 |
+
document](https://huggingface.co/docs/transformers/main/perf_train_gpu_many#tensor-parallelism) to
|
77 |
+
understand more about it. This value is necessary to ensure exact reproducibility of the pretraining
|
78 |
+
results. Please refer to [this issue](https://github.com/pytorch/pytorch/issues/76232).
|
79 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
80 |
+
Whether to tie weight embeddings
|
81 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
82 |
+
The base period of the RoPE embeddings.
|
83 |
+
rope_scaling (`Dict`, *optional*):
|
84 |
+
Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
|
85 |
+
and you expect the model to work on longer `max_position_embeddings`, we recommend you to update this value
|
86 |
+
accordingly.
|
87 |
+
Expected contents:
|
88 |
+
`rope_type` (`str`):
|
89 |
+
The sub-variant of RoPE to use. Can be one of ['default', 'linear', 'dynamic', 'yarn', 'longrope',
|
90 |
+
'llama3'], with 'default' being the original RoPE implementation.
|
91 |
+
`factor` (`float`, *optional*):
|
92 |
+
Used with all rope types except 'default'. The scaling factor to apply to the RoPE embeddings. In
|
93 |
+
most scaling types, a `factor` of x will enable the model to handle sequences of length x *
|
94 |
+
original maximum pre-trained length.
|
95 |
+
`original_max_position_embeddings` (`int`, *optional*):
|
96 |
+
Used with 'dynamic', 'longrope' and 'llama3'. The original max position embeddings used during
|
97 |
+
pretraining.
|
98 |
+
`attention_factor` (`float`, *optional*):
|
99 |
+
Used with 'yarn' and 'longrope'. The scaling factor to be applied on the attention
|
100 |
+
computation. If unspecified, it defaults to value recommended by the implementation, using the
|
101 |
+
`factor` field to infer the suggested value.
|
102 |
+
`beta_fast` (`float`, *optional*):
|
103 |
+
Only used with 'yarn'. Parameter to set the boundary for extrapolation (only) in the linear
|
104 |
+
ramp function. If unspecified, it defaults to 32.
|
105 |
+
`beta_slow` (`float`, *optional*):
|
106 |
+
Only used with 'yarn'. Parameter to set the boundary for interpolation (only) in the linear
|
107 |
+
ramp function. If unspecified, it defaults to 1.
|
108 |
+
`short_factor` (`List[float]`, *optional*):
|
109 |
+
Only used with 'longrope'. The scaling factor to be applied to short contexts (<
|
110 |
+
`original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
|
111 |
+
size divided by the number of attention heads divided by 2
|
112 |
+
`long_factor` (`List[float]`, *optional*):
|
113 |
+
Only used with 'longrope'. The scaling factor to be applied to long contexts (<
|
114 |
+
`original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
|
115 |
+
size divided by the number of attention heads divided by 2
|
116 |
+
`low_freq_factor` (`float`, *optional*):
|
117 |
+
Only used with 'llama3'. Scaling factor applied to low frequency components of the RoPE
|
118 |
+
`high_freq_factor` (`float`, *optional*):
|
119 |
+
Only used with 'llama3'. Scaling factor applied to high frequency components of the RoPE
|
120 |
+
attention_bias (`bool`, *optional*, defaults to `False`):
|
121 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
122 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
123 |
+
The dropout ratio for the attention probabilities.
|
124 |
+
mlp_bias (`bool`, *optional*, defaults to `False`):
|
125 |
+
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.
|
126 |
+
|
127 |
+
```python
|
128 |
+
>>> from transformers import LlamaModel, LlamaConfig
|
129 |
+
|
130 |
+
>>> # Initializing a LLaMA llama-7b style configuration
|
131 |
+
>>> configuration = LlamaConfig()
|
132 |
+
|
133 |
+
>>> # Initializing a model from the llama-7b style configuration
|
134 |
+
>>> model = LlamaModel(configuration)
|
135 |
+
|
136 |
+
>>> # Accessing the model configuration
|
137 |
+
>>> configuration = model.config
|
138 |
+
```"""
|
139 |
+
|
140 |
+
model_type = "llama"
|
141 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
142 |
+
|
143 |
+
def __init__(
|
144 |
+
self,
|
145 |
+
vocab_size=32000,
|
146 |
+
hidden_size=4096,
|
147 |
+
intermediate_size=11008,
|
148 |
+
num_hidden_layers=32,
|
149 |
+
num_attention_heads=32,
|
150 |
+
num_key_value_heads=None,
|
151 |
+
hidden_act="silu",
|
152 |
+
max_position_embeddings=2048,
|
153 |
+
initializer_range=0.02,
|
154 |
+
rms_norm_eps=1e-6,
|
155 |
+
use_cache=True,
|
156 |
+
pad_token_id=None,
|
157 |
+
bos_token_id=1,
|
158 |
+
eos_token_id=2,
|
159 |
+
pretraining_tp=1,
|
160 |
+
tie_word_embeddings=False,
|
161 |
+
rope_theta=10000.0,
|
162 |
+
rope_scaling=None,
|
163 |
+
attention_bias=False,
|
164 |
+
attention_dropout=0.0,
|
165 |
+
mlp_bias=False,
|
166 |
+
ratio=1,
|
167 |
+
**kwargs,
|
168 |
+
):
|
169 |
+
self.vocab_size = vocab_size
|
170 |
+
self.max_position_embeddings = max_position_embeddings
|
171 |
+
self.hidden_size = hidden_size
|
172 |
+
self.intermediate_size = intermediate_size
|
173 |
+
self.num_hidden_layers = num_hidden_layers
|
174 |
+
self.num_attention_heads = num_attention_heads
|
175 |
+
|
176 |
+
# for backward compatibility
|
177 |
+
if num_key_value_heads is None:
|
178 |
+
num_key_value_heads = num_attention_heads
|
179 |
+
|
180 |
+
self.num_key_value_heads = num_key_value_heads
|
181 |
+
self.hidden_act = hidden_act
|
182 |
+
self.initializer_range = initializer_range
|
183 |
+
self.rms_norm_eps = rms_norm_eps
|
184 |
+
self.pretraining_tp = pretraining_tp
|
185 |
+
self.use_cache = use_cache
|
186 |
+
self.rope_theta = rope_theta
|
187 |
+
self.rope_scaling = rope_scaling
|
188 |
+
self.attention_bias = attention_bias
|
189 |
+
self.attention_dropout = attention_dropout
|
190 |
+
self.mlp_bias = mlp_bias
|
191 |
+
# for svdllm
|
192 |
+
self.ratio = ratio
|
193 |
+
|
194 |
+
# Validate the correctness of rotary position embeddings parameters
|
195 |
+
# BC: if there is a 'type' field, move it to 'rope_type'.
|
196 |
+
if self.rope_scaling is not None and "type" in self.rope_scaling:
|
197 |
+
self.rope_scaling["rope_type"] = self.rope_scaling["type"]
|
198 |
+
rope_config_validation(self)
|
199 |
+
|
200 |
+
super().__init__(
|
201 |
+
pad_token_id=pad_token_id,
|
202 |
+
bos_token_id=bos_token_id,
|
203 |
+
eos_token_id=eos_token_id,
|
204 |
+
tie_word_embeddings=tie_word_embeddings,
|
205 |
+
**kwargs,
|
206 |
+
)
|
generation_config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 1,
|
3 |
+
"do_sample": true,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"max_length": 4096,
|
6 |
+
"pad_token_id": 0,
|
7 |
+
"temperature": 0.6,
|
8 |
+
"top_p": 0.9,
|
9 |
+
"transformers_version": "4.44.2"
|
10 |
+
}
|
model-00001-of-00003.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:47662d973c1c827158505bc90668f476b4d04f58b97d4374d18b49e92021347b
|
3 |
+
size 4994061160
|
model-00002-of-00003.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f9d1b9017e09f9eb927b4c49c1f6614bde6817b4f0fffe5da2bb0abace3b0cb6
|
3 |
+
size 4994791552
|
model-00003-of-00003.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2fc41a3cd73d5bef4e9557f3922f9751bbacde5fef5cf5567f61771196ce537d
|
3 |
+
size 896286416
|
model.safetensors.index.json
ADDED
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"total_size": 10885079040
|
4 |
+
},
|
5 |
+
"weight_map": {
|
6 |
+
"lm_head.weight": "model-00003-of-00003.safetensors",
|
7 |
+
"model.embed_tokens.weight": "model-00001-of-00003.safetensors",
|
8 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
9 |
+
"model.layers.0.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
10 |
+
"model.layers.0.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
11 |
+
"model.layers.0.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
12 |
+
"model.layers.0.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
13 |
+
"model.layers.0.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
14 |
+
"model.layers.0.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
15 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
16 |
+
"model.layers.0.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
17 |
+
"model.layers.0.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
18 |
+
"model.layers.0.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
19 |
+
"model.layers.0.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
20 |
+
"model.layers.0.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
21 |
+
"model.layers.0.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
22 |
+
"model.layers.0.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
23 |
+
"model.layers.0.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
24 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
25 |
+
"model.layers.1.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
26 |
+
"model.layers.1.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
27 |
+
"model.layers.1.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
28 |
+
"model.layers.1.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
29 |
+
"model.layers.1.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
30 |
+
"model.layers.1.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
31 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
32 |
+
"model.layers.1.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
33 |
+
"model.layers.1.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
34 |
+
"model.layers.1.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
35 |
+
"model.layers.1.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
36 |
+
"model.layers.1.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
37 |
+
"model.layers.1.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
38 |
+
"model.layers.1.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
39 |
+
"model.layers.1.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
40 |
+
"model.layers.10.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
41 |
+
"model.layers.10.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
42 |
+
"model.layers.10.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
43 |
+
"model.layers.10.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
44 |
+
"model.layers.10.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
45 |
+
"model.layers.10.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
46 |
+
"model.layers.10.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
47 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
48 |
+
"model.layers.10.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
49 |
+
"model.layers.10.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
50 |
+
"model.layers.10.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
51 |
+
"model.layers.10.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
52 |
+
"model.layers.10.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
53 |
+
"model.layers.10.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
54 |
+
"model.layers.10.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
55 |
+
"model.layers.10.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
56 |
+
"model.layers.11.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
57 |
+
"model.layers.11.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
58 |
+
"model.layers.11.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
59 |
+
"model.layers.11.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
60 |
+
"model.layers.11.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
61 |
+
"model.layers.11.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
62 |
+
"model.layers.11.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
63 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
64 |
+
"model.layers.11.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
65 |
+
"model.layers.11.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
66 |
+
"model.layers.11.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
67 |
+
"model.layers.11.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
68 |
+
"model.layers.11.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
69 |
+
"model.layers.11.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
70 |
+
"model.layers.11.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
71 |
+
"model.layers.11.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
72 |
+
"model.layers.12.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
73 |
+
"model.layers.12.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
74 |
+
"model.layers.12.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
75 |
+
"model.layers.12.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
76 |
+
"model.layers.12.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
77 |
+
"model.layers.12.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
78 |
+
"model.layers.12.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
79 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
80 |
+
"model.layers.12.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
81 |
+
"model.layers.12.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
82 |
+
"model.layers.12.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
83 |
+
"model.layers.12.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
84 |
+
"model.layers.12.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
85 |
+
"model.layers.12.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
86 |
+
"model.layers.12.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
87 |
+
"model.layers.12.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
88 |
+
"model.layers.13.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
89 |
+
"model.layers.13.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
90 |
+
"model.layers.13.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
91 |
+
"model.layers.13.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
92 |
+
"model.layers.13.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
93 |
+
"model.layers.13.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
94 |
+
"model.layers.13.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
95 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
96 |
+
"model.layers.13.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
97 |
+
"model.layers.13.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
98 |
+
"model.layers.13.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
99 |
+
"model.layers.13.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
100 |
+
"model.layers.13.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
101 |
+
"model.layers.13.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
102 |
+
"model.layers.13.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
103 |
+
"model.layers.13.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
104 |
+
"model.layers.14.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
105 |
+
"model.layers.14.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
106 |
+
"model.layers.14.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
107 |
+
"model.layers.14.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
108 |
+
"model.layers.14.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
109 |
+
"model.layers.14.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
110 |
+
"model.layers.14.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
111 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
112 |
+
"model.layers.14.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
113 |
+
"model.layers.14.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
114 |
+
"model.layers.14.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
115 |
+
"model.layers.14.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
116 |
+
"model.layers.14.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
117 |
+
"model.layers.14.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
118 |
+
"model.layers.14.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
119 |
+
"model.layers.14.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
120 |
+
"model.layers.15.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
121 |
+
"model.layers.15.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
122 |
+
"model.layers.15.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
123 |
+
"model.layers.15.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
124 |
+
"model.layers.15.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
125 |
+
"model.layers.15.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
126 |
+
"model.layers.15.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
127 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
128 |
+
"model.layers.15.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
129 |
+
"model.layers.15.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
130 |
+
"model.layers.15.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
131 |
+
"model.layers.15.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
132 |
+
"model.layers.15.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
133 |
+
"model.layers.15.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
134 |
+
"model.layers.15.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
135 |
+
"model.layers.15.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
136 |
+
"model.layers.16.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
137 |
+
"model.layers.16.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
138 |
+
"model.layers.16.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
139 |
+
"model.layers.16.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
140 |
+
"model.layers.16.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
141 |
+
"model.layers.16.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
142 |
+
"model.layers.16.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
143 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
144 |
+
"model.layers.16.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
145 |
+
"model.layers.16.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
146 |
+
"model.layers.16.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
147 |
+
"model.layers.16.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
148 |
+
"model.layers.16.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
149 |
+
"model.layers.16.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
150 |
+
"model.layers.16.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
151 |
+
"model.layers.16.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
152 |
+
"model.layers.17.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
153 |
+
"model.layers.17.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
154 |
+
"model.layers.17.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
155 |
+
"model.layers.17.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
156 |
+
"model.layers.17.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
157 |
+
"model.layers.17.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
158 |
+
"model.layers.17.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
159 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
160 |
+
"model.layers.17.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
161 |
+
"model.layers.17.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
162 |
+
"model.layers.17.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
163 |
+
"model.layers.17.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
164 |
+
"model.layers.17.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
165 |
+
"model.layers.17.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
166 |
+
"model.layers.17.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
167 |
+
"model.layers.17.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
168 |
+
"model.layers.18.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
169 |
+
"model.layers.18.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
170 |
+
"model.layers.18.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
171 |
+
"model.layers.18.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
172 |
+
"model.layers.18.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
173 |
+
"model.layers.18.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
174 |
+
"model.layers.18.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
175 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
176 |
+
"model.layers.18.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
177 |
+
"model.layers.18.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
178 |
+
"model.layers.18.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
179 |
+
"model.layers.18.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
180 |
+
"model.layers.18.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
181 |
+
"model.layers.18.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
182 |
+
"model.layers.18.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
183 |
+
"model.layers.18.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
184 |
+
"model.layers.19.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
185 |
+
"model.layers.19.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
186 |
+
"model.layers.19.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
187 |
+
"model.layers.19.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
188 |
+
"model.layers.19.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
189 |
+
"model.layers.19.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
190 |
+
"model.layers.19.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
191 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
192 |
+
"model.layers.19.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
193 |
+
"model.layers.19.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
194 |
+
"model.layers.19.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
195 |
+
"model.layers.19.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
196 |
+
"model.layers.19.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
197 |
+
"model.layers.19.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
198 |
+
"model.layers.19.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
199 |
+
"model.layers.19.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
200 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
201 |
+
"model.layers.2.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
202 |
+
"model.layers.2.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
203 |
+
"model.layers.2.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
204 |
+
"model.layers.2.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
205 |
+
"model.layers.2.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
206 |
+
"model.layers.2.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
207 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
208 |
+
"model.layers.2.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
209 |
+
"model.layers.2.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
210 |
+
"model.layers.2.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
211 |
+
"model.layers.2.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
212 |
+
"model.layers.2.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
213 |
+
"model.layers.2.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
214 |
+
"model.layers.2.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
215 |
+
"model.layers.2.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
216 |
+
"model.layers.20.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
217 |
+
"model.layers.20.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
218 |
+
"model.layers.20.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
219 |
+
"model.layers.20.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
220 |
+
"model.layers.20.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
221 |
+
"model.layers.20.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
222 |
+
"model.layers.20.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
223 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
224 |
+
"model.layers.20.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
225 |
+
"model.layers.20.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
226 |
+
"model.layers.20.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
227 |
+
"model.layers.20.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
228 |
+
"model.layers.20.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
229 |
+
"model.layers.20.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
230 |
+
"model.layers.20.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
231 |
+
"model.layers.20.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
232 |
+
"model.layers.21.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
233 |
+
"model.layers.21.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
234 |
+
"model.layers.21.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
235 |
+
"model.layers.21.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
236 |
+
"model.layers.21.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
237 |
+
"model.layers.21.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
238 |
+
"model.layers.21.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
239 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
240 |
+
"model.layers.21.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
241 |
+
"model.layers.21.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
242 |
+
"model.layers.21.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
243 |
+
"model.layers.21.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
244 |
+
"model.layers.21.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
245 |
+
"model.layers.21.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
246 |
+
"model.layers.21.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
247 |
+
"model.layers.21.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
248 |
+
"model.layers.22.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
249 |
+
"model.layers.22.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
250 |
+
"model.layers.22.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
251 |
+
"model.layers.22.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
252 |
+
"model.layers.22.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
253 |
+
"model.layers.22.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
254 |
+
"model.layers.22.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
255 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
256 |
+
"model.layers.22.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
257 |
+
"model.layers.22.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
258 |
+
"model.layers.22.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
259 |
+
"model.layers.22.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
260 |
+
"model.layers.22.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
261 |
+
"model.layers.22.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
262 |
+
"model.layers.22.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
263 |
+
"model.layers.22.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
264 |
+
"model.layers.23.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
265 |
+
"model.layers.23.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
266 |
+
"model.layers.23.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
267 |
+
"model.layers.23.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
268 |
+
"model.layers.23.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
269 |
+
"model.layers.23.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
270 |
+
"model.layers.23.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
271 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
272 |
+
"model.layers.23.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
273 |
+
"model.layers.23.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
274 |
+
"model.layers.23.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
275 |
+
"model.layers.23.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
276 |
+
"model.layers.23.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
277 |
+
"model.layers.23.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
278 |
+
"model.layers.23.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
279 |
+
"model.layers.23.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
280 |
+
"model.layers.24.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
281 |
+
"model.layers.24.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
282 |
+
"model.layers.24.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
283 |
+
"model.layers.24.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
284 |
+
"model.layers.24.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
285 |
+
"model.layers.24.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
286 |
+
"model.layers.24.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
287 |
+
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
288 |
+
"model.layers.24.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
289 |
+
"model.layers.24.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
290 |
+
"model.layers.24.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
291 |
+
"model.layers.24.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
292 |
+
"model.layers.24.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
293 |
+
"model.layers.24.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
294 |
+
"model.layers.24.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
295 |
+
"model.layers.24.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
296 |
+
"model.layers.25.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
297 |
+
"model.layers.25.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
298 |
+
"model.layers.25.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
299 |
+
"model.layers.25.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
300 |
+
"model.layers.25.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
301 |
+
"model.layers.25.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
302 |
+
"model.layers.25.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
303 |
+
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
304 |
+
"model.layers.25.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
305 |
+
"model.layers.25.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
306 |
+
"model.layers.25.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
307 |
+
"model.layers.25.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
308 |
+
"model.layers.25.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
309 |
+
"model.layers.25.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
310 |
+
"model.layers.25.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
311 |
+
"model.layers.25.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
312 |
+
"model.layers.26.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
313 |
+
"model.layers.26.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
314 |
+
"model.layers.26.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
315 |
+
"model.layers.26.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
316 |
+
"model.layers.26.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
317 |
+
"model.layers.26.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
318 |
+
"model.layers.26.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
319 |
+
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
320 |
+
"model.layers.26.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
321 |
+
"model.layers.26.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
322 |
+
"model.layers.26.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
323 |
+
"model.layers.26.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
324 |
+
"model.layers.26.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
325 |
+
"model.layers.26.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
326 |
+
"model.layers.26.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
327 |
+
"model.layers.26.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
328 |
+
"model.layers.27.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
329 |
+
"model.layers.27.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
330 |
+
"model.layers.27.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
331 |
+
"model.layers.27.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
332 |
+
"model.layers.27.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
333 |
+
"model.layers.27.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
334 |
+
"model.layers.27.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
335 |
+
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
336 |
+
"model.layers.27.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
337 |
+
"model.layers.27.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
338 |
+
"model.layers.27.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
339 |
+
"model.layers.27.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
340 |
+
"model.layers.27.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
341 |
+
"model.layers.27.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
342 |
+
"model.layers.27.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
343 |
+
"model.layers.27.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
344 |
+
"model.layers.28.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
345 |
+
"model.layers.28.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
346 |
+
"model.layers.28.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
347 |
+
"model.layers.28.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
348 |
+
"model.layers.28.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
349 |
+
"model.layers.28.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
350 |
+
"model.layers.28.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
351 |
+
"model.layers.28.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
352 |
+
"model.layers.28.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
353 |
+
"model.layers.28.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
354 |
+
"model.layers.28.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
355 |
+
"model.layers.28.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
356 |
+
"model.layers.28.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
357 |
+
"model.layers.28.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
358 |
+
"model.layers.28.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
359 |
+
"model.layers.28.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
360 |
+
"model.layers.29.input_layernorm.weight": "model-00002-of-00003.safetensors",
|
361 |
+
"model.layers.29.mlp.down_u_proj.weight": "model-00002-of-00003.safetensors",
|
362 |
+
"model.layers.29.mlp.down_v_proj.weight": "model-00002-of-00003.safetensors",
|
363 |
+
"model.layers.29.mlp.gate_u_proj.weight": "model-00002-of-00003.safetensors",
|
364 |
+
"model.layers.29.mlp.gate_v_proj.weight": "model-00002-of-00003.safetensors",
|
365 |
+
"model.layers.29.mlp.up_u_proj.weight": "model-00002-of-00003.safetensors",
|
366 |
+
"model.layers.29.mlp.up_v_proj.weight": "model-00002-of-00003.safetensors",
|
367 |
+
"model.layers.29.post_attention_layernorm.weight": "model-00002-of-00003.safetensors",
|
368 |
+
"model.layers.29.self_attn.k_u_proj.weight": "model-00002-of-00003.safetensors",
|
369 |
+
"model.layers.29.self_attn.k_v_proj.weight": "model-00002-of-00003.safetensors",
|
370 |
+
"model.layers.29.self_attn.o_u_proj.weight": "model-00002-of-00003.safetensors",
|
371 |
+
"model.layers.29.self_attn.o_v_proj.weight": "model-00002-of-00003.safetensors",
|
372 |
+
"model.layers.29.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
373 |
+
"model.layers.29.self_attn.q_v_proj.weight": "model-00002-of-00003.safetensors",
|
374 |
+
"model.layers.29.self_attn.v_u_proj.weight": "model-00002-of-00003.safetensors",
|
375 |
+
"model.layers.29.self_attn.v_v_proj.weight": "model-00002-of-00003.safetensors",
|
376 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
377 |
+
"model.layers.3.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
378 |
+
"model.layers.3.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
379 |
+
"model.layers.3.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
380 |
+
"model.layers.3.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
381 |
+
"model.layers.3.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
382 |
+
"model.layers.3.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
383 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
384 |
+
"model.layers.3.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
385 |
+
"model.layers.3.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
386 |
+
"model.layers.3.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
387 |
+
"model.layers.3.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
388 |
+
"model.layers.3.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
389 |
+
"model.layers.3.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
390 |
+
"model.layers.3.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
391 |
+
"model.layers.3.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
392 |
+
"model.layers.30.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
393 |
+
"model.layers.30.mlp.down_u_proj.weight": "model-00003-of-00003.safetensors",
|
394 |
+
"model.layers.30.mlp.down_v_proj.weight": "model-00003-of-00003.safetensors",
|
395 |
+
"model.layers.30.mlp.gate_u_proj.weight": "model-00003-of-00003.safetensors",
|
396 |
+
"model.layers.30.mlp.gate_v_proj.weight": "model-00003-of-00003.safetensors",
|
397 |
+
"model.layers.30.mlp.up_u_proj.weight": "model-00003-of-00003.safetensors",
|
398 |
+
"model.layers.30.mlp.up_v_proj.weight": "model-00003-of-00003.safetensors",
|
399 |
+
"model.layers.30.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
400 |
+
"model.layers.30.self_attn.k_u_proj.weight": "model-00003-of-00003.safetensors",
|
401 |
+
"model.layers.30.self_attn.k_v_proj.weight": "model-00003-of-00003.safetensors",
|
402 |
+
"model.layers.30.self_attn.o_u_proj.weight": "model-00003-of-00003.safetensors",
|
403 |
+
"model.layers.30.self_attn.o_v_proj.weight": "model-00003-of-00003.safetensors",
|
404 |
+
"model.layers.30.self_attn.q_u_proj.weight": "model-00002-of-00003.safetensors",
|
405 |
+
"model.layers.30.self_attn.q_v_proj.weight": "model-00003-of-00003.safetensors",
|
406 |
+
"model.layers.30.self_attn.v_u_proj.weight": "model-00003-of-00003.safetensors",
|
407 |
+
"model.layers.30.self_attn.v_v_proj.weight": "model-00003-of-00003.safetensors",
|
408 |
+
"model.layers.31.input_layernorm.weight": "model-00003-of-00003.safetensors",
|
409 |
+
"model.layers.31.mlp.down_u_proj.weight": "model-00003-of-00003.safetensors",
|
410 |
+
"model.layers.31.mlp.down_v_proj.weight": "model-00003-of-00003.safetensors",
|
411 |
+
"model.layers.31.mlp.gate_u_proj.weight": "model-00003-of-00003.safetensors",
|
412 |
+
"model.layers.31.mlp.gate_v_proj.weight": "model-00003-of-00003.safetensors",
|
413 |
+
"model.layers.31.mlp.up_u_proj.weight": "model-00003-of-00003.safetensors",
|
414 |
+
"model.layers.31.mlp.up_v_proj.weight": "model-00003-of-00003.safetensors",
|
415 |
+
"model.layers.31.post_attention_layernorm.weight": "model-00003-of-00003.safetensors",
|
416 |
+
"model.layers.31.self_attn.k_u_proj.weight": "model-00003-of-00003.safetensors",
|
417 |
+
"model.layers.31.self_attn.k_v_proj.weight": "model-00003-of-00003.safetensors",
|
418 |
+
"model.layers.31.self_attn.o_u_proj.weight": "model-00003-of-00003.safetensors",
|
419 |
+
"model.layers.31.self_attn.o_v_proj.weight": "model-00003-of-00003.safetensors",
|
420 |
+
"model.layers.31.self_attn.q_u_proj.weight": "model-00003-of-00003.safetensors",
|
421 |
+
"model.layers.31.self_attn.q_v_proj.weight": "model-00003-of-00003.safetensors",
|
422 |
+
"model.layers.31.self_attn.v_u_proj.weight": "model-00003-of-00003.safetensors",
|
423 |
+
"model.layers.31.self_attn.v_v_proj.weight": "model-00003-of-00003.safetensors",
|
424 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
425 |
+
"model.layers.4.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
426 |
+
"model.layers.4.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
427 |
+
"model.layers.4.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
428 |
+
"model.layers.4.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
429 |
+
"model.layers.4.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
430 |
+
"model.layers.4.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
431 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
432 |
+
"model.layers.4.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
433 |
+
"model.layers.4.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
434 |
+
"model.layers.4.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
435 |
+
"model.layers.4.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
436 |
+
"model.layers.4.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
437 |
+
"model.layers.4.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
438 |
+
"model.layers.4.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
439 |
+
"model.layers.4.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
440 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
441 |
+
"model.layers.5.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
442 |
+
"model.layers.5.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
443 |
+
"model.layers.5.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
444 |
+
"model.layers.5.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
445 |
+
"model.layers.5.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
446 |
+
"model.layers.5.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
447 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
448 |
+
"model.layers.5.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
449 |
+
"model.layers.5.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
450 |
+
"model.layers.5.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
451 |
+
"model.layers.5.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
452 |
+
"model.layers.5.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
453 |
+
"model.layers.5.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
454 |
+
"model.layers.5.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
455 |
+
"model.layers.5.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
456 |
+
"model.layers.6.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
457 |
+
"model.layers.6.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
458 |
+
"model.layers.6.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
459 |
+
"model.layers.6.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
460 |
+
"model.layers.6.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
461 |
+
"model.layers.6.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
462 |
+
"model.layers.6.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
463 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
464 |
+
"model.layers.6.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
465 |
+
"model.layers.6.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
466 |
+
"model.layers.6.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
467 |
+
"model.layers.6.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
468 |
+
"model.layers.6.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
469 |
+
"model.layers.6.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
470 |
+
"model.layers.6.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
471 |
+
"model.layers.6.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
472 |
+
"model.layers.7.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
473 |
+
"model.layers.7.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
474 |
+
"model.layers.7.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
475 |
+
"model.layers.7.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
476 |
+
"model.layers.7.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
477 |
+
"model.layers.7.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
478 |
+
"model.layers.7.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
479 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
480 |
+
"model.layers.7.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
481 |
+
"model.layers.7.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
482 |
+
"model.layers.7.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
483 |
+
"model.layers.7.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
484 |
+
"model.layers.7.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
485 |
+
"model.layers.7.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
486 |
+
"model.layers.7.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
487 |
+
"model.layers.7.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
488 |
+
"model.layers.8.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
489 |
+
"model.layers.8.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
490 |
+
"model.layers.8.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
491 |
+
"model.layers.8.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
492 |
+
"model.layers.8.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
493 |
+
"model.layers.8.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
494 |
+
"model.layers.8.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
495 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
496 |
+
"model.layers.8.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
497 |
+
"model.layers.8.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
498 |
+
"model.layers.8.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
499 |
+
"model.layers.8.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
500 |
+
"model.layers.8.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
501 |
+
"model.layers.8.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
502 |
+
"model.layers.8.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
503 |
+
"model.layers.8.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
504 |
+
"model.layers.9.input_layernorm.weight": "model-00001-of-00003.safetensors",
|
505 |
+
"model.layers.9.mlp.down_u_proj.weight": "model-00001-of-00003.safetensors",
|
506 |
+
"model.layers.9.mlp.down_v_proj.weight": "model-00001-of-00003.safetensors",
|
507 |
+
"model.layers.9.mlp.gate_u_proj.weight": "model-00001-of-00003.safetensors",
|
508 |
+
"model.layers.9.mlp.gate_v_proj.weight": "model-00001-of-00003.safetensors",
|
509 |
+
"model.layers.9.mlp.up_u_proj.weight": "model-00001-of-00003.safetensors",
|
510 |
+
"model.layers.9.mlp.up_v_proj.weight": "model-00001-of-00003.safetensors",
|
511 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00003.safetensors",
|
512 |
+
"model.layers.9.self_attn.k_u_proj.weight": "model-00001-of-00003.safetensors",
|
513 |
+
"model.layers.9.self_attn.k_v_proj.weight": "model-00001-of-00003.safetensors",
|
514 |
+
"model.layers.9.self_attn.o_u_proj.weight": "model-00001-of-00003.safetensors",
|
515 |
+
"model.layers.9.self_attn.o_v_proj.weight": "model-00001-of-00003.safetensors",
|
516 |
+
"model.layers.9.self_attn.q_u_proj.weight": "model-00001-of-00003.safetensors",
|
517 |
+
"model.layers.9.self_attn.q_v_proj.weight": "model-00001-of-00003.safetensors",
|
518 |
+
"model.layers.9.self_attn.v_u_proj.weight": "model-00001-of-00003.safetensors",
|
519 |
+
"model.layers.9.self_attn.v_v_proj.weight": "model-00001-of-00003.safetensors",
|
520 |
+
"model.norm.weight": "model-00003-of-00003.safetensors"
|
521 |
+
}
|
522 |
+
}
|
modeling_svd_llama.py
ADDED
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import math
|
2 |
+
from typing import List, Optional, Tuple
|
3 |
+
|
4 |
+
import torch
|
5 |
+
import torch.nn.functional as F
|
6 |
+
import torch.utils.checkpoint
|
7 |
+
from torch import nn
|
8 |
+
from transformers.cache_utils import Cache
|
9 |
+
from transformers.activations import ACT2FN
|
10 |
+
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS
|
11 |
+
from transformers.utils import logging
|
12 |
+
from transformers import LlamaForCausalLM
|
13 |
+
from transformers.models.llama.modeling_llama import LlamaDecoderLayer, LlamaModel, LlamaRotaryEmbedding, LlamaRMSNorm, repeat_kv, apply_rotary_pos_emb
|
14 |
+
from component.configuration_svd_llama import SVDLlamaConfig
|
15 |
+
|
16 |
+
|
17 |
+
logger = logging.get_logger(__name__)
|
18 |
+
|
19 |
+
_CONFIG_FOR_DOC = "LlamaConfig"
|
20 |
+
|
21 |
+
ALL_LAYERNORM_LAYERS.append(LlamaRMSNorm)
|
22 |
+
|
23 |
+
class SVDLlamaMLP(nn.Module):
|
24 |
+
def __init__(self, config: SVDLlamaConfig):
|
25 |
+
super().__init__()
|
26 |
+
self.config = config
|
27 |
+
self.hidden_size = config.hidden_size
|
28 |
+
self.intermediate_size = config.intermediate_size
|
29 |
+
self.ratio = config.ratio
|
30 |
+
self.low_rank = int(self.intermediate_size * self.hidden_size * self.ratio / (self.intermediate_size + self.hidden_size))
|
31 |
+
|
32 |
+
self.gate_u_proj = nn.Linear(self.low_rank, self.intermediate_size, bias=config.mlp_bias)
|
33 |
+
self.gate_v_proj = nn.Linear(self.hidden_size, self.low_rank, bias=False)
|
34 |
+
|
35 |
+
self.down_u_proj = nn.Linear(self.low_rank, self.hidden_size, bias=config.mlp_bias)
|
36 |
+
self.down_v_proj = nn.Linear(self.intermediate_size, self.low_rank, bias=False)
|
37 |
+
|
38 |
+
self.up_u_proj = nn.Linear(self.low_rank, self.intermediate_size, bias=config.mlp_bias)
|
39 |
+
self.up_v_proj = nn.Linear(self.hidden_size, self.low_rank, bias=False)
|
40 |
+
|
41 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
42 |
+
|
43 |
+
def forward(self, x):
|
44 |
+
up = self.up_u_proj(self.up_v_proj(x))
|
45 |
+
gate = self.gate_u_proj(self.gate_v_proj(x))
|
46 |
+
return self.down_u_proj(self.down_v_proj(self.act_fn(gate) * up))
|
47 |
+
|
48 |
+
class SVDLlamaAttention(nn.Module):
|
49 |
+
"""Multi-headed attention from 'Attention Is All You Need' paper"""
|
50 |
+
|
51 |
+
def __init__(self, config: SVDLlamaConfig, layer_idx: Optional[int] = None):
|
52 |
+
super().__init__()
|
53 |
+
self.config = config
|
54 |
+
self.layer_idx = layer_idx
|
55 |
+
if layer_idx is None:
|
56 |
+
logger.warning_once(
|
57 |
+
f"Instantiating {self.__class__.__name__} without passing a `layer_idx` is not recommended and will "
|
58 |
+
"lead to errors during the forward call if caching is used. Please make sure to provide a `layer_idx` "
|
59 |
+
"when creating this class."
|
60 |
+
)
|
61 |
+
|
62 |
+
self.attention_dropout = config.attention_dropout
|
63 |
+
self.hidden_size = config.hidden_size
|
64 |
+
self.num_heads = config.num_attention_heads
|
65 |
+
self.head_dim = self.hidden_size // self.num_heads
|
66 |
+
self.num_key_value_heads = config.num_key_value_heads
|
67 |
+
self.num_key_value_groups = self.num_heads // self.num_key_value_heads
|
68 |
+
self.max_position_embeddings = config.max_position_embeddings
|
69 |
+
self.rope_theta = config.rope_theta
|
70 |
+
self.is_causal = True
|
71 |
+
self.ratio = config.ratio # 1 means no truncate, just keep normal attn
|
72 |
+
|
73 |
+
if (self.head_dim * self.num_heads) != self.hidden_size:
|
74 |
+
raise ValueError(
|
75 |
+
f"hidden_size must be divisible by num_heads (got `hidden_size`: {self.hidden_size}"
|
76 |
+
f" and `num_heads`: {self.num_heads})."
|
77 |
+
)
|
78 |
+
|
79 |
+
self.q_low_rank = int(self.num_heads * self.head_dim * self.hidden_size * self.ratio / (self.num_heads * self.head_dim + self.hidden_size))
|
80 |
+
self.q_u_proj = nn.Linear(self.q_low_rank, self.num_heads * self.head_dim, bias=config.attention_bias)
|
81 |
+
self.q_v_proj = nn.Linear(self.hidden_size, self.q_low_rank, bias=False)
|
82 |
+
|
83 |
+
self.k_low_rank = int(self.num_key_value_heads * self.head_dim * self.hidden_size * self.ratio / (self.num_key_value_heads * self.head_dim + self.hidden_size))
|
84 |
+
self.k_u_proj = nn.Linear(self.k_low_rank, self.num_key_value_heads * self.head_dim, bias=config.attention_bias)
|
85 |
+
self.k_v_proj = nn.Linear(self.hidden_size, self.k_low_rank, bias=False)
|
86 |
+
|
87 |
+
self.v_low_rank = int(self.num_key_value_heads * self.head_dim * self.hidden_size * self.ratio / (self.num_key_value_heads * self.head_dim + self.hidden_size))
|
88 |
+
self.v_u_proj = nn.Linear(self.v_low_rank, self.num_key_value_heads * self.head_dim, bias=config.attention_bias)
|
89 |
+
self.v_v_proj = nn.Linear(self.hidden_size, self.v_low_rank, bias=False)
|
90 |
+
|
91 |
+
self.o_low_rank = int(self.hidden_size * self.hidden_size * self.ratio / (self.hidden_size + self.hidden_size))
|
92 |
+
self.o_u_proj = nn.Linear(self.o_low_rank, self.hidden_size, bias=config.attention_bias)
|
93 |
+
self.o_v_proj = nn.Linear(self.hidden_size, self.o_low_rank, bias=False)
|
94 |
+
|
95 |
+
# TODO (joao): remove in v4.45 (RoPE is computed in the model, not in the decoder layers)
|
96 |
+
self.rotary_emb = LlamaRotaryEmbedding(config=self.config)
|
97 |
+
|
98 |
+
def forward(
|
99 |
+
self,
|
100 |
+
hidden_states: torch.Tensor,
|
101 |
+
attention_mask: Optional[torch.Tensor] = None,
|
102 |
+
position_ids: Optional[torch.LongTensor] = None,
|
103 |
+
past_key_value: Optional[Cache] = None,
|
104 |
+
output_attentions: bool = False,
|
105 |
+
use_cache: bool = False,
|
106 |
+
cache_position: Optional[torch.LongTensor] = None,
|
107 |
+
position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # will become mandatory in v4.45
|
108 |
+
**kwargs,
|
109 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
110 |
+
# bsz, q_len, _ = hidden_states.size()
|
111 |
+
|
112 |
+
|
113 |
+
# query_states = self.q_u_proj(self.q_v_proj(hidden_states))
|
114 |
+
# key_states = self.k_u_proj(self.k_v_proj(hidden_states))
|
115 |
+
# value_states = self.v_u_proj(self.v_v_proj(hidden_states))
|
116 |
+
|
117 |
+
# query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
118 |
+
# key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
119 |
+
# value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
120 |
+
|
121 |
+
# if position_embeddings is None:
|
122 |
+
# logger.warning_once(
|
123 |
+
# "The attention layers in this model are transitioning from computing the RoPE embeddings internally "
|
124 |
+
# "through `position_ids` (2D tensor with the indexes of the tokens), to using externally computed "
|
125 |
+
# "`position_embeddings` (Tuple of tensors, containing cos and sin). In v4.45 `position_ids` will be "
|
126 |
+
# "removed and `position_embeddings` will be mandatory."
|
127 |
+
# )
|
128 |
+
# cos, sin = self.rotary_emb(value_states, position_ids)
|
129 |
+
# else:
|
130 |
+
# cos, sin = position_embeddings
|
131 |
+
# query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
|
132 |
+
|
133 |
+
# if past_key_value is not None:
|
134 |
+
# # sin and cos are specific to RoPE models; cache_position needed for the static cache
|
135 |
+
# cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
|
136 |
+
# key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
137 |
+
|
138 |
+
# key_states = repeat_kv(key_states, self.num_key_value_groups)
|
139 |
+
# value_states = repeat_kv(value_states, self.num_key_value_groups)
|
140 |
+
|
141 |
+
# attn_weights = torch.matmul(query_states, key_states.transpose(2, 3)) / math.sqrt(self.head_dim)
|
142 |
+
|
143 |
+
# if attention_mask is not None: # no matter the length, we just slice it
|
144 |
+
# causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
|
145 |
+
# attn_weights = attn_weights + causal_mask
|
146 |
+
|
147 |
+
# # upcast attention to fp32
|
148 |
+
# attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query_states.dtype)
|
149 |
+
# attn_weights = nn.functional.dropout(attn_weights, p=self.attention_dropout, training=self.training)
|
150 |
+
# attn_output = torch.matmul(attn_weights, value_states)
|
151 |
+
|
152 |
+
# if attn_output.size() != (bsz, self.num_heads, q_len, self.head_dim):
|
153 |
+
# raise ValueError(
|
154 |
+
# f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.head_dim)}, but is"
|
155 |
+
# f" {attn_output.size()}"
|
156 |
+
# )
|
157 |
+
|
158 |
+
# attn_output = attn_output.transpose(1, 2).contiguous()
|
159 |
+
|
160 |
+
# attn_output = attn_output.reshape(bsz, q_len, -1)
|
161 |
+
|
162 |
+
# attn_output = self.o_u_proj(self.o_v_proj(attn_output))
|
163 |
+
|
164 |
+
# if not output_attentions:
|
165 |
+
# attn_weights = None
|
166 |
+
|
167 |
+
# return attn_output, attn_weights, past_key_value
|
168 |
+
if output_attentions:
|
169 |
+
# TODO: Improve this warning with e.g. `model.config.attn_implementation = "manual"` once this is implemented.
|
170 |
+
logger.warning_once(
|
171 |
+
"LlamaModel is using LlamaSdpaAttention, but `torch.nn.functional.scaled_dot_product_attention` does not support `output_attentions=True`. Falling back to the manual attention implementation, "
|
172 |
+
'but specifying the manual implementation will be required from Transformers version v5.0.0 onwards. This warning can be removed using the argument `attn_implementation="eager"` when loading the model.'
|
173 |
+
)
|
174 |
+
return super().forward(
|
175 |
+
hidden_states=hidden_states,
|
176 |
+
attention_mask=attention_mask,
|
177 |
+
position_ids=position_ids,
|
178 |
+
past_key_value=past_key_value,
|
179 |
+
output_attentions=output_attentions,
|
180 |
+
use_cache=use_cache,
|
181 |
+
cache_position=cache_position,
|
182 |
+
position_embeddings=position_embeddings,
|
183 |
+
)
|
184 |
+
bsz, q_len, _ = hidden_states.size()
|
185 |
+
|
186 |
+
query_states = self.q_u_proj(self.q_v_proj(hidden_states))
|
187 |
+
key_states = self.k_u_proj(self.k_v_proj(hidden_states))
|
188 |
+
value_states = self.v_u_proj(self.v_v_proj(hidden_states))
|
189 |
+
|
190 |
+
query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
191 |
+
key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
192 |
+
value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
193 |
+
|
194 |
+
if position_embeddings is None:
|
195 |
+
logger.warning_once(
|
196 |
+
"The attention layers in this model are transitioning from computing the RoPE embeddings internally "
|
197 |
+
"through `position_ids` (2D tensor with the indexes of the tokens), to using externally computed "
|
198 |
+
"`position_embeddings` (Tuple of tensors, containing cos and sin). In v4.45 `position_ids` will be "
|
199 |
+
"removed and `position_embeddings` will be mandatory."
|
200 |
+
)
|
201 |
+
cos, sin = self.rotary_emb(value_states, position_ids)
|
202 |
+
else:
|
203 |
+
cos, sin = position_embeddings
|
204 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
|
205 |
+
|
206 |
+
if past_key_value is not None:
|
207 |
+
# sin and cos are specific to RoPE models; cache_position needed for the static cache
|
208 |
+
cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
|
209 |
+
key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
210 |
+
|
211 |
+
key_states = repeat_kv(key_states, self.num_key_value_groups)
|
212 |
+
value_states = repeat_kv(value_states, self.num_key_value_groups)
|
213 |
+
|
214 |
+
causal_mask = attention_mask
|
215 |
+
if attention_mask is not None:
|
216 |
+
causal_mask = causal_mask[:, :, :, : key_states.shape[-2]]
|
217 |
+
|
218 |
+
# SDPA with memory-efficient backend is currently (torch==2.1.2) bugged with non-contiguous inputs with custom attn_mask,
|
219 |
+
# Reference: https://github.com/pytorch/pytorch/issues/112577.
|
220 |
+
if query_states.device.type == "cuda" and causal_mask is not None:
|
221 |
+
query_states = query_states.contiguous()
|
222 |
+
key_states = key_states.contiguous()
|
223 |
+
value_states = value_states.contiguous()
|
224 |
+
|
225 |
+
# We dispatch to SDPA's Flash Attention or Efficient kernels via this `is_causal` if statement instead of an inline conditional assignment
|
226 |
+
# in SDPA to support both torch.compile's dynamic shapes and full graph options. An inline conditional prevents dynamic shapes from compiling.
|
227 |
+
is_causal = True if causal_mask is None and q_len > 1 else False
|
228 |
+
|
229 |
+
attn_output = torch.nn.functional.scaled_dot_product_attention(
|
230 |
+
query_states,
|
231 |
+
key_states,
|
232 |
+
value_states,
|
233 |
+
attn_mask=causal_mask,
|
234 |
+
dropout_p=self.attention_dropout if self.training else 0.0,
|
235 |
+
is_causal=is_causal,
|
236 |
+
)
|
237 |
+
|
238 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
239 |
+
attn_output = attn_output.view(bsz, q_len, -1)
|
240 |
+
|
241 |
+
attn_output = self.o_u_proj(self.o_v_proj(attn_output))
|
242 |
+
|
243 |
+
return attn_output, None, past_key_value
|
244 |
+
|
245 |
+
class SVDLLaMASDPA(SVDLlamaAttention):
|
246 |
+
def forward(
|
247 |
+
self,
|
248 |
+
hidden_states: torch.Tensor,
|
249 |
+
attention_mask: Optional[torch.Tensor] = None,
|
250 |
+
position_ids: Optional[torch.LongTensor] = None,
|
251 |
+
past_key_value: Optional[Cache] = None,
|
252 |
+
output_attentions: bool = False,
|
253 |
+
use_cache: bool = False,
|
254 |
+
cache_position: Optional[torch.LongTensor] = None,
|
255 |
+
position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # will become mandatory in v4.45
|
256 |
+
**kwargs,
|
257 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
258 |
+
if output_attentions:
|
259 |
+
# TODO: Improve this warning with e.g. `model.config.attn_implementation = "manual"` once this is implemented.
|
260 |
+
logger.warning_once(
|
261 |
+
"LlamaModel is using LlamaSdpaAttention, but `torch.nn.functional.scaled_dot_product_attention` does not support `output_attentions=True`. Falling back to the manual attention implementation, "
|
262 |
+
'but specifying the manual implementation will be required from Transformers version v5.0.0 onwards. This warning can be removed using the argument `attn_implementation="eager"` when loading the model.'
|
263 |
+
)
|
264 |
+
return super().forward(
|
265 |
+
hidden_states=hidden_states,
|
266 |
+
attention_mask=attention_mask,
|
267 |
+
position_ids=position_ids,
|
268 |
+
past_key_value=past_key_value,
|
269 |
+
output_attentions=output_attentions,
|
270 |
+
use_cache=use_cache,
|
271 |
+
cache_position=cache_position,
|
272 |
+
position_embeddings=position_embeddings,
|
273 |
+
)
|
274 |
+
bsz, q_len, _ = hidden_states.size()
|
275 |
+
|
276 |
+
query_states = self.q_u_proj(self.q_v_proj(hidden_states))
|
277 |
+
key_states = self.k_u_proj(self.k_v_proj(hidden_states))
|
278 |
+
value_states = self.v_u_proj(self.v_v_proj(hidden_states))
|
279 |
+
|
280 |
+
query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
281 |
+
key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
282 |
+
value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
|
283 |
+
|
284 |
+
if position_embeddings is None:
|
285 |
+
logger.warning_once(
|
286 |
+
"The attention layers in this model are transitioning from computing the RoPE embeddings internally "
|
287 |
+
"through `position_ids` (2D tensor with the indexes of the tokens), to using externally computed "
|
288 |
+
"`position_embeddings` (Tuple of tensors, containing cos and sin). In v4.45 `position_ids` will be "
|
289 |
+
"removed and `position_embeddings` will be mandatory."
|
290 |
+
)
|
291 |
+
cos, sin = self.rotary_emb(value_states, position_ids)
|
292 |
+
else:
|
293 |
+
cos, sin = position_embeddings
|
294 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
|
295 |
+
|
296 |
+
if past_key_value is not None:
|
297 |
+
# sin and cos are specific to RoPE models; cache_position needed for the static cache
|
298 |
+
cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
|
299 |
+
key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
300 |
+
|
301 |
+
key_states = repeat_kv(key_states, self.num_key_value_groups)
|
302 |
+
value_states = repeat_kv(value_states, self.num_key_value_groups)
|
303 |
+
|
304 |
+
causal_mask = attention_mask
|
305 |
+
if attention_mask is not None:
|
306 |
+
causal_mask = causal_mask[:, :, :, : key_states.shape[-2]]
|
307 |
+
|
308 |
+
# SDPA with memory-efficient backend is currently (torch==2.1.2) bugged with non-contiguous inputs with custom attn_mask,
|
309 |
+
# Reference: https://github.com/pytorch/pytorch/issues/112577.
|
310 |
+
if query_states.device.type == "cuda" and causal_mask is not None:
|
311 |
+
query_states = query_states.contiguous()
|
312 |
+
key_states = key_states.contiguous()
|
313 |
+
value_states = value_states.contiguous()
|
314 |
+
|
315 |
+
# We dispatch to SDPA's Flash Attention or Efficient kernels via this `is_causal` if statement instead of an inline conditional assignment
|
316 |
+
# in SDPA to support both torch.compile's dynamic shapes and full graph options. An inline conditional prevents dynamic shapes from compiling.
|
317 |
+
is_causal = True if causal_mask is None and q_len > 1 else False
|
318 |
+
|
319 |
+
attn_output = torch.nn.functional.scaled_dot_product_attention(
|
320 |
+
query_states,
|
321 |
+
key_states,
|
322 |
+
value_states,
|
323 |
+
attn_mask=causal_mask,
|
324 |
+
dropout_p=self.attention_dropout if self.training else 0.0,
|
325 |
+
is_causal=is_causal,
|
326 |
+
)
|
327 |
+
|
328 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
329 |
+
attn_output = attn_output.view(bsz, q_len, -1)
|
330 |
+
|
331 |
+
attn_output = self.o_u_proj(self.o_v_proj(attn_output))
|
332 |
+
|
333 |
+
return attn_output, None, past_key_value
|
334 |
+
|
335 |
+
|
336 |
+
class SVDLlamaDecoderLayer(LlamaDecoderLayer):
|
337 |
+
def __init__(self, config: SVDLlamaConfig, layer_idx: int):
|
338 |
+
super().__init__(config, layer_idx)
|
339 |
+
self.self_attn = SVDLlamaAttention(config=config, layer_idx=layer_idx)
|
340 |
+
self.mlp = SVDLlamaMLP(config)
|
341 |
+
|
342 |
+
|
343 |
+
class SVDLlamaForCausalLM(LlamaForCausalLM):
|
344 |
+
def __init__(self, config: SVDLlamaConfig):
|
345 |
+
super().__init__(config)
|
346 |
+
self.model = LlamaModel(config)
|
347 |
+
self.model.layers = nn.ModuleList(
|
348 |
+
[SVDLlamaDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
|
349 |
+
)
|
350 |
+
self.model._no_split_modules = ["SVDLlamaDecoderLayer"]
|
351 |
+
self._no_split_modules = ["SVDLlamaDecoderLayer"]
|
352 |
+
self.vocab_size = config.vocab_size
|
353 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
354 |
+
|
355 |
+
# Initialize weights and apply final processing
|
356 |
+
self.post_init()
|