Upload SVD_LlamaForCausalLM
Browse files- config.json +33 -0
- config_llama.py +88 -0
- generation_config.json +7 -0
- model-00001-of-00002.safetensors +3 -0
- model-00002-of-00002.safetensors +3 -0
- model.safetensors.index.json +554 -0
- modeling_svd_llama.py +221 -0
config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "huggingface_repos/llama-7b-hf-svdllm-40",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"SVD_LlamaForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"auto_map": {
|
| 8 |
+
"AutoConfig": "config_llama.SVD_LlamaConfig",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_svd_llama.SVD_LlamaForCausalLM"
|
| 10 |
+
},
|
| 11 |
+
"bos_token_id": 1,
|
| 12 |
+
"eos_token_id": 2,
|
| 13 |
+
"hidden_act": "silu",
|
| 14 |
+
"hidden_size": 4096,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 11008,
|
| 17 |
+
"max_position_embeddings": 2048,
|
| 18 |
+
"model_type": "llama",
|
| 19 |
+
"num_attention_heads": 32,
|
| 20 |
+
"num_hidden_layers": 32,
|
| 21 |
+
"num_key_value_heads": 32,
|
| 22 |
+
"pad_token_id": 0,
|
| 23 |
+
"pretraining_tp": 1,
|
| 24 |
+
"ratio": 0.4,
|
| 25 |
+
"rms_norm_eps": 1e-06,
|
| 26 |
+
"rope_scaling": null,
|
| 27 |
+
"rope_theta": 10000.0,
|
| 28 |
+
"tie_word_embeddings": false,
|
| 29 |
+
"torch_dtype": "float16",
|
| 30 |
+
"transformers_version": "4.35.2",
|
| 31 |
+
"use_cache": true,
|
| 32 |
+
"vocab_size": 32000
|
| 33 |
+
}
|
config_llama.py
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 2 |
+
from transformers.utils import logging
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
logger = logging.get_logger(__name__)
|
| 6 |
+
|
| 7 |
+
LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class SVD_LlamaConfig(PretrainedConfig):
|
| 11 |
+
model_type = "llama"
|
| 12 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 13 |
+
|
| 14 |
+
def __init__(
|
| 15 |
+
self,
|
| 16 |
+
vocab_size=32000,
|
| 17 |
+
hidden_size=4096,
|
| 18 |
+
intermediate_size=11008,
|
| 19 |
+
num_hidden_layers=32,
|
| 20 |
+
num_attention_heads=32,
|
| 21 |
+
num_key_value_heads=None,
|
| 22 |
+
hidden_act="silu",
|
| 23 |
+
max_position_embeddings=2048,
|
| 24 |
+
initializer_range=0.02,
|
| 25 |
+
rms_norm_eps=1e-6,
|
| 26 |
+
use_cache=True,
|
| 27 |
+
pad_token_id=None,
|
| 28 |
+
bos_token_id=1,
|
| 29 |
+
eos_token_id=2,
|
| 30 |
+
pretraining_tp=1,
|
| 31 |
+
tie_word_embeddings=False,
|
| 32 |
+
rope_theta=10000.0,
|
| 33 |
+
rope_scaling=None,
|
| 34 |
+
attention_bias=False,
|
| 35 |
+
ratio=1,
|
| 36 |
+
**kwargs,
|
| 37 |
+
):
|
| 38 |
+
self.vocab_size = vocab_size
|
| 39 |
+
self.max_position_embeddings = max_position_embeddings
|
| 40 |
+
self.hidden_size = hidden_size
|
| 41 |
+
self.intermediate_size = intermediate_size
|
| 42 |
+
self.num_hidden_layers = num_hidden_layers
|
| 43 |
+
self.num_attention_heads = num_attention_heads
|
| 44 |
+
|
| 45 |
+
# for backward compatibility
|
| 46 |
+
if num_key_value_heads is None:
|
| 47 |
+
num_key_value_heads = num_attention_heads
|
| 48 |
+
|
| 49 |
+
self.num_key_value_heads = num_key_value_heads
|
| 50 |
+
self.hidden_act = hidden_act
|
| 51 |
+
self.initializer_range = initializer_range
|
| 52 |
+
self.rms_norm_eps = rms_norm_eps
|
| 53 |
+
self.pretraining_tp = pretraining_tp
|
| 54 |
+
self.use_cache = use_cache
|
| 55 |
+
self.rope_theta = rope_theta
|
| 56 |
+
self.rope_scaling = rope_scaling
|
| 57 |
+
self._rope_scaling_validation()
|
| 58 |
+
self.attention_bias = attention_bias
|
| 59 |
+
self.ratio = ratio
|
| 60 |
+
|
| 61 |
+
super().__init__(
|
| 62 |
+
pad_token_id=pad_token_id,
|
| 63 |
+
bos_token_id=bos_token_id,
|
| 64 |
+
eos_token_id=eos_token_id,
|
| 65 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 66 |
+
**kwargs,
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
def _rope_scaling_validation(self):
|
| 70 |
+
"""
|
| 71 |
+
Validate the `rope_scaling` configuration.
|
| 72 |
+
"""
|
| 73 |
+
if self.rope_scaling is None:
|
| 74 |
+
return
|
| 75 |
+
|
| 76 |
+
if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
|
| 77 |
+
raise ValueError(
|
| 78 |
+
"`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, "
|
| 79 |
+
f"got {self.rope_scaling}"
|
| 80 |
+
)
|
| 81 |
+
rope_scaling_type = self.rope_scaling.get("type", None)
|
| 82 |
+
rope_scaling_factor = self.rope_scaling.get("factor", None)
|
| 83 |
+
if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
|
| 84 |
+
raise ValueError(
|
| 85 |
+
f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
|
| 86 |
+
)
|
| 87 |
+
if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
|
| 88 |
+
raise ValueError(f"`rope_scaling`'s factor field must be a float > 1, got {rope_scaling_factor}")
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.35.2"
|
| 7 |
+
}
|
model-00001-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25cf467a2a346b6b93762b80d27bf43c1c1296c397b5ce3c031ae084bfabbda5
|
| 3 |
+
size 4997431984
|
model-00002-of-00002.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:989d874988fd5533e12bcb79d2380b0b2ff6f78642e4808c424153252b70630f
|
| 3 |
+
size 707589080
|
model.safetensors.index.json
ADDED
|
@@ -0,0 +1,554 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_size": 5704957952
|
| 4 |
+
},
|
| 5 |
+
"weight_map": {
|
| 6 |
+
"lm_head.weight": "model-00002-of-00002.safetensors",
|
| 7 |
+
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
|
| 8 |
+
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 9 |
+
"model.layers.0.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 10 |
+
"model.layers.0.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 11 |
+
"model.layers.0.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 12 |
+
"model.layers.0.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 13 |
+
"model.layers.0.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 14 |
+
"model.layers.0.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 15 |
+
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 16 |
+
"model.layers.0.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 17 |
+
"model.layers.0.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 18 |
+
"model.layers.0.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 19 |
+
"model.layers.0.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 20 |
+
"model.layers.0.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 21 |
+
"model.layers.0.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 22 |
+
"model.layers.0.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 23 |
+
"model.layers.0.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 24 |
+
"model.layers.0.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 25 |
+
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 26 |
+
"model.layers.1.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 27 |
+
"model.layers.1.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 28 |
+
"model.layers.1.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 29 |
+
"model.layers.1.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 30 |
+
"model.layers.1.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 31 |
+
"model.layers.1.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 32 |
+
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 33 |
+
"model.layers.1.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 34 |
+
"model.layers.1.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 35 |
+
"model.layers.1.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 36 |
+
"model.layers.1.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 37 |
+
"model.layers.1.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 38 |
+
"model.layers.1.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 39 |
+
"model.layers.1.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 40 |
+
"model.layers.1.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 41 |
+
"model.layers.1.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 42 |
+
"model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 43 |
+
"model.layers.10.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 44 |
+
"model.layers.10.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 45 |
+
"model.layers.10.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 46 |
+
"model.layers.10.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 47 |
+
"model.layers.10.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 48 |
+
"model.layers.10.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 49 |
+
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 50 |
+
"model.layers.10.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 51 |
+
"model.layers.10.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 52 |
+
"model.layers.10.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 53 |
+
"model.layers.10.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 54 |
+
"model.layers.10.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 55 |
+
"model.layers.10.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 56 |
+
"model.layers.10.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 57 |
+
"model.layers.10.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 58 |
+
"model.layers.10.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 59 |
+
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 60 |
+
"model.layers.11.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 61 |
+
"model.layers.11.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 62 |
+
"model.layers.11.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 63 |
+
"model.layers.11.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 64 |
+
"model.layers.11.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 65 |
+
"model.layers.11.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 66 |
+
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 67 |
+
"model.layers.11.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 68 |
+
"model.layers.11.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 69 |
+
"model.layers.11.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 70 |
+
"model.layers.11.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 71 |
+
"model.layers.11.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 72 |
+
"model.layers.11.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 73 |
+
"model.layers.11.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 74 |
+
"model.layers.11.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 75 |
+
"model.layers.11.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 76 |
+
"model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 77 |
+
"model.layers.12.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 78 |
+
"model.layers.12.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 79 |
+
"model.layers.12.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 80 |
+
"model.layers.12.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 81 |
+
"model.layers.12.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 82 |
+
"model.layers.12.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 83 |
+
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 84 |
+
"model.layers.12.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 85 |
+
"model.layers.12.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 86 |
+
"model.layers.12.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 87 |
+
"model.layers.12.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 88 |
+
"model.layers.12.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 89 |
+
"model.layers.12.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 90 |
+
"model.layers.12.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 91 |
+
"model.layers.12.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 92 |
+
"model.layers.12.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 93 |
+
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 94 |
+
"model.layers.13.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 95 |
+
"model.layers.13.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 96 |
+
"model.layers.13.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 97 |
+
"model.layers.13.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 98 |
+
"model.layers.13.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 99 |
+
"model.layers.13.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 100 |
+
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 101 |
+
"model.layers.13.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 102 |
+
"model.layers.13.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 103 |
+
"model.layers.13.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 104 |
+
"model.layers.13.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 105 |
+
"model.layers.13.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 106 |
+
"model.layers.13.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 107 |
+
"model.layers.13.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 108 |
+
"model.layers.13.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 109 |
+
"model.layers.13.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 110 |
+
"model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 111 |
+
"model.layers.14.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 112 |
+
"model.layers.14.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 113 |
+
"model.layers.14.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 114 |
+
"model.layers.14.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 115 |
+
"model.layers.14.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 116 |
+
"model.layers.14.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 117 |
+
"model.layers.14.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 118 |
+
"model.layers.14.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 119 |
+
"model.layers.14.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 120 |
+
"model.layers.14.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 121 |
+
"model.layers.14.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 122 |
+
"model.layers.14.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 123 |
+
"model.layers.14.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 124 |
+
"model.layers.14.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 125 |
+
"model.layers.14.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 126 |
+
"model.layers.14.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 127 |
+
"model.layers.15.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 128 |
+
"model.layers.15.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 129 |
+
"model.layers.15.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 130 |
+
"model.layers.15.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 131 |
+
"model.layers.15.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 132 |
+
"model.layers.15.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 133 |
+
"model.layers.15.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 134 |
+
"model.layers.15.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 135 |
+
"model.layers.15.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 136 |
+
"model.layers.15.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 137 |
+
"model.layers.15.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 138 |
+
"model.layers.15.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 139 |
+
"model.layers.15.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 140 |
+
"model.layers.15.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 141 |
+
"model.layers.15.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 142 |
+
"model.layers.15.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 143 |
+
"model.layers.15.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 144 |
+
"model.layers.16.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 145 |
+
"model.layers.16.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 146 |
+
"model.layers.16.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 147 |
+
"model.layers.16.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 148 |
+
"model.layers.16.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 149 |
+
"model.layers.16.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 150 |
+
"model.layers.16.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 151 |
+
"model.layers.16.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 152 |
+
"model.layers.16.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 153 |
+
"model.layers.16.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 154 |
+
"model.layers.16.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 155 |
+
"model.layers.16.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 156 |
+
"model.layers.16.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 157 |
+
"model.layers.16.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 158 |
+
"model.layers.16.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 159 |
+
"model.layers.16.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 160 |
+
"model.layers.16.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 161 |
+
"model.layers.17.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 162 |
+
"model.layers.17.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 163 |
+
"model.layers.17.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 164 |
+
"model.layers.17.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 165 |
+
"model.layers.17.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 166 |
+
"model.layers.17.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 167 |
+
"model.layers.17.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 168 |
+
"model.layers.17.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 169 |
+
"model.layers.17.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 170 |
+
"model.layers.17.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 171 |
+
"model.layers.17.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 172 |
+
"model.layers.17.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 173 |
+
"model.layers.17.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 174 |
+
"model.layers.17.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 175 |
+
"model.layers.17.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 176 |
+
"model.layers.17.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 177 |
+
"model.layers.17.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 178 |
+
"model.layers.18.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 179 |
+
"model.layers.18.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 180 |
+
"model.layers.18.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 181 |
+
"model.layers.18.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 182 |
+
"model.layers.18.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 183 |
+
"model.layers.18.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 184 |
+
"model.layers.18.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 185 |
+
"model.layers.18.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 186 |
+
"model.layers.18.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 187 |
+
"model.layers.18.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 188 |
+
"model.layers.18.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 189 |
+
"model.layers.18.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 190 |
+
"model.layers.18.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 191 |
+
"model.layers.18.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 192 |
+
"model.layers.18.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 193 |
+
"model.layers.18.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 194 |
+
"model.layers.18.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 195 |
+
"model.layers.19.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 196 |
+
"model.layers.19.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 197 |
+
"model.layers.19.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 198 |
+
"model.layers.19.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 199 |
+
"model.layers.19.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 200 |
+
"model.layers.19.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 201 |
+
"model.layers.19.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 202 |
+
"model.layers.19.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 203 |
+
"model.layers.19.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 204 |
+
"model.layers.19.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 205 |
+
"model.layers.19.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 206 |
+
"model.layers.19.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 207 |
+
"model.layers.19.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 208 |
+
"model.layers.19.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 209 |
+
"model.layers.19.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 210 |
+
"model.layers.19.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 211 |
+
"model.layers.19.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 212 |
+
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 213 |
+
"model.layers.2.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 214 |
+
"model.layers.2.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 215 |
+
"model.layers.2.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 216 |
+
"model.layers.2.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 217 |
+
"model.layers.2.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 218 |
+
"model.layers.2.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 219 |
+
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 220 |
+
"model.layers.2.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 221 |
+
"model.layers.2.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 222 |
+
"model.layers.2.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 223 |
+
"model.layers.2.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 224 |
+
"model.layers.2.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 225 |
+
"model.layers.2.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 226 |
+
"model.layers.2.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 227 |
+
"model.layers.2.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 228 |
+
"model.layers.2.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 229 |
+
"model.layers.20.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 230 |
+
"model.layers.20.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 231 |
+
"model.layers.20.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 232 |
+
"model.layers.20.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 233 |
+
"model.layers.20.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 234 |
+
"model.layers.20.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 235 |
+
"model.layers.20.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 236 |
+
"model.layers.20.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 237 |
+
"model.layers.20.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 238 |
+
"model.layers.20.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 239 |
+
"model.layers.20.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 240 |
+
"model.layers.20.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 241 |
+
"model.layers.20.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 242 |
+
"model.layers.20.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 243 |
+
"model.layers.20.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 244 |
+
"model.layers.20.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 245 |
+
"model.layers.20.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 246 |
+
"model.layers.21.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 247 |
+
"model.layers.21.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 248 |
+
"model.layers.21.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 249 |
+
"model.layers.21.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 250 |
+
"model.layers.21.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 251 |
+
"model.layers.21.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 252 |
+
"model.layers.21.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 253 |
+
"model.layers.21.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 254 |
+
"model.layers.21.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 255 |
+
"model.layers.21.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 256 |
+
"model.layers.21.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 257 |
+
"model.layers.21.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 258 |
+
"model.layers.21.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 259 |
+
"model.layers.21.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 260 |
+
"model.layers.21.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 261 |
+
"model.layers.21.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 262 |
+
"model.layers.21.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 263 |
+
"model.layers.22.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 264 |
+
"model.layers.22.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 265 |
+
"model.layers.22.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 266 |
+
"model.layers.22.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 267 |
+
"model.layers.22.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 268 |
+
"model.layers.22.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 269 |
+
"model.layers.22.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 270 |
+
"model.layers.22.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 271 |
+
"model.layers.22.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 272 |
+
"model.layers.22.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 273 |
+
"model.layers.22.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 274 |
+
"model.layers.22.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 275 |
+
"model.layers.22.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 276 |
+
"model.layers.22.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 277 |
+
"model.layers.22.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 278 |
+
"model.layers.22.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 279 |
+
"model.layers.22.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 280 |
+
"model.layers.23.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 281 |
+
"model.layers.23.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 282 |
+
"model.layers.23.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 283 |
+
"model.layers.23.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 284 |
+
"model.layers.23.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 285 |
+
"model.layers.23.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 286 |
+
"model.layers.23.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 287 |
+
"model.layers.23.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 288 |
+
"model.layers.23.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 289 |
+
"model.layers.23.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 290 |
+
"model.layers.23.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 291 |
+
"model.layers.23.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 292 |
+
"model.layers.23.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 293 |
+
"model.layers.23.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 294 |
+
"model.layers.23.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 295 |
+
"model.layers.23.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 296 |
+
"model.layers.23.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 297 |
+
"model.layers.24.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 298 |
+
"model.layers.24.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 299 |
+
"model.layers.24.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 300 |
+
"model.layers.24.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 301 |
+
"model.layers.24.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 302 |
+
"model.layers.24.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 303 |
+
"model.layers.24.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 304 |
+
"model.layers.24.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 305 |
+
"model.layers.24.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 306 |
+
"model.layers.24.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 307 |
+
"model.layers.24.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 308 |
+
"model.layers.24.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 309 |
+
"model.layers.24.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 310 |
+
"model.layers.24.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 311 |
+
"model.layers.24.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 312 |
+
"model.layers.24.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 313 |
+
"model.layers.24.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 314 |
+
"model.layers.25.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 315 |
+
"model.layers.25.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 316 |
+
"model.layers.25.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 317 |
+
"model.layers.25.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 318 |
+
"model.layers.25.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 319 |
+
"model.layers.25.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 320 |
+
"model.layers.25.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 321 |
+
"model.layers.25.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 322 |
+
"model.layers.25.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 323 |
+
"model.layers.25.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 324 |
+
"model.layers.25.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 325 |
+
"model.layers.25.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 326 |
+
"model.layers.25.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 327 |
+
"model.layers.25.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 328 |
+
"model.layers.25.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 329 |
+
"model.layers.25.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 330 |
+
"model.layers.25.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 331 |
+
"model.layers.26.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 332 |
+
"model.layers.26.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 333 |
+
"model.layers.26.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 334 |
+
"model.layers.26.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 335 |
+
"model.layers.26.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 336 |
+
"model.layers.26.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 337 |
+
"model.layers.26.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 338 |
+
"model.layers.26.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 339 |
+
"model.layers.26.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 340 |
+
"model.layers.26.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 341 |
+
"model.layers.26.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 342 |
+
"model.layers.26.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 343 |
+
"model.layers.26.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 344 |
+
"model.layers.26.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 345 |
+
"model.layers.26.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 346 |
+
"model.layers.26.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 347 |
+
"model.layers.26.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 348 |
+
"model.layers.27.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 349 |
+
"model.layers.27.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 350 |
+
"model.layers.27.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 351 |
+
"model.layers.27.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 352 |
+
"model.layers.27.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 353 |
+
"model.layers.27.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 354 |
+
"model.layers.27.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 355 |
+
"model.layers.27.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 356 |
+
"model.layers.27.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 357 |
+
"model.layers.27.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 358 |
+
"model.layers.27.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 359 |
+
"model.layers.27.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 360 |
+
"model.layers.27.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 361 |
+
"model.layers.27.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 362 |
+
"model.layers.27.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 363 |
+
"model.layers.27.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 364 |
+
"model.layers.27.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 365 |
+
"model.layers.28.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 366 |
+
"model.layers.28.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 367 |
+
"model.layers.28.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 368 |
+
"model.layers.28.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 369 |
+
"model.layers.28.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 370 |
+
"model.layers.28.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 371 |
+
"model.layers.28.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 372 |
+
"model.layers.28.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 373 |
+
"model.layers.28.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 374 |
+
"model.layers.28.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 375 |
+
"model.layers.28.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 376 |
+
"model.layers.28.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 377 |
+
"model.layers.28.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 378 |
+
"model.layers.28.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 379 |
+
"model.layers.28.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 380 |
+
"model.layers.28.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 381 |
+
"model.layers.28.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 382 |
+
"model.layers.29.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 383 |
+
"model.layers.29.mlp.down_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 384 |
+
"model.layers.29.mlp.down_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 385 |
+
"model.layers.29.mlp.gate_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 386 |
+
"model.layers.29.mlp.gate_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 387 |
+
"model.layers.29.mlp.up_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 388 |
+
"model.layers.29.mlp.up_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 389 |
+
"model.layers.29.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 390 |
+
"model.layers.29.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 391 |
+
"model.layers.29.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 392 |
+
"model.layers.29.self_attn.o_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 393 |
+
"model.layers.29.self_attn.o_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 394 |
+
"model.layers.29.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 395 |
+
"model.layers.29.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 396 |
+
"model.layers.29.self_attn.rotary_emb.inv_freq": "model-00002-of-00002.safetensors",
|
| 397 |
+
"model.layers.29.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 398 |
+
"model.layers.29.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 399 |
+
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 400 |
+
"model.layers.3.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 401 |
+
"model.layers.3.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 402 |
+
"model.layers.3.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 403 |
+
"model.layers.3.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 404 |
+
"model.layers.3.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 405 |
+
"model.layers.3.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 406 |
+
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 407 |
+
"model.layers.3.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 408 |
+
"model.layers.3.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 409 |
+
"model.layers.3.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 410 |
+
"model.layers.3.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 411 |
+
"model.layers.3.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 412 |
+
"model.layers.3.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 413 |
+
"model.layers.3.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 414 |
+
"model.layers.3.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 415 |
+
"model.layers.3.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 416 |
+
"model.layers.30.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 417 |
+
"model.layers.30.mlp.down_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 418 |
+
"model.layers.30.mlp.down_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 419 |
+
"model.layers.30.mlp.gate_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 420 |
+
"model.layers.30.mlp.gate_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 421 |
+
"model.layers.30.mlp.up_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 422 |
+
"model.layers.30.mlp.up_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 423 |
+
"model.layers.30.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 424 |
+
"model.layers.30.self_attn.k_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 425 |
+
"model.layers.30.self_attn.k_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 426 |
+
"model.layers.30.self_attn.o_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 427 |
+
"model.layers.30.self_attn.o_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 428 |
+
"model.layers.30.self_attn.q_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 429 |
+
"model.layers.30.self_attn.q_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 430 |
+
"model.layers.30.self_attn.rotary_emb.inv_freq": "model-00002-of-00002.safetensors",
|
| 431 |
+
"model.layers.30.self_attn.v_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 432 |
+
"model.layers.30.self_attn.v_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 433 |
+
"model.layers.31.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 434 |
+
"model.layers.31.mlp.down_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 435 |
+
"model.layers.31.mlp.down_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 436 |
+
"model.layers.31.mlp.gate_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 437 |
+
"model.layers.31.mlp.gate_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 438 |
+
"model.layers.31.mlp.up_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 439 |
+
"model.layers.31.mlp.up_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 440 |
+
"model.layers.31.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
| 441 |
+
"model.layers.31.self_attn.k_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 442 |
+
"model.layers.31.self_attn.k_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 443 |
+
"model.layers.31.self_attn.o_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 444 |
+
"model.layers.31.self_attn.o_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 445 |
+
"model.layers.31.self_attn.q_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 446 |
+
"model.layers.31.self_attn.q_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 447 |
+
"model.layers.31.self_attn.rotary_emb.inv_freq": "model-00002-of-00002.safetensors",
|
| 448 |
+
"model.layers.31.self_attn.v_u_proj.weight": "model-00002-of-00002.safetensors",
|
| 449 |
+
"model.layers.31.self_attn.v_v_proj.weight": "model-00002-of-00002.safetensors",
|
| 450 |
+
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 451 |
+
"model.layers.4.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 452 |
+
"model.layers.4.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 453 |
+
"model.layers.4.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 454 |
+
"model.layers.4.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 455 |
+
"model.layers.4.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 456 |
+
"model.layers.4.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 457 |
+
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 458 |
+
"model.layers.4.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 459 |
+
"model.layers.4.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 460 |
+
"model.layers.4.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 461 |
+
"model.layers.4.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 462 |
+
"model.layers.4.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 463 |
+
"model.layers.4.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 464 |
+
"model.layers.4.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 465 |
+
"model.layers.4.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 466 |
+
"model.layers.4.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 467 |
+
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 468 |
+
"model.layers.5.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 469 |
+
"model.layers.5.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 470 |
+
"model.layers.5.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 471 |
+
"model.layers.5.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 472 |
+
"model.layers.5.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 473 |
+
"model.layers.5.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 474 |
+
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 475 |
+
"model.layers.5.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 476 |
+
"model.layers.5.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 477 |
+
"model.layers.5.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 478 |
+
"model.layers.5.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 479 |
+
"model.layers.5.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 480 |
+
"model.layers.5.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 481 |
+
"model.layers.5.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 482 |
+
"model.layers.5.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 483 |
+
"model.layers.5.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 484 |
+
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 485 |
+
"model.layers.6.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 486 |
+
"model.layers.6.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 487 |
+
"model.layers.6.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 488 |
+
"model.layers.6.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 489 |
+
"model.layers.6.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 490 |
+
"model.layers.6.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 491 |
+
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 492 |
+
"model.layers.6.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 493 |
+
"model.layers.6.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 494 |
+
"model.layers.6.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 495 |
+
"model.layers.6.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 496 |
+
"model.layers.6.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 497 |
+
"model.layers.6.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 498 |
+
"model.layers.6.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 499 |
+
"model.layers.6.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 500 |
+
"model.layers.6.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 501 |
+
"model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 502 |
+
"model.layers.7.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 503 |
+
"model.layers.7.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 504 |
+
"model.layers.7.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 505 |
+
"model.layers.7.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 506 |
+
"model.layers.7.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 507 |
+
"model.layers.7.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 508 |
+
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 509 |
+
"model.layers.7.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 510 |
+
"model.layers.7.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 511 |
+
"model.layers.7.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 512 |
+
"model.layers.7.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 513 |
+
"model.layers.7.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 514 |
+
"model.layers.7.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 515 |
+
"model.layers.7.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 516 |
+
"model.layers.7.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 517 |
+
"model.layers.7.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 518 |
+
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 519 |
+
"model.layers.8.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 520 |
+
"model.layers.8.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 521 |
+
"model.layers.8.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 522 |
+
"model.layers.8.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 523 |
+
"model.layers.8.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 524 |
+
"model.layers.8.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 525 |
+
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 526 |
+
"model.layers.8.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 527 |
+
"model.layers.8.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 528 |
+
"model.layers.8.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 529 |
+
"model.layers.8.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 530 |
+
"model.layers.8.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 531 |
+
"model.layers.8.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 532 |
+
"model.layers.8.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 533 |
+
"model.layers.8.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 534 |
+
"model.layers.8.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 535 |
+
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 536 |
+
"model.layers.9.mlp.down_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 537 |
+
"model.layers.9.mlp.down_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 538 |
+
"model.layers.9.mlp.gate_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 539 |
+
"model.layers.9.mlp.gate_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 540 |
+
"model.layers.9.mlp.up_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 541 |
+
"model.layers.9.mlp.up_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 542 |
+
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
| 543 |
+
"model.layers.9.self_attn.k_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 544 |
+
"model.layers.9.self_attn.k_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 545 |
+
"model.layers.9.self_attn.o_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 546 |
+
"model.layers.9.self_attn.o_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 547 |
+
"model.layers.9.self_attn.q_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 548 |
+
"model.layers.9.self_attn.q_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 549 |
+
"model.layers.9.self_attn.rotary_emb.inv_freq": "model-00001-of-00002.safetensors",
|
| 550 |
+
"model.layers.9.self_attn.v_u_proj.weight": "model-00001-of-00002.safetensors",
|
| 551 |
+
"model.layers.9.self_attn.v_v_proj.weight": "model-00001-of-00002.safetensors",
|
| 552 |
+
"model.norm.weight": "model-00002-of-00002.safetensors"
|
| 553 |
+
}
|
| 554 |
+
}
|
modeling_svd_llama.py
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import math
|
| 2 |
+
from typing import Optional, Tuple
|
| 3 |
+
|
| 4 |
+
import torch
|
| 5 |
+
import torch.utils.checkpoint
|
| 6 |
+
from torch import nn
|
| 7 |
+
|
| 8 |
+
from transformers.activations import ACT2FN
|
| 9 |
+
from transformers.utils import logging
|
| 10 |
+
from transformers import LlamaForCausalLM
|
| 11 |
+
from .config_llama import SVD_LlamaConfig
|
| 12 |
+
|
| 13 |
+
logger = logging.get_logger(__name__)
|
| 14 |
+
|
| 15 |
+
_CONFIG_FOR_DOC = "SVD_LlamaConfig"
|
| 16 |
+
|
| 17 |
+
class LlamaRMSNorm(nn.Module):
|
| 18 |
+
def __init__(self, hidden_size, eps=1e-6):
|
| 19 |
+
"""
|
| 20 |
+
LlamaRMSNorm is equivalent to T5LayerNorm
|
| 21 |
+
"""
|
| 22 |
+
super().__init__()
|
| 23 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
| 24 |
+
self.variance_epsilon = eps
|
| 25 |
+
|
| 26 |
+
def forward(self, hidden_states):
|
| 27 |
+
variance = hidden_states.to(torch.float32).pow(2).mean(-1, keepdim=True)
|
| 28 |
+
hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
|
| 29 |
+
|
| 30 |
+
# convert into half-precision if necessary
|
| 31 |
+
if self.weight.dtype in [torch.float16, torch.bfloat16]:
|
| 32 |
+
hidden_states = hidden_states.to(self.weight.dtype)
|
| 33 |
+
|
| 34 |
+
return self.weight * hidden_states
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class LlamaRotaryEmbedding(torch.nn.Module):
|
| 38 |
+
def __init__(self, dim, max_position_embeddings=2048, base=10000, device=None):
|
| 39 |
+
super().__init__()
|
| 40 |
+
inv_freq = 1.0 / (base ** (torch.arange(0, dim, 2).float().to(device) / dim))
|
| 41 |
+
self.register_buffer("inv_freq", inv_freq)
|
| 42 |
+
|
| 43 |
+
# Build here to make `torch.jit.trace` work.
|
| 44 |
+
self.max_seq_len_cached = max_position_embeddings
|
| 45 |
+
t = torch.arange(self.max_seq_len_cached, device=self.inv_freq.device, dtype=self.inv_freq.dtype)
|
| 46 |
+
freqs = torch.einsum("i,j->ij", t, self.inv_freq)
|
| 47 |
+
# Different from paper, but it uses a different permutation in order to obtain the same calculation
|
| 48 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 49 |
+
self.register_buffer("cos_cached", emb.cos()[None, None, :, :], persistent=False)
|
| 50 |
+
self.register_buffer("sin_cached", emb.sin()[None, None, :, :], persistent=False)
|
| 51 |
+
|
| 52 |
+
def forward(self, x, seq_len=None):
|
| 53 |
+
# x: [bs, num_attention_heads, seq_len, head_size]
|
| 54 |
+
# This `if` block is unlikely to be run after we build sin/cos in `__init__`. Keep the logic here just in case.
|
| 55 |
+
if seq_len > self.max_seq_len_cached:
|
| 56 |
+
self.max_seq_len_cached = seq_len
|
| 57 |
+
t = torch.arange(self.max_seq_len_cached, device=x.device, dtype=self.inv_freq.dtype)
|
| 58 |
+
freqs = torch.einsum("i,j->ij", t, self.inv_freq)
|
| 59 |
+
# Different from paper, but it uses a different permutation in order to obtain the same calculation
|
| 60 |
+
emb = torch.cat((freqs, freqs), dim=-1).to(x.device)
|
| 61 |
+
self.register_buffer("cos_cached", emb.cos()[None, None, :, :], persistent=False)
|
| 62 |
+
self.register_buffer("sin_cached", emb.sin()[None, None, :, :], persistent=False)
|
| 63 |
+
return (
|
| 64 |
+
self.cos_cached[:, :, :seq_len, ...].to(dtype=x.dtype),
|
| 65 |
+
self.sin_cached[:, :, :seq_len, ...].to(dtype=x.dtype),
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
def rotate_half(x):
|
| 70 |
+
"""Rotates half the hidden dims of the input."""
|
| 71 |
+
x1 = x[..., : x.shape[-1] // 2]
|
| 72 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
| 73 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids):
|
| 77 |
+
gather_indices = position_ids[:, None, :, None] # [bs, 1, seq_len, 1]
|
| 78 |
+
gather_indices = gather_indices.repeat(1, cos.shape[1], 1, cos.shape[3])
|
| 79 |
+
cos = torch.gather(cos.repeat(gather_indices.shape[0], 1, 1, 1), 2, gather_indices)
|
| 80 |
+
sin = torch.gather(sin.repeat(gather_indices.shape[0], 1, 1, 1), 2, gather_indices)
|
| 81 |
+
|
| 82 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
| 83 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
| 84 |
+
return q_embed, k_embed
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
class SVD_LlamaMLP(nn.Module):
|
| 88 |
+
def __init__(
|
| 89 |
+
self,
|
| 90 |
+
config: SVD_LlamaConfig
|
| 91 |
+
):
|
| 92 |
+
super().__init__()
|
| 93 |
+
self.ratio = config.ratio
|
| 94 |
+
low_rank = int(config.intermediate_size * config.hidden_size * self.ratio / (config.intermediate_size + config.hidden_size))
|
| 95 |
+
self.gate_u_proj = nn.Linear(low_rank, config.intermediate_size, bias=False)
|
| 96 |
+
self.gate_v_proj = nn.Linear(config.hidden_size, low_rank, bias=False)
|
| 97 |
+
|
| 98 |
+
self.down_u_proj = nn.Linear(low_rank, config.hidden_size, bias=False)
|
| 99 |
+
self.down_v_proj = nn.Linear(config.intermediate_size, low_rank, bias=False)
|
| 100 |
+
|
| 101 |
+
self.up_u_proj = nn.Linear(low_rank, config.intermediate_size, bias=False)
|
| 102 |
+
self.up_v_proj = nn.Linear(config.hidden_size, low_rank, bias=False)
|
| 103 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
| 104 |
+
|
| 105 |
+
def forward(self, x):
|
| 106 |
+
up = self.up_u_proj(self.up_v_proj(x))
|
| 107 |
+
gate = self.gate_u_proj(self.gate_v_proj(x))
|
| 108 |
+
return self.down_u_proj(self.down_v_proj(self.act_fn(gate) * up))
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
class SVD_LlamaAttention(nn.Module):
|
| 112 |
+
"""Multi-headed attention from 'Attention Is All You Need' paper"""
|
| 113 |
+
|
| 114 |
+
def __init__(self, config: SVD_LlamaConfig):
|
| 115 |
+
super().__init__()
|
| 116 |
+
self.config = config
|
| 117 |
+
self.hidden_size = config.hidden_size
|
| 118 |
+
self.num_heads = config.num_attention_heads
|
| 119 |
+
self.head_dim = self.hidden_size // self.num_heads
|
| 120 |
+
self.max_position_embeddings = config.max_position_embeddings
|
| 121 |
+
self.ratio = config.ratio # 1 means no truncate, just keep normal attn
|
| 122 |
+
|
| 123 |
+
if (self.head_dim * self.num_heads) != self.hidden_size:
|
| 124 |
+
raise ValueError(
|
| 125 |
+
f"hidden_size must be divisible by num_heads (got `hidden_size`: {self.hidden_size}"
|
| 126 |
+
f" and `num_heads`: {self.num_heads})."
|
| 127 |
+
)
|
| 128 |
+
low_rank = int(self.hidden_size * self.ratio/2)
|
| 129 |
+
self.q_u_proj = nn.Linear(low_rank, self.num_heads * self.head_dim, bias=False)
|
| 130 |
+
self.q_v_proj = nn.Linear(self.hidden_size, low_rank, bias=False)
|
| 131 |
+
|
| 132 |
+
self.k_u_proj = nn.Linear(low_rank, self.num_heads * self.head_dim, bias=False)
|
| 133 |
+
self.k_v_proj = nn.Linear(self.hidden_size, low_rank, bias=False)
|
| 134 |
+
|
| 135 |
+
self.v_u_proj = nn.Linear(low_rank, self.num_heads * self.head_dim, bias=False)
|
| 136 |
+
self.v_v_proj = nn.Linear(self.hidden_size, low_rank, bias=False)
|
| 137 |
+
|
| 138 |
+
self.o_u_proj = nn.Linear(low_rank, self.hidden_size, bias=False)
|
| 139 |
+
self.o_v_proj = nn.Linear(self.num_heads * self.head_dim, low_rank, bias=False)
|
| 140 |
+
|
| 141 |
+
self.rotary_emb = LlamaRotaryEmbedding(self.head_dim, max_position_embeddings=self.max_position_embeddings)
|
| 142 |
+
|
| 143 |
+
def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
|
| 144 |
+
return tensor.view(bsz, seq_len, self.num_heads, self.head_dim).transpose(1, 2).contiguous()
|
| 145 |
+
|
| 146 |
+
def forward(
|
| 147 |
+
self,
|
| 148 |
+
hidden_states: torch.Tensor,
|
| 149 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 150 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 151 |
+
past_key_value: Optional[Tuple[torch.Tensor]] = None,
|
| 152 |
+
output_attentions: bool = False,
|
| 153 |
+
use_cache: bool = False,
|
| 154 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
|
| 155 |
+
bsz, q_len, _ = hidden_states.size()
|
| 156 |
+
|
| 157 |
+
query_states = self.q_u_proj(self.q_v_proj(hidden_states)).view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
| 158 |
+
|
| 159 |
+
key_states = self.k_u_proj(self.k_v_proj(hidden_states)).view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
| 160 |
+
|
| 161 |
+
value_states = self.v_u_proj(self.v_v_proj(hidden_states)).view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
|
| 162 |
+
|
| 163 |
+
kv_seq_len = key_states.shape[-2]
|
| 164 |
+
if past_key_value is not None:
|
| 165 |
+
kv_seq_len += past_key_value[0].shape[-2]
|
| 166 |
+
cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
|
| 167 |
+
|
| 168 |
+
query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin, position_ids)
|
| 169 |
+
# [bsz, nh, t, hd]
|
| 170 |
+
|
| 171 |
+
if past_key_value is not None:
|
| 172 |
+
# reuse k, v, self_attention
|
| 173 |
+
key_states = torch.cat([past_key_value[0], key_states], dim=2)
|
| 174 |
+
value_states = torch.cat([past_key_value[1], value_states], dim=2)
|
| 175 |
+
|
| 176 |
+
past_key_value = (key_states, value_states) if use_cache else None
|
| 177 |
+
|
| 178 |
+
attn_weights = torch.matmul(query_states, key_states.transpose(2, 3)) / math.sqrt(self.head_dim)
|
| 179 |
+
|
| 180 |
+
if attn_weights.size() != (bsz, self.num_heads, q_len, kv_seq_len):
|
| 181 |
+
raise ValueError(
|
| 182 |
+
f"Attention weights should be of size {(bsz * self.num_heads, q_len, kv_seq_len)}, but is"
|
| 183 |
+
f" {attn_weights.size()}"
|
| 184 |
+
)
|
| 185 |
+
|
| 186 |
+
if attention_mask is not None:
|
| 187 |
+
if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
|
| 188 |
+
raise ValueError(
|
| 189 |
+
f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)}, but is {attention_mask.size()}"
|
| 190 |
+
)
|
| 191 |
+
attn_weights = attn_weights + attention_mask
|
| 192 |
+
attn_weights = torch.max(attn_weights, torch.tensor(torch.finfo(attn_weights.dtype).min, device=attn_weights.device))
|
| 193 |
+
|
| 194 |
+
# upcast attention to fp32
|
| 195 |
+
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query_states.dtype)
|
| 196 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
| 197 |
+
|
| 198 |
+
if attn_output.size() != (bsz, self.num_heads, q_len, self.head_dim):
|
| 199 |
+
raise ValueError(
|
| 200 |
+
f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.head_dim)}, but is"
|
| 201 |
+
f" {attn_output.size()}"
|
| 202 |
+
)
|
| 203 |
+
|
| 204 |
+
attn_output = attn_output.transpose(1, 2)
|
| 205 |
+
attn_output = attn_output.reshape(bsz, q_len, -1)
|
| 206 |
+
|
| 207 |
+
attn_output = self.o_u_proj(self.o_v_proj(attn_output))
|
| 208 |
+
|
| 209 |
+
if not output_attentions:
|
| 210 |
+
attn_weights = None
|
| 211 |
+
|
| 212 |
+
return attn_output, attn_weights, past_key_value
|
| 213 |
+
|
| 214 |
+
|
| 215 |
+
class SVD_LlamaForCausalLM(LlamaForCausalLM):
|
| 216 |
+
config_class = SVD_LlamaConfig
|
| 217 |
+
def __init__(self, config: SVD_LlamaConfig):
|
| 218 |
+
super().__init__(config)
|
| 219 |
+
for i in range(len(self.model.layers)):
|
| 220 |
+
self.model.layers[i].mlp = SVD_LlamaMLP(config=config)
|
| 221 |
+
self.model.layers[i].self_attn = SVD_LlamaAttention(config)
|