alfiannajih commited on
Commit
60e4354
1 Parent(s): c3a8a48

Upload model

Browse files
config.json CHANGED
@@ -1,12 +1,13 @@
1
  {
2
  "_name_or_path": "NousResearch/Hermes-3-Llama-3.1-8B",
3
  "architectures": [
4
- "LlamaForCausalLM"
5
  ],
6
  "attention_bias": false,
7
  "attention_dropout": 0.0,
8
  "auto_map": {
9
- "AutoConfig": "g_retriever_config.GRetrieverConfig"
 
10
  },
11
  "bos_id": [
12
  128000,
 
1
  {
2
  "_name_or_path": "NousResearch/Hermes-3-Llama-3.1-8B",
3
  "architectures": [
4
+ "GRetrieverModel"
5
  ],
6
  "attention_bias": false,
7
  "attention_dropout": 0.0,
8
  "auto_map": {
9
+ "AutoConfig": "g_retriever_config.GRetrieverConfig",
10
+ "AutoModelForCausalLM": "g_retriever.GRetrieverModel"
11
  },
12
  "bos_id": [
13
  128000,
g_retriever.py ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from torch import nn
3
+ import torch.nn.functional as F
4
+
5
+ from transformers import LlamaForCausalLM
6
+ from transformers.modeling_outputs import CausalLMOutputWithPast
7
+ from transformers.cache_utils import StaticCache
8
+ from transformers.models.llama.modeling_llama import _prepare_4d_causal_attention_mask_with_cache_position
9
+ from .g_retriever_config import GRetrieverConfig
10
+ from .gnn import GAT
11
+
12
+ from functools import wraps
13
+ from torch_geometric.nn.pool import global_mean_pool
14
+
15
+ class GRetrieverModel(LlamaForCausalLM):
16
+ config_class = GRetrieverConfig
17
+
18
+ def __init__(self, config):
19
+ super().__init__(config)
20
+ self.graph_encoder = GAT(
21
+ in_channels=config.gnn_in_dim,
22
+ out_channels=config.gnn_hidden_dim,
23
+ hidden_channels=config.gnn_hidden_dim,
24
+ num_layers=config.gnn_num_layers,
25
+ dropout=config.gnn_dropout,
26
+ num_heads=config.gnn_num_heads,
27
+ )
28
+
29
+ self.projector = nn.Sequential(
30
+ nn.Linear(config.gnn_hidden_dim, 2048),
31
+ nn.Sigmoid(),
32
+ nn.Linear(2048, self.get_input_embeddings().embedding_dim),
33
+ )
34
+
35
+ def encode_graphs(self, graph):
36
+ n_embeds, _ = self.graph_encoder(graph.x, graph.edge_index.long(), graph.edge_attr)
37
+
38
+ # mean pooling
39
+ g_embeds = global_mean_pool(n_embeds, graph.batch)
40
+
41
+ return g_embeds
42
+
43
+ @wraps(LlamaForCausalLM.forward)
44
+ def forward(
45
+ self,
46
+ input_ids=None,
47
+ graph=None,
48
+ attention_mask=None,
49
+ position_ids=None,
50
+ past_key_values=None,
51
+ inputs_embeds=None,
52
+ labels=None,
53
+ use_cache=None,
54
+ output_attentions=None,
55
+ output_hidden_states=None,
56
+ return_dict=None,
57
+ cache_position=None
58
+ ):
59
+ inputs = input_ids.clone()
60
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
61
+ output_hidden_states = (
62
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
63
+ )
64
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
65
+
66
+ if inputs.shape != torch.Size([1, 1]):
67
+ # embed bos prompt
68
+ bos_embeds = self.get_input_embeddings()(torch.tensor(self.config.bos_id))
69
+
70
+ # encode graph
71
+ graph_embeds = self.encode_graphs(graph)
72
+ graph_embeds = self.projector(graph_embeds)
73
+
74
+ # prepare for reserved ids (bos+graph)
75
+ non_tokenized_ids = (inputs == -1).nonzero()
76
+ non_tokenized_shape = non_tokenized_ids[:, 0], non_tokenized_ids[:, 1]
77
+
78
+ # embed inputs
79
+ inputs[non_tokenized_shape] = self.config.pad_token_id
80
+ inputs_embeds = self.get_input_embeddings()(inputs)
81
+ non_tokenized_embeds = torch.cat([bos_embeds.repeat(len(inputs), 1, 1), graph_embeds.unsqueeze(1)], dim=1)
82
+
83
+ # replace reserved ids with bos+graph
84
+ inputs_embeds[non_tokenized_shape] = non_tokenized_embeds.view(len(non_tokenized_ids), -1)
85
+
86
+ else:
87
+ inputs_embeds = self.get_input_embeddings()(inputs)
88
+
89
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
90
+ outputs = self.model(
91
+ attention_mask=attention_mask,
92
+ position_ids=position_ids,
93
+ past_key_values=past_key_values,
94
+ inputs_embeds=inputs_embeds,
95
+ use_cache=use_cache,
96
+ output_attentions=output_attentions,
97
+ output_hidden_states=output_hidden_states,
98
+ return_dict=return_dict,
99
+ cache_position=cache_position,
100
+ )
101
+
102
+ hidden_states = outputs[0]
103
+
104
+ if self.config.pretraining_tp > 1:
105
+ lm_head_slices = self.lm_head.weight.split(self.vocab_size // self.config.pretraining_tp, dim=0)
106
+ logits = [F.linear(hidden_states, lm_head_slices[i]) for i in range(self.config.pretraining_tp)]
107
+ logits = torch.cat(logits, dim=-1)
108
+ else:
109
+ logits = self.lm_head(hidden_states)
110
+ logits = logits.float()
111
+
112
+ loss = None
113
+ if labels is not None:
114
+ # Shift so that tokens < n predict n
115
+ shift_logits = logits[..., :-1, :].contiguous()
116
+ shift_labels = labels[..., 1:].contiguous()
117
+ # Flatten the tokens
118
+ loss_fct = nn.CrossEntropyLoss()
119
+ shift_logits = shift_logits.view(-1, self.config.vocab_size)
120
+ shift_labels = shift_labels.view(-1)
121
+ # Enable model parallelism
122
+ shift_labels = shift_labels.to(shift_logits.device)
123
+ loss = loss_fct(shift_logits, shift_labels)
124
+
125
+ if not return_dict:
126
+ output = (logits,) + outputs[1:]
127
+ return (loss,) + output if loss is not None else output
128
+
129
+ return CausalLMOutputWithPast(
130
+ loss=loss,
131
+ logits=logits,
132
+ past_key_values=outputs.past_key_values,
133
+ hidden_states=outputs.hidden_states,
134
+ attentions=outputs.attentions,
135
+ )
136
+
137
+ def prepare_inputs_for_generation(
138
+ self,
139
+ input_ids,
140
+ graph=None,
141
+ past_key_values=None,
142
+ attention_mask=None,
143
+ inputs_embeds=None,
144
+ cache_position=None,
145
+ position_ids=None,
146
+ use_cache=True,
147
+ **kwargs,
148
+ ):
149
+ # If we have cache: let's slice `input_ids` through `cache_position`, to keep only the unprocessed tokens
150
+ # Exception 1: when passing input_embeds, input_ids may be missing entries
151
+ # Exception 2: some generation methods do special slicing of input_ids, so we don't need to do it here
152
+ if past_key_values is not None:
153
+ if inputs_embeds is not None: # Exception 1
154
+ input_ids = input_ids[:, -cache_position.shape[0] :]
155
+ elif input_ids.shape[1] != cache_position.shape[0]: # Default case (the "else", a no op, is Exception 2)
156
+ input_ids = input_ids[:, cache_position]
157
+
158
+ if attention_mask is not None and position_ids is None:
159
+ # create position_ids on the fly for batch generation
160
+ position_ids = attention_mask.long().cumsum(-1) - 1
161
+ position_ids.masked_fill_(attention_mask == 0, 1)
162
+ if past_key_values:
163
+ position_ids = position_ids[:, -input_ids.shape[1] :]
164
+
165
+ # This `clone` call is needed to avoid recapturing cuda graphs with `torch.compile`'s `mode="reduce-overhead`, as otherwise the input `position_ids` would have various stride during the decoding. Here, simply using `.contiguous()` is not sufficient as in the batch size = 1 case, `position_ids` is already contiguous but with varying stride which retriggers a capture.
166
+ position_ids = position_ids.clone(memory_format=torch.contiguous_format)
167
+
168
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
169
+ if inputs_embeds is not None and cache_position[0] == 0:
170
+ model_inputs = {"inputs_embeds": inputs_embeds, "input_ids": None}
171
+ else:
172
+ # The clone here is for the same reason as for `position_ids`.
173
+ model_inputs = {"input_ids": input_ids.clone(memory_format=torch.contiguous_format), "inputs_embeds": None}
174
+
175
+ if isinstance(past_key_values, StaticCache) and attention_mask.ndim == 2:
176
+ if model_inputs["inputs_embeds"] is not None:
177
+ batch_size, sequence_length, _ = model_inputs["inputs_embeds"].shape
178
+ device = model_inputs["inputs_embeds"].device
179
+ else:
180
+ batch_size, sequence_length = model_inputs["input_ids"].shape
181
+ device = model_inputs["input_ids"].device
182
+
183
+ dtype = self.lm_head.weight.dtype
184
+ min_dtype = torch.finfo(dtype).min
185
+
186
+ attention_mask = _prepare_4d_causal_attention_mask_with_cache_position(
187
+ attention_mask,
188
+ sequence_length=sequence_length,
189
+ target_length=past_key_values.get_max_length(),
190
+ dtype=dtype,
191
+ device=device,
192
+ min_dtype=min_dtype,
193
+ cache_position=cache_position,
194
+ batch_size=batch_size,
195
+ )
196
+
197
+ model_inputs.update(
198
+ {
199
+ "graph": graph,
200
+ "position_ids": position_ids,
201
+ "cache_position": cache_position,
202
+ "past_key_values": past_key_values,
203
+ "use_cache": use_cache,
204
+ "attention_mask": attention_mask,
205
+ }
206
+ )
207
+ return model_inputs
generation_config.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 128000,
4
+ "eos_token_id": 128040,
5
+ "max_new_tokens": 256,
6
+ "pad_token_id": 128040,
7
+ "transformers_version": "4.44.0"
8
+ }
gnn.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn.functional as F
3
+ from torch_geometric.nn import GATConv
4
+
5
+ class GAT(torch.nn.Module):
6
+ def __init__(self, in_channels, hidden_channels, out_channels, num_layers, dropout, num_heads=4):
7
+ super(GAT, self).__init__()
8
+ self.convs = torch.nn.ModuleList()
9
+ self.convs.append(GATConv(in_channels, hidden_channels, heads=num_heads, concat=False))
10
+ self.bns = torch.nn.ModuleList()
11
+ self.bns.append(torch.nn.BatchNorm1d(hidden_channels))
12
+ for _ in range(num_layers - 2):
13
+ self.convs.append(GATConv(hidden_channels, hidden_channels, heads=num_heads, concat=False))
14
+ self.bns.append(torch.nn.BatchNorm1d(hidden_channels))
15
+ self.convs.append(GATConv(hidden_channels, out_channels, heads=num_heads, concat=False))
16
+ self.dropout = dropout
17
+
18
+ def reset_parameters(self):
19
+ for conv in self.convs:
20
+ conv.reset_parameters()
21
+ for bn in self.bns:
22
+ bn.reset_parameters()
23
+
24
+ def forward(self, x, edge_index, edge_attr):
25
+ for i, conv in enumerate(self.convs[:-1]):
26
+ x = conv(x, edge_index=edge_index, edge_attr=edge_attr)
27
+ x = self.bns[i](x)
28
+ x = F.relu(x)
29
+ x = F.dropout(x, p=self.dropout, training=self.training)
30
+ x = self.convs[-1](x,edge_index=edge_index, edge_attr=edge_attr)
31
+ return x, edge_attr
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b09f19a828030566c09f5a18bc46667fd49f9d045c2cd54c48ed04fb54dde4d
3
+ size 4976698672
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ede213f655d2f8ffd872f66b942e472ae45b01a21acb6da291f5a4bbbd8fee99
3
+ size 4999802720
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:833b0228b09646ef1b117fae1a4e308adc1b440059d0d69c18eaf5c618e46890
3
+ size 4915916176
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bb3cc20de5f5a3df12cf6581c9b1515a4fa1b41a9f19082a8add4daf56a82f31
3
+ size 1220681584
model.safetensors.index.json ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 16113061912
4
+ },
5
+ "weight_map": {
6
+ "graph_encoder.bns.0.bias": "model-00004-of-00004.safetensors",
7
+ "graph_encoder.bns.0.num_batches_tracked": "model-00004-of-00004.safetensors",
8
+ "graph_encoder.bns.0.running_mean": "model-00004-of-00004.safetensors",
9
+ "graph_encoder.bns.0.running_var": "model-00004-of-00004.safetensors",
10
+ "graph_encoder.bns.0.weight": "model-00004-of-00004.safetensors",
11
+ "graph_encoder.bns.1.bias": "model-00004-of-00004.safetensors",
12
+ "graph_encoder.bns.1.num_batches_tracked": "model-00004-of-00004.safetensors",
13
+ "graph_encoder.bns.1.running_mean": "model-00004-of-00004.safetensors",
14
+ "graph_encoder.bns.1.running_var": "model-00004-of-00004.safetensors",
15
+ "graph_encoder.bns.1.weight": "model-00004-of-00004.safetensors",
16
+ "graph_encoder.bns.2.bias": "model-00004-of-00004.safetensors",
17
+ "graph_encoder.bns.2.num_batches_tracked": "model-00004-of-00004.safetensors",
18
+ "graph_encoder.bns.2.running_mean": "model-00004-of-00004.safetensors",
19
+ "graph_encoder.bns.2.running_var": "model-00004-of-00004.safetensors",
20
+ "graph_encoder.bns.2.weight": "model-00004-of-00004.safetensors",
21
+ "graph_encoder.convs.0.att_dst": "model-00004-of-00004.safetensors",
22
+ "graph_encoder.convs.0.att_src": "model-00004-of-00004.safetensors",
23
+ "graph_encoder.convs.0.bias": "model-00004-of-00004.safetensors",
24
+ "graph_encoder.convs.0.lin.weight": "model-00004-of-00004.safetensors",
25
+ "graph_encoder.convs.1.att_dst": "model-00004-of-00004.safetensors",
26
+ "graph_encoder.convs.1.att_src": "model-00004-of-00004.safetensors",
27
+ "graph_encoder.convs.1.bias": "model-00004-of-00004.safetensors",
28
+ "graph_encoder.convs.1.lin.weight": "model-00004-of-00004.safetensors",
29
+ "graph_encoder.convs.2.att_dst": "model-00004-of-00004.safetensors",
30
+ "graph_encoder.convs.2.att_src": "model-00004-of-00004.safetensors",
31
+ "graph_encoder.convs.2.bias": "model-00004-of-00004.safetensors",
32
+ "graph_encoder.convs.2.lin.weight": "model-00004-of-00004.safetensors",
33
+ "graph_encoder.convs.3.att_dst": "model-00004-of-00004.safetensors",
34
+ "graph_encoder.convs.3.att_src": "model-00004-of-00004.safetensors",
35
+ "graph_encoder.convs.3.bias": "model-00004-of-00004.safetensors",
36
+ "graph_encoder.convs.3.lin.weight": "model-00004-of-00004.safetensors",
37
+ "lm_head.weight": "model-00004-of-00004.safetensors",
38
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
39
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
40
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
41
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
42
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
43
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
44
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
45
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
46
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
47
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
48
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
49
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
50
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
51
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
52
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
53
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
54
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
55
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
56
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
57
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
58
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
59
+ "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
60
+ "model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
61
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
62
+ "model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
63
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
64
+ "model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
65
+ "model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
66
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
67
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
68
+ "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
69
+ "model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
70
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
71
+ "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
72
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
73
+ "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
74
+ "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
75
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
76
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
77
+ "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
78
+ "model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
79
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
80
+ "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
81
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
86
+ "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
87
+ "model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
88
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
89
+ "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
90
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
91
+ "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
98
+ "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
101
+ "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
103
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
104
+ "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
105
+ "model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
106
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
107
+ "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
108
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
109
+ "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
110
+ "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
111
+ "model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
112
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
113
+ "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
114
+ "model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
115
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
117
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
118
+ "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
119
+ "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
120
+ "model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
121
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
122
+ "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
123
+ "model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
124
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
125
+ "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
126
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
127
+ "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
128
+ "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
129
+ "model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
130
+ "model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
131
+ "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
132
+ "model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
133
+ "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
134
+ "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
135
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
136
+ "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
137
+ "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
138
+ "model.layers.19.input_layernorm.weight": "model-00002-of-00004.safetensors",
139
+ "model.layers.19.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
140
+ "model.layers.19.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
141
+ "model.layers.19.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
142
+ "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
143
+ "model.layers.19.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
144
+ "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
145
+ "model.layers.19.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
146
+ "model.layers.19.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
147
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
148
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
149
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
150
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
151
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
152
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
153
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
154
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
155
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
156
+ "model.layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
157
+ "model.layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
158
+ "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
159
+ "model.layers.20.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
160
+ "model.layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
161
+ "model.layers.20.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
162
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
163
+ "model.layers.20.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
164
+ "model.layers.20.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
165
+ "model.layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
166
+ "model.layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
167
+ "model.layers.21.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
168
+ "model.layers.21.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
169
+ "model.layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
170
+ "model.layers.21.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
171
+ "model.layers.21.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
172
+ "model.layers.21.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
173
+ "model.layers.21.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
174
+ "model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
175
+ "model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
176
+ "model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
177
+ "model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
178
+ "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
179
+ "model.layers.22.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
180
+ "model.layers.22.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
181
+ "model.layers.22.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
182
+ "model.layers.22.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
183
+ "model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
184
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
185
+ "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
186
+ "model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
187
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
188
+ "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
189
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
190
+ "model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
191
+ "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
192
+ "model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
193
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
194
+ "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
195
+ "model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
196
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
197
+ "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
198
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
199
+ "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
200
+ "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
201
+ "model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
202
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
203
+ "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
204
+ "model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
205
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
206
+ "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
207
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
208
+ "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
209
+ "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
210
+ "model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
211
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
212
+ "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
213
+ "model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
214
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
215
+ "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
216
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
217
+ "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
218
+ "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
219
+ "model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
220
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
221
+ "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
222
+ "model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
223
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
224
+ "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
225
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
226
+ "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
227
+ "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
228
+ "model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
229
+ "model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
230
+ "model.layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
231
+ "model.layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
232
+ "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
233
+ "model.layers.28.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
234
+ "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
235
+ "model.layers.28.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
236
+ "model.layers.28.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
237
+ "model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
238
+ "model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
239
+ "model.layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
240
+ "model.layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
241
+ "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
242
+ "model.layers.29.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
243
+ "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
244
+ "model.layers.29.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
245
+ "model.layers.29.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
246
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
247
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
248
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
249
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
250
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
251
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
252
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
253
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
254
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
255
+ "model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
256
+ "model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
257
+ "model.layers.30.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
258
+ "model.layers.30.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
259
+ "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
260
+ "model.layers.30.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
261
+ "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
262
+ "model.layers.30.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
263
+ "model.layers.30.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
264
+ "model.layers.31.input_layernorm.weight": "model-00004-of-00004.safetensors",
265
+ "model.layers.31.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
266
+ "model.layers.31.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
267
+ "model.layers.31.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
268
+ "model.layers.31.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
269
+ "model.layers.31.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
270
+ "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
271
+ "model.layers.31.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
272
+ "model.layers.31.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
273
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
274
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
275
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
276
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
277
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
278
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
279
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
280
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
281
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
282
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
283
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
284
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
285
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
286
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
287
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
288
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
289
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
290
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
291
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
292
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
293
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
294
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
295
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
296
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
297
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
298
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
299
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
300
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
301
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
302
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
303
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
304
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
305
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
306
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
307
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
308
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
309
+ "model.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
310
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
311
+ "model.layers.8.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
312
+ "model.layers.8.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
313
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
314
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
315
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
316
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
317
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
318
+ "model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
319
+ "model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
320
+ "model.layers.9.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
321
+ "model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
322
+ "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
323
+ "model.layers.9.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
324
+ "model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
325
+ "model.layers.9.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
326
+ "model.layers.9.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
327
+ "model.norm.weight": "model-00004-of-00004.safetensors",
328
+ "projector.0.bias": "model-00004-of-00004.safetensors",
329
+ "projector.0.weight": "model-00004-of-00004.safetensors",
330
+ "projector.2.bias": "model-00004-of-00004.safetensors",
331
+ "projector.2.weight": "model-00004-of-00004.safetensors"
332
+ }
333
+ }