stgzr commited on
Commit
4f42865
1 Parent(s): 7c6f602

update tokenizer and model weights

Browse files
added_tokens.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|endoftext|>": 96506,
3
+ "<|end|>": 96500,
4
+ "<|message|>": 96501,
5
+ "<|pad|>": 96505,
6
+ "<|start|>": 96499,
7
+ "<|tool_end|>": 96504,
8
+ "<|tool_excute|>": 96503,
9
+ "<|tool_start|>": 96502
10
+ }
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_map": {
3
+ "AutoConfig": "configuration_inflm.INFLMConfig",
4
+ "AutoModelForCausalLM": "modeling_inflm.INFLMForCausalLM"
5
+ },
6
+ "architectures": [
7
+ "INFLMForCausalLM"
8
+ ],
9
+ "bos_token_id": 1,
10
+ "eos_token_id": 2,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 8192,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 22016,
15
+ "max_position_embeddings": 4096,
16
+ "model_type": "inflm",
17
+ "num_attention_heads": 64,
18
+ "num_hidden_layers": 48,
19
+ "num_key_value_heads": 8,
20
+ "pretraining_tp": 1,
21
+ "layer_norm_eps": 1e-05,
22
+ "rope_theta": 500000,
23
+ "rope_scaling": null,
24
+ "tie_word_embeddings": false,
25
+ "torch_dtype": "bfloat16",
26
+ "use_cache": true,
27
+ "vocab_size": 96512
28
+ }
configuration_inflm.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ """INFLM model configuration."""
21
+
22
+ from transformers.models.llama.configuration_llama import LlamaConfig
23
+
24
+
25
+ class INFLMConfig(LlamaConfig):
26
+ model_type = "inflm"
27
+
28
+ def __init__(
29
+ self,
30
+ layer_norm_eps=1e-5,
31
+ **kwargs,
32
+ ):
33
+ self.layer_norm_eps = layer_norm_eps
34
+ super().__init__(
35
+ **kwargs,
36
+ )
generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eos_token_id": 2,
3
+ "pad_token_id": 3,
4
+ "max_new_tokens": 2048,
5
+ "do_sample": true,
6
+ "top_k": 0,
7
+ "top_p": 0.8,
8
+ "transformers_version": "4.39.0"
9
+ }
model-00001-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:161c857f1b2ab30371cdd41c9a682e8ce9027fa59c752bed06335f98ac459b0b
3
+ size 3988850744
model-00002-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03b2bd2d36f9193c43df8fc5e420a89ac6b8c62f974939b8a973435bef7e81c4
3
+ size 4152561376
model-00003-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:369e960a9db12fb81c9b5857a82eadc9f74a4df9c68ca067024eaa8c0c8c9cc2
3
+ size 4152561376
model-00004-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e952e929eaae30fc484d858dcda84e83fa02ac1ff95b51627ba9a54defdf123
3
+ size 4152561408
model-00005-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9be03db03185bda2724f04f9e18b22bd4981794e1be6d0dbf50f52bf9aecf0f
3
+ size 4152561408
model-00006-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3146ff836155bc6c4b3448834dbbe2e61b7b326125f22adebc68ee25ed24af2b
3
+ size 4152561408
model-00007-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:642420385e52d173cfc79f373412c1a514c752edc8deb102aa2b3dd67e471f26
3
+ size 4152561408
model-00008-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:571775f85501368131427d0937923334c17e9d816ca98c74a1491d9c74189154
3
+ size 4152561408
model-00009-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dbc5475d252737bdfb2d097d38c901df07b3b6b551af3a47a02d4ff20be0d0e
3
+ size 4152561408
model-00010-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28f7014dda7fc2ea4a93709396ac5c7ca67740d5073e787fa84f9ddf0f334513
3
+ size 4152561408
model-00011-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d52d892f1c71b8a08cc1189f73df07bff1901bfdb499d3e38adb5921b332aeb3
3
+ size 4152561408
model-00012-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec61eb90fddf06abd14c64290cbc891fb01af8fd84a05d5cc543f9f9a7c4b60e
3
+ size 4152561408
model-00013-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccf632af3c3d42c226927c77045f0df6e0c053a7a566658a4c22cc8a52d29df5
3
+ size 4152561408
model-00014-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfa2a791184b253664128e5388bb06a043dcffd8691ad469508e019d321a08cc
3
+ size 4152561408
model-00015-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ff5b32dbfd9ed096d5a8f38d908c6580efe697955050bbbe5c6353e1eca184a
3
+ size 4152561408
model-00016-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc89e53b2c7279a2adb6029d3460e84dd551c0b3298a8b49d8bd3a3dd67ab681
3
+ size 4152561408
model-00017-of-00017.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51ae3aebeb804960180b40a2b878d9be56e60199f69f559460043ff50bac5aed
3
+ size 3326249080
model.safetensors.index.json ADDED
@@ -0,0 +1,539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 69603459072
4
+ },
5
+ "weight_map": {
6
+ "model.embed_tokens.weight": "model-00001-of-00017.safetensors",
7
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00017.safetensors",
8
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00017.safetensors",
9
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00017.safetensors",
10
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00017.safetensors",
11
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00017.safetensors",
12
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00017.safetensors",
13
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00017.safetensors",
14
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00017.safetensors",
15
+ "model.layers.0.input_layernorm.bias": "model-00001-of-00017.safetensors",
16
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00017.safetensors",
17
+ "model.layers.0.post_attention_layernorm.bias": "model-00001-of-00017.safetensors",
18
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00017.safetensors",
19
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00017.safetensors",
20
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00017.safetensors",
21
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00017.safetensors",
22
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00017.safetensors",
23
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00017.safetensors",
24
+ "model.layers.1.mlp.down_proj.weight": "model-00002-of-00017.safetensors",
25
+ "model.layers.1.input_layernorm.weight": "model-00002-of-00017.safetensors",
26
+ "model.layers.1.input_layernorm.bias": "model-00002-of-00017.safetensors",
27
+ "model.layers.1.post_attention_layernorm.weight": "model-00002-of-00017.safetensors",
28
+ "model.layers.1.post_attention_layernorm.bias": "model-00002-of-00017.safetensors",
29
+ "model.layers.2.self_attn.q_proj.weight": "model-00002-of-00017.safetensors",
30
+ "model.layers.2.self_attn.k_proj.weight": "model-00002-of-00017.safetensors",
31
+ "model.layers.2.self_attn.v_proj.weight": "model-00002-of-00017.safetensors",
32
+ "model.layers.2.self_attn.o_proj.weight": "model-00002-of-00017.safetensors",
33
+ "model.layers.2.mlp.gate_proj.weight": "model-00002-of-00017.safetensors",
34
+ "model.layers.2.mlp.up_proj.weight": "model-00002-of-00017.safetensors",
35
+ "model.layers.2.mlp.down_proj.weight": "model-00002-of-00017.safetensors",
36
+ "model.layers.2.input_layernorm.weight": "model-00002-of-00017.safetensors",
37
+ "model.layers.2.input_layernorm.bias": "model-00002-of-00017.safetensors",
38
+ "model.layers.2.post_attention_layernorm.weight": "model-00002-of-00017.safetensors",
39
+ "model.layers.2.post_attention_layernorm.bias": "model-00002-of-00017.safetensors",
40
+ "model.layers.3.self_attn.q_proj.weight": "model-00002-of-00017.safetensors",
41
+ "model.layers.3.self_attn.k_proj.weight": "model-00002-of-00017.safetensors",
42
+ "model.layers.3.self_attn.v_proj.weight": "model-00002-of-00017.safetensors",
43
+ "model.layers.3.self_attn.o_proj.weight": "model-00002-of-00017.safetensors",
44
+ "model.layers.3.mlp.gate_proj.weight": "model-00002-of-00017.safetensors",
45
+ "model.layers.3.mlp.up_proj.weight": "model-00002-of-00017.safetensors",
46
+ "model.layers.3.mlp.down_proj.weight": "model-00002-of-00017.safetensors",
47
+ "model.layers.3.input_layernorm.weight": "model-00002-of-00017.safetensors",
48
+ "model.layers.3.input_layernorm.bias": "model-00002-of-00017.safetensors",
49
+ "model.layers.3.post_attention_layernorm.weight": "model-00002-of-00017.safetensors",
50
+ "model.layers.3.post_attention_layernorm.bias": "model-00002-of-00017.safetensors",
51
+ "model.layers.4.self_attn.q_proj.weight": "model-00002-of-00017.safetensors",
52
+ "model.layers.4.self_attn.k_proj.weight": "model-00002-of-00017.safetensors",
53
+ "model.layers.4.self_attn.v_proj.weight": "model-00002-of-00017.safetensors",
54
+ "model.layers.4.self_attn.o_proj.weight": "model-00002-of-00017.safetensors",
55
+ "model.layers.4.mlp.gate_proj.weight": "model-00002-of-00017.safetensors",
56
+ "model.layers.4.mlp.up_proj.weight": "model-00002-of-00017.safetensors",
57
+ "model.layers.4.mlp.down_proj.weight": "model-00003-of-00017.safetensors",
58
+ "model.layers.4.input_layernorm.weight": "model-00003-of-00017.safetensors",
59
+ "model.layers.4.input_layernorm.bias": "model-00003-of-00017.safetensors",
60
+ "model.layers.4.post_attention_layernorm.weight": "model-00003-of-00017.safetensors",
61
+ "model.layers.4.post_attention_layernorm.bias": "model-00003-of-00017.safetensors",
62
+ "model.layers.5.self_attn.q_proj.weight": "model-00003-of-00017.safetensors",
63
+ "model.layers.5.self_attn.k_proj.weight": "model-00003-of-00017.safetensors",
64
+ "model.layers.5.self_attn.v_proj.weight": "model-00003-of-00017.safetensors",
65
+ "model.layers.5.self_attn.o_proj.weight": "model-00003-of-00017.safetensors",
66
+ "model.layers.5.mlp.gate_proj.weight": "model-00003-of-00017.safetensors",
67
+ "model.layers.5.mlp.up_proj.weight": "model-00003-of-00017.safetensors",
68
+ "model.layers.5.mlp.down_proj.weight": "model-00003-of-00017.safetensors",
69
+ "model.layers.5.input_layernorm.weight": "model-00003-of-00017.safetensors",
70
+ "model.layers.5.input_layernorm.bias": "model-00003-of-00017.safetensors",
71
+ "model.layers.5.post_attention_layernorm.weight": "model-00003-of-00017.safetensors",
72
+ "model.layers.5.post_attention_layernorm.bias": "model-00003-of-00017.safetensors",
73
+ "model.layers.6.self_attn.q_proj.weight": "model-00003-of-00017.safetensors",
74
+ "model.layers.6.self_attn.k_proj.weight": "model-00003-of-00017.safetensors",
75
+ "model.layers.6.self_attn.v_proj.weight": "model-00003-of-00017.safetensors",
76
+ "model.layers.6.self_attn.o_proj.weight": "model-00003-of-00017.safetensors",
77
+ "model.layers.6.mlp.gate_proj.weight": "model-00003-of-00017.safetensors",
78
+ "model.layers.6.mlp.up_proj.weight": "model-00003-of-00017.safetensors",
79
+ "model.layers.6.mlp.down_proj.weight": "model-00003-of-00017.safetensors",
80
+ "model.layers.6.input_layernorm.weight": "model-00003-of-00017.safetensors",
81
+ "model.layers.6.input_layernorm.bias": "model-00003-of-00017.safetensors",
82
+ "model.layers.6.post_attention_layernorm.weight": "model-00003-of-00017.safetensors",
83
+ "model.layers.6.post_attention_layernorm.bias": "model-00003-of-00017.safetensors",
84
+ "model.layers.7.self_attn.q_proj.weight": "model-00003-of-00017.safetensors",
85
+ "model.layers.7.self_attn.k_proj.weight": "model-00003-of-00017.safetensors",
86
+ "model.layers.7.self_attn.v_proj.weight": "model-00003-of-00017.safetensors",
87
+ "model.layers.7.self_attn.o_proj.weight": "model-00003-of-00017.safetensors",
88
+ "model.layers.7.mlp.gate_proj.weight": "model-00003-of-00017.safetensors",
89
+ "model.layers.7.mlp.up_proj.weight": "model-00003-of-00017.safetensors",
90
+ "model.layers.7.mlp.down_proj.weight": "model-00004-of-00017.safetensors",
91
+ "model.layers.7.input_layernorm.weight": "model-00004-of-00017.safetensors",
92
+ "model.layers.7.input_layernorm.bias": "model-00004-of-00017.safetensors",
93
+ "model.layers.7.post_attention_layernorm.weight": "model-00004-of-00017.safetensors",
94
+ "model.layers.7.post_attention_layernorm.bias": "model-00004-of-00017.safetensors",
95
+ "model.layers.8.self_attn.q_proj.weight": "model-00004-of-00017.safetensors",
96
+ "model.layers.8.self_attn.k_proj.weight": "model-00004-of-00017.safetensors",
97
+ "model.layers.8.self_attn.v_proj.weight": "model-00004-of-00017.safetensors",
98
+ "model.layers.8.self_attn.o_proj.weight": "model-00004-of-00017.safetensors",
99
+ "model.layers.8.mlp.gate_proj.weight": "model-00004-of-00017.safetensors",
100
+ "model.layers.8.mlp.up_proj.weight": "model-00004-of-00017.safetensors",
101
+ "model.layers.8.mlp.down_proj.weight": "model-00004-of-00017.safetensors",
102
+ "model.layers.8.input_layernorm.weight": "model-00004-of-00017.safetensors",
103
+ "model.layers.8.input_layernorm.bias": "model-00004-of-00017.safetensors",
104
+ "model.layers.8.post_attention_layernorm.weight": "model-00004-of-00017.safetensors",
105
+ "model.layers.8.post_attention_layernorm.bias": "model-00004-of-00017.safetensors",
106
+ "model.layers.9.self_attn.q_proj.weight": "model-00004-of-00017.safetensors",
107
+ "model.layers.9.self_attn.k_proj.weight": "model-00004-of-00017.safetensors",
108
+ "model.layers.9.self_attn.v_proj.weight": "model-00004-of-00017.safetensors",
109
+ "model.layers.9.self_attn.o_proj.weight": "model-00004-of-00017.safetensors",
110
+ "model.layers.9.mlp.gate_proj.weight": "model-00004-of-00017.safetensors",
111
+ "model.layers.9.mlp.up_proj.weight": "model-00004-of-00017.safetensors",
112
+ "model.layers.9.mlp.down_proj.weight": "model-00004-of-00017.safetensors",
113
+ "model.layers.9.input_layernorm.weight": "model-00004-of-00017.safetensors",
114
+ "model.layers.9.input_layernorm.bias": "model-00004-of-00017.safetensors",
115
+ "model.layers.9.post_attention_layernorm.weight": "model-00004-of-00017.safetensors",
116
+ "model.layers.9.post_attention_layernorm.bias": "model-00004-of-00017.safetensors",
117
+ "model.layers.10.self_attn.q_proj.weight": "model-00004-of-00017.safetensors",
118
+ "model.layers.10.self_attn.k_proj.weight": "model-00004-of-00017.safetensors",
119
+ "model.layers.10.self_attn.v_proj.weight": "model-00004-of-00017.safetensors",
120
+ "model.layers.10.self_attn.o_proj.weight": "model-00004-of-00017.safetensors",
121
+ "model.layers.10.mlp.gate_proj.weight": "model-00004-of-00017.safetensors",
122
+ "model.layers.10.mlp.up_proj.weight": "model-00004-of-00017.safetensors",
123
+ "model.layers.10.mlp.down_proj.weight": "model-00005-of-00017.safetensors",
124
+ "model.layers.10.input_layernorm.weight": "model-00005-of-00017.safetensors",
125
+ "model.layers.10.input_layernorm.bias": "model-00005-of-00017.safetensors",
126
+ "model.layers.10.post_attention_layernorm.weight": "model-00005-of-00017.safetensors",
127
+ "model.layers.10.post_attention_layernorm.bias": "model-00005-of-00017.safetensors",
128
+ "model.layers.11.self_attn.q_proj.weight": "model-00005-of-00017.safetensors",
129
+ "model.layers.11.self_attn.k_proj.weight": "model-00005-of-00017.safetensors",
130
+ "model.layers.11.self_attn.v_proj.weight": "model-00005-of-00017.safetensors",
131
+ "model.layers.11.self_attn.o_proj.weight": "model-00005-of-00017.safetensors",
132
+ "model.layers.11.mlp.gate_proj.weight": "model-00005-of-00017.safetensors",
133
+ "model.layers.11.mlp.up_proj.weight": "model-00005-of-00017.safetensors",
134
+ "model.layers.11.mlp.down_proj.weight": "model-00005-of-00017.safetensors",
135
+ "model.layers.11.input_layernorm.weight": "model-00005-of-00017.safetensors",
136
+ "model.layers.11.input_layernorm.bias": "model-00005-of-00017.safetensors",
137
+ "model.layers.11.post_attention_layernorm.weight": "model-00005-of-00017.safetensors",
138
+ "model.layers.11.post_attention_layernorm.bias": "model-00005-of-00017.safetensors",
139
+ "model.layers.12.self_attn.q_proj.weight": "model-00005-of-00017.safetensors",
140
+ "model.layers.12.self_attn.k_proj.weight": "model-00005-of-00017.safetensors",
141
+ "model.layers.12.self_attn.v_proj.weight": "model-00005-of-00017.safetensors",
142
+ "model.layers.12.self_attn.o_proj.weight": "model-00005-of-00017.safetensors",
143
+ "model.layers.12.mlp.gate_proj.weight": "model-00005-of-00017.safetensors",
144
+ "model.layers.12.mlp.up_proj.weight": "model-00005-of-00017.safetensors",
145
+ "model.layers.12.mlp.down_proj.weight": "model-00005-of-00017.safetensors",
146
+ "model.layers.12.input_layernorm.weight": "model-00005-of-00017.safetensors",
147
+ "model.layers.12.input_layernorm.bias": "model-00005-of-00017.safetensors",
148
+ "model.layers.12.post_attention_layernorm.weight": "model-00005-of-00017.safetensors",
149
+ "model.layers.12.post_attention_layernorm.bias": "model-00005-of-00017.safetensors",
150
+ "model.layers.13.self_attn.q_proj.weight": "model-00005-of-00017.safetensors",
151
+ "model.layers.13.self_attn.k_proj.weight": "model-00005-of-00017.safetensors",
152
+ "model.layers.13.self_attn.v_proj.weight": "model-00005-of-00017.safetensors",
153
+ "model.layers.13.self_attn.o_proj.weight": "model-00005-of-00017.safetensors",
154
+ "model.layers.13.mlp.gate_proj.weight": "model-00005-of-00017.safetensors",
155
+ "model.layers.13.mlp.up_proj.weight": "model-00005-of-00017.safetensors",
156
+ "model.layers.13.mlp.down_proj.weight": "model-00006-of-00017.safetensors",
157
+ "model.layers.13.input_layernorm.weight": "model-00006-of-00017.safetensors",
158
+ "model.layers.13.input_layernorm.bias": "model-00006-of-00017.safetensors",
159
+ "model.layers.13.post_attention_layernorm.weight": "model-00006-of-00017.safetensors",
160
+ "model.layers.13.post_attention_layernorm.bias": "model-00006-of-00017.safetensors",
161
+ "model.layers.14.self_attn.q_proj.weight": "model-00006-of-00017.safetensors",
162
+ "model.layers.14.self_attn.k_proj.weight": "model-00006-of-00017.safetensors",
163
+ "model.layers.14.self_attn.v_proj.weight": "model-00006-of-00017.safetensors",
164
+ "model.layers.14.self_attn.o_proj.weight": "model-00006-of-00017.safetensors",
165
+ "model.layers.14.mlp.gate_proj.weight": "model-00006-of-00017.safetensors",
166
+ "model.layers.14.mlp.up_proj.weight": "model-00006-of-00017.safetensors",
167
+ "model.layers.14.mlp.down_proj.weight": "model-00006-of-00017.safetensors",
168
+ "model.layers.14.input_layernorm.weight": "model-00006-of-00017.safetensors",
169
+ "model.layers.14.input_layernorm.bias": "model-00006-of-00017.safetensors",
170
+ "model.layers.14.post_attention_layernorm.weight": "model-00006-of-00017.safetensors",
171
+ "model.layers.14.post_attention_layernorm.bias": "model-00006-of-00017.safetensors",
172
+ "model.layers.15.self_attn.q_proj.weight": "model-00006-of-00017.safetensors",
173
+ "model.layers.15.self_attn.k_proj.weight": "model-00006-of-00017.safetensors",
174
+ "model.layers.15.self_attn.v_proj.weight": "model-00006-of-00017.safetensors",
175
+ "model.layers.15.self_attn.o_proj.weight": "model-00006-of-00017.safetensors",
176
+ "model.layers.15.mlp.gate_proj.weight": "model-00006-of-00017.safetensors",
177
+ "model.layers.15.mlp.up_proj.weight": "model-00006-of-00017.safetensors",
178
+ "model.layers.15.mlp.down_proj.weight": "model-00006-of-00017.safetensors",
179
+ "model.layers.15.input_layernorm.weight": "model-00006-of-00017.safetensors",
180
+ "model.layers.15.input_layernorm.bias": "model-00006-of-00017.safetensors",
181
+ "model.layers.15.post_attention_layernorm.weight": "model-00006-of-00017.safetensors",
182
+ "model.layers.15.post_attention_layernorm.bias": "model-00006-of-00017.safetensors",
183
+ "model.layers.16.self_attn.q_proj.weight": "model-00006-of-00017.safetensors",
184
+ "model.layers.16.self_attn.k_proj.weight": "model-00006-of-00017.safetensors",
185
+ "model.layers.16.self_attn.v_proj.weight": "model-00006-of-00017.safetensors",
186
+ "model.layers.16.self_attn.o_proj.weight": "model-00006-of-00017.safetensors",
187
+ "model.layers.16.mlp.gate_proj.weight": "model-00006-of-00017.safetensors",
188
+ "model.layers.16.mlp.up_proj.weight": "model-00006-of-00017.safetensors",
189
+ "model.layers.16.mlp.down_proj.weight": "model-00007-of-00017.safetensors",
190
+ "model.layers.16.input_layernorm.weight": "model-00007-of-00017.safetensors",
191
+ "model.layers.16.input_layernorm.bias": "model-00007-of-00017.safetensors",
192
+ "model.layers.16.post_attention_layernorm.weight": "model-00007-of-00017.safetensors",
193
+ "model.layers.16.post_attention_layernorm.bias": "model-00007-of-00017.safetensors",
194
+ "model.layers.17.self_attn.q_proj.weight": "model-00007-of-00017.safetensors",
195
+ "model.layers.17.self_attn.k_proj.weight": "model-00007-of-00017.safetensors",
196
+ "model.layers.17.self_attn.v_proj.weight": "model-00007-of-00017.safetensors",
197
+ "model.layers.17.self_attn.o_proj.weight": "model-00007-of-00017.safetensors",
198
+ "model.layers.17.mlp.gate_proj.weight": "model-00007-of-00017.safetensors",
199
+ "model.layers.17.mlp.up_proj.weight": "model-00007-of-00017.safetensors",
200
+ "model.layers.17.mlp.down_proj.weight": "model-00007-of-00017.safetensors",
201
+ "model.layers.17.input_layernorm.weight": "model-00007-of-00017.safetensors",
202
+ "model.layers.17.input_layernorm.bias": "model-00007-of-00017.safetensors",
203
+ "model.layers.17.post_attention_layernorm.weight": "model-00007-of-00017.safetensors",
204
+ "model.layers.17.post_attention_layernorm.bias": "model-00007-of-00017.safetensors",
205
+ "model.layers.18.self_attn.q_proj.weight": "model-00007-of-00017.safetensors",
206
+ "model.layers.18.self_attn.k_proj.weight": "model-00007-of-00017.safetensors",
207
+ "model.layers.18.self_attn.v_proj.weight": "model-00007-of-00017.safetensors",
208
+ "model.layers.18.self_attn.o_proj.weight": "model-00007-of-00017.safetensors",
209
+ "model.layers.18.mlp.gate_proj.weight": "model-00007-of-00017.safetensors",
210
+ "model.layers.18.mlp.up_proj.weight": "model-00007-of-00017.safetensors",
211
+ "model.layers.18.mlp.down_proj.weight": "model-00007-of-00017.safetensors",
212
+ "model.layers.18.input_layernorm.weight": "model-00007-of-00017.safetensors",
213
+ "model.layers.18.input_layernorm.bias": "model-00007-of-00017.safetensors",
214
+ "model.layers.18.post_attention_layernorm.weight": "model-00007-of-00017.safetensors",
215
+ "model.layers.18.post_attention_layernorm.bias": "model-00007-of-00017.safetensors",
216
+ "model.layers.19.self_attn.q_proj.weight": "model-00007-of-00017.safetensors",
217
+ "model.layers.19.self_attn.k_proj.weight": "model-00007-of-00017.safetensors",
218
+ "model.layers.19.self_attn.v_proj.weight": "model-00007-of-00017.safetensors",
219
+ "model.layers.19.self_attn.o_proj.weight": "model-00007-of-00017.safetensors",
220
+ "model.layers.19.mlp.gate_proj.weight": "model-00007-of-00017.safetensors",
221
+ "model.layers.19.mlp.up_proj.weight": "model-00007-of-00017.safetensors",
222
+ "model.layers.19.mlp.down_proj.weight": "model-00008-of-00017.safetensors",
223
+ "model.layers.19.input_layernorm.weight": "model-00008-of-00017.safetensors",
224
+ "model.layers.19.input_layernorm.bias": "model-00008-of-00017.safetensors",
225
+ "model.layers.19.post_attention_layernorm.weight": "model-00008-of-00017.safetensors",
226
+ "model.layers.19.post_attention_layernorm.bias": "model-00008-of-00017.safetensors",
227
+ "model.layers.20.self_attn.q_proj.weight": "model-00008-of-00017.safetensors",
228
+ "model.layers.20.self_attn.k_proj.weight": "model-00008-of-00017.safetensors",
229
+ "model.layers.20.self_attn.v_proj.weight": "model-00008-of-00017.safetensors",
230
+ "model.layers.20.self_attn.o_proj.weight": "model-00008-of-00017.safetensors",
231
+ "model.layers.20.mlp.gate_proj.weight": "model-00008-of-00017.safetensors",
232
+ "model.layers.20.mlp.up_proj.weight": "model-00008-of-00017.safetensors",
233
+ "model.layers.20.mlp.down_proj.weight": "model-00008-of-00017.safetensors",
234
+ "model.layers.20.input_layernorm.weight": "model-00008-of-00017.safetensors",
235
+ "model.layers.20.input_layernorm.bias": "model-00008-of-00017.safetensors",
236
+ "model.layers.20.post_attention_layernorm.weight": "model-00008-of-00017.safetensors",
237
+ "model.layers.20.post_attention_layernorm.bias": "model-00008-of-00017.safetensors",
238
+ "model.layers.21.self_attn.q_proj.weight": "model-00008-of-00017.safetensors",
239
+ "model.layers.21.self_attn.k_proj.weight": "model-00008-of-00017.safetensors",
240
+ "model.layers.21.self_attn.v_proj.weight": "model-00008-of-00017.safetensors",
241
+ "model.layers.21.self_attn.o_proj.weight": "model-00008-of-00017.safetensors",
242
+ "model.layers.21.mlp.gate_proj.weight": "model-00008-of-00017.safetensors",
243
+ "model.layers.21.mlp.up_proj.weight": "model-00008-of-00017.safetensors",
244
+ "model.layers.21.mlp.down_proj.weight": "model-00008-of-00017.safetensors",
245
+ "model.layers.21.input_layernorm.weight": "model-00008-of-00017.safetensors",
246
+ "model.layers.21.input_layernorm.bias": "model-00008-of-00017.safetensors",
247
+ "model.layers.21.post_attention_layernorm.weight": "model-00008-of-00017.safetensors",
248
+ "model.layers.21.post_attention_layernorm.bias": "model-00008-of-00017.safetensors",
249
+ "model.layers.22.self_attn.q_proj.weight": "model-00008-of-00017.safetensors",
250
+ "model.layers.22.self_attn.k_proj.weight": "model-00008-of-00017.safetensors",
251
+ "model.layers.22.self_attn.v_proj.weight": "model-00008-of-00017.safetensors",
252
+ "model.layers.22.self_attn.o_proj.weight": "model-00008-of-00017.safetensors",
253
+ "model.layers.22.mlp.gate_proj.weight": "model-00008-of-00017.safetensors",
254
+ "model.layers.22.mlp.up_proj.weight": "model-00008-of-00017.safetensors",
255
+ "model.layers.22.mlp.down_proj.weight": "model-00009-of-00017.safetensors",
256
+ "model.layers.22.input_layernorm.weight": "model-00009-of-00017.safetensors",
257
+ "model.layers.22.input_layernorm.bias": "model-00009-of-00017.safetensors",
258
+ "model.layers.22.post_attention_layernorm.weight": "model-00009-of-00017.safetensors",
259
+ "model.layers.22.post_attention_layernorm.bias": "model-00009-of-00017.safetensors",
260
+ "model.layers.23.self_attn.q_proj.weight": "model-00009-of-00017.safetensors",
261
+ "model.layers.23.self_attn.k_proj.weight": "model-00009-of-00017.safetensors",
262
+ "model.layers.23.self_attn.v_proj.weight": "model-00009-of-00017.safetensors",
263
+ "model.layers.23.self_attn.o_proj.weight": "model-00009-of-00017.safetensors",
264
+ "model.layers.23.mlp.gate_proj.weight": "model-00009-of-00017.safetensors",
265
+ "model.layers.23.mlp.up_proj.weight": "model-00009-of-00017.safetensors",
266
+ "model.layers.23.mlp.down_proj.weight": "model-00009-of-00017.safetensors",
267
+ "model.layers.23.input_layernorm.weight": "model-00009-of-00017.safetensors",
268
+ "model.layers.23.input_layernorm.bias": "model-00009-of-00017.safetensors",
269
+ "model.layers.23.post_attention_layernorm.weight": "model-00009-of-00017.safetensors",
270
+ "model.layers.23.post_attention_layernorm.bias": "model-00009-of-00017.safetensors",
271
+ "model.layers.24.self_attn.q_proj.weight": "model-00009-of-00017.safetensors",
272
+ "model.layers.24.self_attn.k_proj.weight": "model-00009-of-00017.safetensors",
273
+ "model.layers.24.self_attn.v_proj.weight": "model-00009-of-00017.safetensors",
274
+ "model.layers.24.self_attn.o_proj.weight": "model-00009-of-00017.safetensors",
275
+ "model.layers.24.mlp.gate_proj.weight": "model-00009-of-00017.safetensors",
276
+ "model.layers.24.mlp.up_proj.weight": "model-00009-of-00017.safetensors",
277
+ "model.layers.24.mlp.down_proj.weight": "model-00009-of-00017.safetensors",
278
+ "model.layers.24.input_layernorm.weight": "model-00009-of-00017.safetensors",
279
+ "model.layers.24.input_layernorm.bias": "model-00009-of-00017.safetensors",
280
+ "model.layers.24.post_attention_layernorm.weight": "model-00009-of-00017.safetensors",
281
+ "model.layers.24.post_attention_layernorm.bias": "model-00009-of-00017.safetensors",
282
+ "model.layers.25.self_attn.q_proj.weight": "model-00009-of-00017.safetensors",
283
+ "model.layers.25.self_attn.k_proj.weight": "model-00009-of-00017.safetensors",
284
+ "model.layers.25.self_attn.v_proj.weight": "model-00009-of-00017.safetensors",
285
+ "model.layers.25.self_attn.o_proj.weight": "model-00009-of-00017.safetensors",
286
+ "model.layers.25.mlp.gate_proj.weight": "model-00009-of-00017.safetensors",
287
+ "model.layers.25.mlp.up_proj.weight": "model-00009-of-00017.safetensors",
288
+ "model.layers.25.mlp.down_proj.weight": "model-00010-of-00017.safetensors",
289
+ "model.layers.25.input_layernorm.weight": "model-00010-of-00017.safetensors",
290
+ "model.layers.25.input_layernorm.bias": "model-00010-of-00017.safetensors",
291
+ "model.layers.25.post_attention_layernorm.weight": "model-00010-of-00017.safetensors",
292
+ "model.layers.25.post_attention_layernorm.bias": "model-00010-of-00017.safetensors",
293
+ "model.layers.26.self_attn.q_proj.weight": "model-00010-of-00017.safetensors",
294
+ "model.layers.26.self_attn.k_proj.weight": "model-00010-of-00017.safetensors",
295
+ "model.layers.26.self_attn.v_proj.weight": "model-00010-of-00017.safetensors",
296
+ "model.layers.26.self_attn.o_proj.weight": "model-00010-of-00017.safetensors",
297
+ "model.layers.26.mlp.gate_proj.weight": "model-00010-of-00017.safetensors",
298
+ "model.layers.26.mlp.up_proj.weight": "model-00010-of-00017.safetensors",
299
+ "model.layers.26.mlp.down_proj.weight": "model-00010-of-00017.safetensors",
300
+ "model.layers.26.input_layernorm.weight": "model-00010-of-00017.safetensors",
301
+ "model.layers.26.input_layernorm.bias": "model-00010-of-00017.safetensors",
302
+ "model.layers.26.post_attention_layernorm.weight": "model-00010-of-00017.safetensors",
303
+ "model.layers.26.post_attention_layernorm.bias": "model-00010-of-00017.safetensors",
304
+ "model.layers.27.self_attn.q_proj.weight": "model-00010-of-00017.safetensors",
305
+ "model.layers.27.self_attn.k_proj.weight": "model-00010-of-00017.safetensors",
306
+ "model.layers.27.self_attn.v_proj.weight": "model-00010-of-00017.safetensors",
307
+ "model.layers.27.self_attn.o_proj.weight": "model-00010-of-00017.safetensors",
308
+ "model.layers.27.mlp.gate_proj.weight": "model-00010-of-00017.safetensors",
309
+ "model.layers.27.mlp.up_proj.weight": "model-00010-of-00017.safetensors",
310
+ "model.layers.27.mlp.down_proj.weight": "model-00010-of-00017.safetensors",
311
+ "model.layers.27.input_layernorm.weight": "model-00010-of-00017.safetensors",
312
+ "model.layers.27.input_layernorm.bias": "model-00010-of-00017.safetensors",
313
+ "model.layers.27.post_attention_layernorm.weight": "model-00010-of-00017.safetensors",
314
+ "model.layers.27.post_attention_layernorm.bias": "model-00010-of-00017.safetensors",
315
+ "model.layers.28.self_attn.q_proj.weight": "model-00010-of-00017.safetensors",
316
+ "model.layers.28.self_attn.k_proj.weight": "model-00010-of-00017.safetensors",
317
+ "model.layers.28.self_attn.v_proj.weight": "model-00010-of-00017.safetensors",
318
+ "model.layers.28.self_attn.o_proj.weight": "model-00010-of-00017.safetensors",
319
+ "model.layers.28.mlp.gate_proj.weight": "model-00010-of-00017.safetensors",
320
+ "model.layers.28.mlp.up_proj.weight": "model-00010-of-00017.safetensors",
321
+ "model.layers.28.mlp.down_proj.weight": "model-00011-of-00017.safetensors",
322
+ "model.layers.28.input_layernorm.weight": "model-00011-of-00017.safetensors",
323
+ "model.layers.28.input_layernorm.bias": "model-00011-of-00017.safetensors",
324
+ "model.layers.28.post_attention_layernorm.weight": "model-00011-of-00017.safetensors",
325
+ "model.layers.28.post_attention_layernorm.bias": "model-00011-of-00017.safetensors",
326
+ "model.layers.29.self_attn.q_proj.weight": "model-00011-of-00017.safetensors",
327
+ "model.layers.29.self_attn.k_proj.weight": "model-00011-of-00017.safetensors",
328
+ "model.layers.29.self_attn.v_proj.weight": "model-00011-of-00017.safetensors",
329
+ "model.layers.29.self_attn.o_proj.weight": "model-00011-of-00017.safetensors",
330
+ "model.layers.29.mlp.gate_proj.weight": "model-00011-of-00017.safetensors",
331
+ "model.layers.29.mlp.up_proj.weight": "model-00011-of-00017.safetensors",
332
+ "model.layers.29.mlp.down_proj.weight": "model-00011-of-00017.safetensors",
333
+ "model.layers.29.input_layernorm.weight": "model-00011-of-00017.safetensors",
334
+ "model.layers.29.input_layernorm.bias": "model-00011-of-00017.safetensors",
335
+ "model.layers.29.post_attention_layernorm.weight": "model-00011-of-00017.safetensors",
336
+ "model.layers.29.post_attention_layernorm.bias": "model-00011-of-00017.safetensors",
337
+ "model.layers.30.self_attn.q_proj.weight": "model-00011-of-00017.safetensors",
338
+ "model.layers.30.self_attn.k_proj.weight": "model-00011-of-00017.safetensors",
339
+ "model.layers.30.self_attn.v_proj.weight": "model-00011-of-00017.safetensors",
340
+ "model.layers.30.self_attn.o_proj.weight": "model-00011-of-00017.safetensors",
341
+ "model.layers.30.mlp.gate_proj.weight": "model-00011-of-00017.safetensors",
342
+ "model.layers.30.mlp.up_proj.weight": "model-00011-of-00017.safetensors",
343
+ "model.layers.30.mlp.down_proj.weight": "model-00011-of-00017.safetensors",
344
+ "model.layers.30.input_layernorm.weight": "model-00011-of-00017.safetensors",
345
+ "model.layers.30.input_layernorm.bias": "model-00011-of-00017.safetensors",
346
+ "model.layers.30.post_attention_layernorm.weight": "model-00011-of-00017.safetensors",
347
+ "model.layers.30.post_attention_layernorm.bias": "model-00011-of-00017.safetensors",
348
+ "model.layers.31.self_attn.q_proj.weight": "model-00011-of-00017.safetensors",
349
+ "model.layers.31.self_attn.k_proj.weight": "model-00011-of-00017.safetensors",
350
+ "model.layers.31.self_attn.v_proj.weight": "model-00011-of-00017.safetensors",
351
+ "model.layers.31.self_attn.o_proj.weight": "model-00011-of-00017.safetensors",
352
+ "model.layers.31.mlp.gate_proj.weight": "model-00011-of-00017.safetensors",
353
+ "model.layers.31.mlp.up_proj.weight": "model-00011-of-00017.safetensors",
354
+ "model.layers.31.mlp.down_proj.weight": "model-00012-of-00017.safetensors",
355
+ "model.layers.31.input_layernorm.weight": "model-00012-of-00017.safetensors",
356
+ "model.layers.31.input_layernorm.bias": "model-00012-of-00017.safetensors",
357
+ "model.layers.31.post_attention_layernorm.weight": "model-00012-of-00017.safetensors",
358
+ "model.layers.31.post_attention_layernorm.bias": "model-00012-of-00017.safetensors",
359
+ "model.layers.32.self_attn.q_proj.weight": "model-00012-of-00017.safetensors",
360
+ "model.layers.32.self_attn.k_proj.weight": "model-00012-of-00017.safetensors",
361
+ "model.layers.32.self_attn.v_proj.weight": "model-00012-of-00017.safetensors",
362
+ "model.layers.32.self_attn.o_proj.weight": "model-00012-of-00017.safetensors",
363
+ "model.layers.32.mlp.gate_proj.weight": "model-00012-of-00017.safetensors",
364
+ "model.layers.32.mlp.up_proj.weight": "model-00012-of-00017.safetensors",
365
+ "model.layers.32.mlp.down_proj.weight": "model-00012-of-00017.safetensors",
366
+ "model.layers.32.input_layernorm.weight": "model-00012-of-00017.safetensors",
367
+ "model.layers.32.input_layernorm.bias": "model-00012-of-00017.safetensors",
368
+ "model.layers.32.post_attention_layernorm.weight": "model-00012-of-00017.safetensors",
369
+ "model.layers.32.post_attention_layernorm.bias": "model-00012-of-00017.safetensors",
370
+ "model.layers.33.self_attn.q_proj.weight": "model-00012-of-00017.safetensors",
371
+ "model.layers.33.self_attn.k_proj.weight": "model-00012-of-00017.safetensors",
372
+ "model.layers.33.self_attn.v_proj.weight": "model-00012-of-00017.safetensors",
373
+ "model.layers.33.self_attn.o_proj.weight": "model-00012-of-00017.safetensors",
374
+ "model.layers.33.mlp.gate_proj.weight": "model-00012-of-00017.safetensors",
375
+ "model.layers.33.mlp.up_proj.weight": "model-00012-of-00017.safetensors",
376
+ "model.layers.33.mlp.down_proj.weight": "model-00012-of-00017.safetensors",
377
+ "model.layers.33.input_layernorm.weight": "model-00012-of-00017.safetensors",
378
+ "model.layers.33.input_layernorm.bias": "model-00012-of-00017.safetensors",
379
+ "model.layers.33.post_attention_layernorm.weight": "model-00012-of-00017.safetensors",
380
+ "model.layers.33.post_attention_layernorm.bias": "model-00012-of-00017.safetensors",
381
+ "model.layers.34.self_attn.q_proj.weight": "model-00012-of-00017.safetensors",
382
+ "model.layers.34.self_attn.k_proj.weight": "model-00012-of-00017.safetensors",
383
+ "model.layers.34.self_attn.v_proj.weight": "model-00012-of-00017.safetensors",
384
+ "model.layers.34.self_attn.o_proj.weight": "model-00012-of-00017.safetensors",
385
+ "model.layers.34.mlp.gate_proj.weight": "model-00012-of-00017.safetensors",
386
+ "model.layers.34.mlp.up_proj.weight": "model-00012-of-00017.safetensors",
387
+ "model.layers.34.mlp.down_proj.weight": "model-00013-of-00017.safetensors",
388
+ "model.layers.34.input_layernorm.weight": "model-00013-of-00017.safetensors",
389
+ "model.layers.34.input_layernorm.bias": "model-00013-of-00017.safetensors",
390
+ "model.layers.34.post_attention_layernorm.weight": "model-00013-of-00017.safetensors",
391
+ "model.layers.34.post_attention_layernorm.bias": "model-00013-of-00017.safetensors",
392
+ "model.layers.35.self_attn.q_proj.weight": "model-00013-of-00017.safetensors",
393
+ "model.layers.35.self_attn.k_proj.weight": "model-00013-of-00017.safetensors",
394
+ "model.layers.35.self_attn.v_proj.weight": "model-00013-of-00017.safetensors",
395
+ "model.layers.35.self_attn.o_proj.weight": "model-00013-of-00017.safetensors",
396
+ "model.layers.35.mlp.gate_proj.weight": "model-00013-of-00017.safetensors",
397
+ "model.layers.35.mlp.up_proj.weight": "model-00013-of-00017.safetensors",
398
+ "model.layers.35.mlp.down_proj.weight": "model-00013-of-00017.safetensors",
399
+ "model.layers.35.input_layernorm.weight": "model-00013-of-00017.safetensors",
400
+ "model.layers.35.input_layernorm.bias": "model-00013-of-00017.safetensors",
401
+ "model.layers.35.post_attention_layernorm.weight": "model-00013-of-00017.safetensors",
402
+ "model.layers.35.post_attention_layernorm.bias": "model-00013-of-00017.safetensors",
403
+ "model.layers.36.self_attn.q_proj.weight": "model-00013-of-00017.safetensors",
404
+ "model.layers.36.self_attn.k_proj.weight": "model-00013-of-00017.safetensors",
405
+ "model.layers.36.self_attn.v_proj.weight": "model-00013-of-00017.safetensors",
406
+ "model.layers.36.self_attn.o_proj.weight": "model-00013-of-00017.safetensors",
407
+ "model.layers.36.mlp.gate_proj.weight": "model-00013-of-00017.safetensors",
408
+ "model.layers.36.mlp.up_proj.weight": "model-00013-of-00017.safetensors",
409
+ "model.layers.36.mlp.down_proj.weight": "model-00013-of-00017.safetensors",
410
+ "model.layers.36.input_layernorm.weight": "model-00013-of-00017.safetensors",
411
+ "model.layers.36.input_layernorm.bias": "model-00013-of-00017.safetensors",
412
+ "model.layers.36.post_attention_layernorm.weight": "model-00013-of-00017.safetensors",
413
+ "model.layers.36.post_attention_layernorm.bias": "model-00013-of-00017.safetensors",
414
+ "model.layers.37.self_attn.q_proj.weight": "model-00013-of-00017.safetensors",
415
+ "model.layers.37.self_attn.k_proj.weight": "model-00013-of-00017.safetensors",
416
+ "model.layers.37.self_attn.v_proj.weight": "model-00013-of-00017.safetensors",
417
+ "model.layers.37.self_attn.o_proj.weight": "model-00013-of-00017.safetensors",
418
+ "model.layers.37.mlp.gate_proj.weight": "model-00013-of-00017.safetensors",
419
+ "model.layers.37.mlp.up_proj.weight": "model-00013-of-00017.safetensors",
420
+ "model.layers.37.mlp.down_proj.weight": "model-00014-of-00017.safetensors",
421
+ "model.layers.37.input_layernorm.weight": "model-00014-of-00017.safetensors",
422
+ "model.layers.37.input_layernorm.bias": "model-00014-of-00017.safetensors",
423
+ "model.layers.37.post_attention_layernorm.weight": "model-00014-of-00017.safetensors",
424
+ "model.layers.37.post_attention_layernorm.bias": "model-00014-of-00017.safetensors",
425
+ "model.layers.38.self_attn.q_proj.weight": "model-00014-of-00017.safetensors",
426
+ "model.layers.38.self_attn.k_proj.weight": "model-00014-of-00017.safetensors",
427
+ "model.layers.38.self_attn.v_proj.weight": "model-00014-of-00017.safetensors",
428
+ "model.layers.38.self_attn.o_proj.weight": "model-00014-of-00017.safetensors",
429
+ "model.layers.38.mlp.gate_proj.weight": "model-00014-of-00017.safetensors",
430
+ "model.layers.38.mlp.up_proj.weight": "model-00014-of-00017.safetensors",
431
+ "model.layers.38.mlp.down_proj.weight": "model-00014-of-00017.safetensors",
432
+ "model.layers.38.input_layernorm.weight": "model-00014-of-00017.safetensors",
433
+ "model.layers.38.input_layernorm.bias": "model-00014-of-00017.safetensors",
434
+ "model.layers.38.post_attention_layernorm.weight": "model-00014-of-00017.safetensors",
435
+ "model.layers.38.post_attention_layernorm.bias": "model-00014-of-00017.safetensors",
436
+ "model.layers.39.self_attn.q_proj.weight": "model-00014-of-00017.safetensors",
437
+ "model.layers.39.self_attn.k_proj.weight": "model-00014-of-00017.safetensors",
438
+ "model.layers.39.self_attn.v_proj.weight": "model-00014-of-00017.safetensors",
439
+ "model.layers.39.self_attn.o_proj.weight": "model-00014-of-00017.safetensors",
440
+ "model.layers.39.mlp.gate_proj.weight": "model-00014-of-00017.safetensors",
441
+ "model.layers.39.mlp.up_proj.weight": "model-00014-of-00017.safetensors",
442
+ "model.layers.39.mlp.down_proj.weight": "model-00014-of-00017.safetensors",
443
+ "model.layers.39.input_layernorm.weight": "model-00014-of-00017.safetensors",
444
+ "model.layers.39.input_layernorm.bias": "model-00014-of-00017.safetensors",
445
+ "model.layers.39.post_attention_layernorm.weight": "model-00014-of-00017.safetensors",
446
+ "model.layers.39.post_attention_layernorm.bias": "model-00014-of-00017.safetensors",
447
+ "model.layers.40.self_attn.q_proj.weight": "model-00014-of-00017.safetensors",
448
+ "model.layers.40.self_attn.k_proj.weight": "model-00014-of-00017.safetensors",
449
+ "model.layers.40.self_attn.v_proj.weight": "model-00014-of-00017.safetensors",
450
+ "model.layers.40.self_attn.o_proj.weight": "model-00014-of-00017.safetensors",
451
+ "model.layers.40.mlp.gate_proj.weight": "model-00014-of-00017.safetensors",
452
+ "model.layers.40.mlp.up_proj.weight": "model-00014-of-00017.safetensors",
453
+ "model.layers.40.mlp.down_proj.weight": "model-00015-of-00017.safetensors",
454
+ "model.layers.40.input_layernorm.weight": "model-00015-of-00017.safetensors",
455
+ "model.layers.40.input_layernorm.bias": "model-00015-of-00017.safetensors",
456
+ "model.layers.40.post_attention_layernorm.weight": "model-00015-of-00017.safetensors",
457
+ "model.layers.40.post_attention_layernorm.bias": "model-00015-of-00017.safetensors",
458
+ "model.layers.41.self_attn.q_proj.weight": "model-00015-of-00017.safetensors",
459
+ "model.layers.41.self_attn.k_proj.weight": "model-00015-of-00017.safetensors",
460
+ "model.layers.41.self_attn.v_proj.weight": "model-00015-of-00017.safetensors",
461
+ "model.layers.41.self_attn.o_proj.weight": "model-00015-of-00017.safetensors",
462
+ "model.layers.41.mlp.gate_proj.weight": "model-00015-of-00017.safetensors",
463
+ "model.layers.41.mlp.up_proj.weight": "model-00015-of-00017.safetensors",
464
+ "model.layers.41.mlp.down_proj.weight": "model-00015-of-00017.safetensors",
465
+ "model.layers.41.input_layernorm.weight": "model-00015-of-00017.safetensors",
466
+ "model.layers.41.input_layernorm.bias": "model-00015-of-00017.safetensors",
467
+ "model.layers.41.post_attention_layernorm.weight": "model-00015-of-00017.safetensors",
468
+ "model.layers.41.post_attention_layernorm.bias": "model-00015-of-00017.safetensors",
469
+ "model.layers.42.self_attn.q_proj.weight": "model-00015-of-00017.safetensors",
470
+ "model.layers.42.self_attn.k_proj.weight": "model-00015-of-00017.safetensors",
471
+ "model.layers.42.self_attn.v_proj.weight": "model-00015-of-00017.safetensors",
472
+ "model.layers.42.self_attn.o_proj.weight": "model-00015-of-00017.safetensors",
473
+ "model.layers.42.mlp.gate_proj.weight": "model-00015-of-00017.safetensors",
474
+ "model.layers.42.mlp.up_proj.weight": "model-00015-of-00017.safetensors",
475
+ "model.layers.42.mlp.down_proj.weight": "model-00015-of-00017.safetensors",
476
+ "model.layers.42.input_layernorm.weight": "model-00015-of-00017.safetensors",
477
+ "model.layers.42.input_layernorm.bias": "model-00015-of-00017.safetensors",
478
+ "model.layers.42.post_attention_layernorm.weight": "model-00015-of-00017.safetensors",
479
+ "model.layers.42.post_attention_layernorm.bias": "model-00015-of-00017.safetensors",
480
+ "model.layers.43.self_attn.q_proj.weight": "model-00015-of-00017.safetensors",
481
+ "model.layers.43.self_attn.k_proj.weight": "model-00015-of-00017.safetensors",
482
+ "model.layers.43.self_attn.v_proj.weight": "model-00015-of-00017.safetensors",
483
+ "model.layers.43.self_attn.o_proj.weight": "model-00015-of-00017.safetensors",
484
+ "model.layers.43.mlp.gate_proj.weight": "model-00015-of-00017.safetensors",
485
+ "model.layers.43.mlp.up_proj.weight": "model-00015-of-00017.safetensors",
486
+ "model.layers.43.mlp.down_proj.weight": "model-00016-of-00017.safetensors",
487
+ "model.layers.43.input_layernorm.weight": "model-00016-of-00017.safetensors",
488
+ "model.layers.43.input_layernorm.bias": "model-00016-of-00017.safetensors",
489
+ "model.layers.43.post_attention_layernorm.weight": "model-00016-of-00017.safetensors",
490
+ "model.layers.43.post_attention_layernorm.bias": "model-00016-of-00017.safetensors",
491
+ "model.layers.44.self_attn.q_proj.weight": "model-00016-of-00017.safetensors",
492
+ "model.layers.44.self_attn.k_proj.weight": "model-00016-of-00017.safetensors",
493
+ "model.layers.44.self_attn.v_proj.weight": "model-00016-of-00017.safetensors",
494
+ "model.layers.44.self_attn.o_proj.weight": "model-00016-of-00017.safetensors",
495
+ "model.layers.44.mlp.gate_proj.weight": "model-00016-of-00017.safetensors",
496
+ "model.layers.44.mlp.up_proj.weight": "model-00016-of-00017.safetensors",
497
+ "model.layers.44.mlp.down_proj.weight": "model-00016-of-00017.safetensors",
498
+ "model.layers.44.input_layernorm.weight": "model-00016-of-00017.safetensors",
499
+ "model.layers.44.input_layernorm.bias": "model-00016-of-00017.safetensors",
500
+ "model.layers.44.post_attention_layernorm.weight": "model-00016-of-00017.safetensors",
501
+ "model.layers.44.post_attention_layernorm.bias": "model-00016-of-00017.safetensors",
502
+ "model.layers.45.self_attn.q_proj.weight": "model-00016-of-00017.safetensors",
503
+ "model.layers.45.self_attn.k_proj.weight": "model-00016-of-00017.safetensors",
504
+ "model.layers.45.self_attn.v_proj.weight": "model-00016-of-00017.safetensors",
505
+ "model.layers.45.self_attn.o_proj.weight": "model-00016-of-00017.safetensors",
506
+ "model.layers.45.mlp.gate_proj.weight": "model-00016-of-00017.safetensors",
507
+ "model.layers.45.mlp.up_proj.weight": "model-00016-of-00017.safetensors",
508
+ "model.layers.45.mlp.down_proj.weight": "model-00016-of-00017.safetensors",
509
+ "model.layers.45.input_layernorm.weight": "model-00016-of-00017.safetensors",
510
+ "model.layers.45.input_layernorm.bias": "model-00016-of-00017.safetensors",
511
+ "model.layers.45.post_attention_layernorm.weight": "model-00016-of-00017.safetensors",
512
+ "model.layers.45.post_attention_layernorm.bias": "model-00016-of-00017.safetensors",
513
+ "model.layers.46.self_attn.q_proj.weight": "model-00016-of-00017.safetensors",
514
+ "model.layers.46.self_attn.k_proj.weight": "model-00016-of-00017.safetensors",
515
+ "model.layers.46.self_attn.v_proj.weight": "model-00016-of-00017.safetensors",
516
+ "model.layers.46.self_attn.o_proj.weight": "model-00016-of-00017.safetensors",
517
+ "model.layers.46.mlp.gate_proj.weight": "model-00016-of-00017.safetensors",
518
+ "model.layers.46.mlp.up_proj.weight": "model-00016-of-00017.safetensors",
519
+ "model.layers.46.mlp.down_proj.weight": "model-00017-of-00017.safetensors",
520
+ "model.layers.46.input_layernorm.weight": "model-00017-of-00017.safetensors",
521
+ "model.layers.46.input_layernorm.bias": "model-00017-of-00017.safetensors",
522
+ "model.layers.46.post_attention_layernorm.weight": "model-00017-of-00017.safetensors",
523
+ "model.layers.46.post_attention_layernorm.bias": "model-00017-of-00017.safetensors",
524
+ "model.layers.47.self_attn.q_proj.weight": "model-00017-of-00017.safetensors",
525
+ "model.layers.47.self_attn.k_proj.weight": "model-00017-of-00017.safetensors",
526
+ "model.layers.47.self_attn.v_proj.weight": "model-00017-of-00017.safetensors",
527
+ "model.layers.47.self_attn.o_proj.weight": "model-00017-of-00017.safetensors",
528
+ "model.layers.47.mlp.gate_proj.weight": "model-00017-of-00017.safetensors",
529
+ "model.layers.47.mlp.up_proj.weight": "model-00017-of-00017.safetensors",
530
+ "model.layers.47.mlp.down_proj.weight": "model-00017-of-00017.safetensors",
531
+ "model.layers.47.input_layernorm.weight": "model-00017-of-00017.safetensors",
532
+ "model.layers.47.input_layernorm.bias": "model-00017-of-00017.safetensors",
533
+ "model.layers.47.post_attention_layernorm.weight": "model-00017-of-00017.safetensors",
534
+ "model.layers.47.post_attention_layernorm.bias": "model-00017-of-00017.safetensors",
535
+ "model.norm.weight": "model-00017-of-00017.safetensors",
536
+ "model.norm.bias": "model-00017-of-00017.safetensors",
537
+ "lm_head.weight": "model-00017-of-00017.safetensors"
538
+ }
539
+ }
modeling_inflm.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ """PyTorch INFLM model."""
21
+
22
+ import torch
23
+ from torch import nn
24
+ from transformers.models.llama.modeling_llama import (
25
+ LlamaDecoderLayer,
26
+ LlamaModel,
27
+ LlamaForCausalLM
28
+ )
29
+ from .configuration_inflm import INFLMConfig
30
+
31
+ _CONFIG_FOR_DOC = "INFLMConfig"
32
+
33
+
34
+ class INFLMDecoderLayer(LlamaDecoderLayer):
35
+ def __init__(self, config: INFLMConfig, layer_idx: int):
36
+ super().__init__(config, layer_idx)
37
+ self.input_layernorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
38
+ self.post_attention_layernorm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
39
+
40
+
41
+ class INFLMModel(LlamaModel):
42
+ config_class = INFLMConfig
43
+ _no_split_modules = ["INFLMDecoderLayer"]
44
+
45
+ def __init__(self, config: INFLMConfig):
46
+ super().__init__(config)
47
+ self.padding_idx = config.pad_token_id
48
+ self.vocab_size = config.vocab_size
49
+
50
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
51
+ self.layers = nn.ModuleList([INFLMDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)])
52
+ self.norm = nn.LayerNorm(config.hidden_size, eps=config.layer_norm_eps)
53
+
54
+ self.gradient_checkpointing = False
55
+ # Initialize weights and apply final processing
56
+ self.post_init()
57
+
58
+
59
+ class INFLMForCausalLM(LlamaForCausalLM):
60
+ _tied_weights_keys = ["lm_head.weight"]
61
+
62
+ def __init__(self, config: INFLMConfig):
63
+ super().__init__(config)
64
+ self.model = INFLMModel(config)
65
+ self.vocab_size = config.vocab_size
66
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
67
+
68
+ # Initialize weights and apply final processing
69
+ self.post_init()
special_tokens_map.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ {
4
+ "content": "<|start|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ {
11
+ "content": "<|end|>",
12
+ "lstrip": false,
13
+ "normalized": false,
14
+ "rstrip": false,
15
+ "single_word": false
16
+ },
17
+ {
18
+ "content": "<|message|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ {
25
+ "content": "<|tool_start|>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ },
31
+ {
32
+ "content": "<|tool_excute|>",
33
+ "lstrip": false,
34
+ "normalized": false,
35
+ "rstrip": false,
36
+ "single_word": false
37
+ },
38
+ {
39
+ "content": "<|tool_end|>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false
44
+ },
45
+ {
46
+ "content": "<|pad|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false
51
+ },
52
+ {
53
+ "content": "<|endoftext|>",
54
+ "lstrip": false,
55
+ "normalized": false,
56
+ "rstrip": false,
57
+ "single_word": false
58
+ }
59
+ ],
60
+ "bos_token": "<s>",
61
+ "eos_token": "</s>",
62
+ "pad_token": "<pad>",
63
+ "unk_token": "<unk>"
64
+ }
tokenization_inflm.py ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+
21
+ """Tokenization classes for INFLMTokenizer."""
22
+ import os
23
+ from shutil import copyfile
24
+ from typing import Any, Dict, List, Optional, Tuple
25
+
26
+ import sentencepiece as spm
27
+
28
+ from transformers.tokenization_utils import PreTrainedTokenizer
29
+ from transformers.utils import logging
30
+
31
+ from tokenizers import pre_tokenizers,Regex,decoders
32
+ from tokenizers.pre_tokenizers import Digits, Split, ByteLevel
33
+ import os
34
+
35
+ # same as gpt4 cl-base-100k
36
+ PATTERN = Regex("(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}{1,3}| ?[^\s\p{L}\p{N}]+[\r\n]*|\s*[\r\n]+|\s+(?!\S)|\s+\s+(\S)+")
37
+
38
+ logger = logging.get_logger(__name__)
39
+
40
+ VOCAB_FILES_NAMES = {"vocab_file": "./tokenizer.model"}
41
+
42
+ PRETRAINED_VOCAB_FILES_MAP = {}
43
+
44
+
45
+ class INFLMTokenizer(PreTrainedTokenizer):
46
+ """
47
+ Construct a INFLMTokenizer tokenizer based on sentence-piece
48
+
49
+ Args:
50
+ vocab_file (`str`):
51
+ Path to the vocabulary file.
52
+ """
53
+
54
+ vocab_files_names = VOCAB_FILES_NAMES
55
+ pretrained_vocab_files_map = PRETRAINED_VOCAB_FILES_MAP
56
+ model_input_names = ["input_ids", "attention_mask"]
57
+ _auto_class = "AutoTokenizer"
58
+
59
+ def __init__(
60
+ self,
61
+ vocab_file,
62
+ unk_token="<unk>",
63
+ bos_token="<s>",
64
+ eos_token="</s>",
65
+ pad_token="<pad>",
66
+ sp_model_kwargs: Optional[Dict[str, Any]] = None,
67
+ add_bos_token=False,
68
+ add_eos_token=False,
69
+ decode_with_prefix_space=False,
70
+ clean_up_tokenization_spaces=False,
71
+ spaces_between_special_tokens=False,
72
+ **kwargs,
73
+ ):
74
+ self.sp_model_kwargs = {} if sp_model_kwargs is None else sp_model_kwargs
75
+ self.vocab_file = vocab_file
76
+ self.add_bos_token = add_bos_token
77
+ self.add_eos_token = add_eos_token
78
+ self.decode_with_prefix_space = decode_with_prefix_space
79
+ self.sp_model = spm.SentencePieceProcessor(**self.sp_model_kwargs)
80
+ self.sp_model.Load(vocab_file)
81
+ self._no_prefix_space_tokens = None
82
+ self.pre_tokenizer = pre_tokenizers.Sequence([Split(pattern =PATTERN,behavior = "isolated", invert = False)])
83
+ super().__init__(
84
+ bos_token=bos_token,
85
+ eos_token=eos_token,
86
+ unk_token=unk_token,
87
+ pad_token=pad_token,
88
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
89
+ spaces_between_special_tokens=spaces_between_special_tokens,
90
+ **kwargs,
91
+ )
92
+
93
+ """ Initialisation"""
94
+
95
+ @property
96
+ def no_prefix_space_tokens(self):
97
+ if self._no_prefix_space_tokens is None:
98
+ vocab = self.convert_ids_to_tokens(list(range(self.vocab_size)))
99
+ self._no_prefix_space_tokens = {i for i, tok in enumerate(vocab) if not tok.startswith("▁")}
100
+ return self._no_prefix_space_tokens
101
+
102
+ @property
103
+ def vocab_size(self):
104
+ """Returns vocab size"""
105
+ return self.sp_model.get_piece_size()
106
+
107
+ @property
108
+ def bos_token_id(self) -> Optional[int]:
109
+ return self.sp_model.bos_id()
110
+
111
+ @property
112
+ def eos_token_id(self) -> Optional[int]:
113
+ return self.sp_model.eos_id()
114
+
115
+ def get_vocab(self):
116
+ """Returns vocab as a dict"""
117
+ vocab = {self.convert_ids_to_tokens(i): i for i in range(self.vocab_size)}
118
+ vocab.update(self.added_tokens_encoder)
119
+ return vocab
120
+
121
+ def _tokenize(self, text):
122
+ """Returns a tokenized string."""
123
+
124
+ splits = self.pre_tokenizer.pre_tokenize_str(text)
125
+ texts=[]
126
+
127
+ for split in splits:
128
+ texts.extend(self.sp_model.encode(split[0], out_type=str))
129
+ return texts
130
+
131
+ def _convert_token_to_id(self, token):
132
+ """Converts a token (str) in an id using the vocab."""
133
+
134
+ return self.sp_model.piece_to_id(token)
135
+
136
+ def _convert_id_to_token(self, index):
137
+ """Converts an index (integer) in a token (str) using the vocab."""
138
+ token = self.sp_model.IdToPiece(index)
139
+ return token
140
+
141
+ def _maybe_add_prefix_space(self, tokens, decoded):
142
+ if tokens and tokens[0] not in self.no_prefix_space_tokens:
143
+ return " " + decoded
144
+ else:
145
+ return decoded
146
+
147
+ def convert_tokens_to_string(self, tokens):
148
+ """Converts a sequence of tokens (string) in a single string."""
149
+ current_sub_tokens = []
150
+ out_string = ""
151
+ prev_is_special = False
152
+ for token in tokens:
153
+ # make sure that special tokens are not decoded using sentencepiece model
154
+ if token in self.all_special_tokens:
155
+ out_string += self.sp_model.decode(current_sub_tokens) + token
156
+ prev_is_special = True
157
+ current_sub_tokens = []
158
+ else:
159
+ current_sub_tokens.append(token)
160
+ prev_is_special = False
161
+ out_string += self.sp_model.decode(current_sub_tokens)
162
+
163
+ return out_string
164
+
165
+ def save_vocabulary(self, save_directory, filename_prefix: Optional[str] = None) -> Tuple[str]:
166
+ """
167
+ Save the vocabulary and special tokens file to a directory.
168
+
169
+ Args:
170
+ save_directory (`str`):
171
+ The directory in which to save the vocabulary.
172
+
173
+ Returns:
174
+ `Tuple(str)`: Paths to the files saved.
175
+ """
176
+ if not os.path.isdir(save_directory):
177
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
178
+ return
179
+ out_vocab_file = os.path.join(
180
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
181
+ )
182
+
183
+ if os.path.abspath(self.vocab_file) != os.path.abspath(out_vocab_file) and os.path.isfile(self.vocab_file):
184
+ copyfile(self.vocab_file, out_vocab_file)
185
+ elif not os.path.isfile(self.vocab_file):
186
+ with open(out_vocab_file, "wb") as fi:
187
+ content_spiece_model = self.sp_model.serialized_model_proto()
188
+ fi.write(content_spiece_model)
189
+
190
+ return (out_vocab_file,)
191
+
192
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
193
+ if self.add_bos_token:
194
+ bos_token_ids = [self.bos_token_id]
195
+ else:
196
+ bos_token_ids = []
197
+
198
+ output = bos_token_ids + token_ids_0
199
+
200
+ if token_ids_1 is not None:
201
+ output = output + token_ids_1
202
+
203
+ if self.add_eos_token:
204
+ output = output + [self.eos_token_id]
205
+
206
+ return output
207
+
208
+ def get_special_tokens_mask(
209
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None, already_has_special_tokens: bool = False
210
+ ) -> List[int]:
211
+ """
212
+ Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
213
+ special tokens using the tokenizer `prepare_for_model` method.
214
+
215
+ Args:
216
+ token_ids_0 (`List[int]`):
217
+ List of IDs.
218
+ token_ids_1 (`List[int]`, *optional*):
219
+ Optional second list of IDs for sequence pairs.
220
+ already_has_special_tokens (`bool`, *optional*, defaults to `False`):
221
+ Whether or not the token list is already formatted with special tokens for the model.
222
+
223
+ Returns:
224
+ `List[int]`: A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
225
+ """
226
+ if already_has_special_tokens:
227
+ return super().get_special_tokens_mask(
228
+ token_ids_0=token_ids_0, token_ids_1=token_ids_1, already_has_special_tokens=True
229
+ )
230
+
231
+ eos_token_id = [1] if self.add_eos_token else []
232
+ if token_ids_1 is None:
233
+ return ([0] * len(token_ids_0)) + eos_token_id
234
+ return ([0] * len(token_ids_0)) + eos_token_id + ([0] * len(token_ids_1)) + eos_token_id
235
+
236
+
237
+ def create_token_type_ids_from_sequences(
238
+ self, token_ids_0: List[int], token_ids_1: Optional[List[int]] = None
239
+ ) -> List[int]:
240
+ """
241
+ Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT
242
+ sequence pair mask has the following format:
243
+
244
+ ```
245
+ 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
246
+ | first sequence | second sequence |
247
+ ```
248
+
249
+ if token_ids_1 is None, only returns the first portion of the mask (0s).
250
+
251
+ Note this is only used for back compatiblity, thus list of zero is returned.
252
+
253
+ Args:
254
+ token_ids_0 (`List[int]`):
255
+ List of ids.
256
+ token_ids_1 (`List[int]`, *optional*):
257
+ Optional second list of IDs for sequence pairs.
258
+
259
+ Returns:
260
+ `List[int]`: List of zeros.
261
+ """
262
+ eos = [self.eos_token_id]
263
+
264
+ if token_ids_1 is None:
265
+ return len(token_ids_0 + eos) * [0]
266
+ return len(token_ids_0 + eos + token_ids_1 + eos) * [0]
267
+
268
+
269
+ @property
270
+ def default_chat_template(self):
271
+ return None
272
+
273
+
274
+ def decode(
275
+ self,
276
+ token_ids,
277
+ skip_special_tokens: bool = False,
278
+ clean_up_tokenization_spaces: Optional[bool] = False,
279
+ spaces_between_special_tokens: bool = False,
280
+ **kwargs,
281
+ ) -> str:
282
+ # default spaces_between_special_tokens should be false.
283
+ if spaces_between_special_tokens:
284
+ logger.warning_once('spaces_between_special_tokens is set. \
285
+ It has no effect for bos,eos,pad,unk when transformers<=4.38.')
286
+ return super().decode(
287
+ token_ids,
288
+ skip_special_tokens=skip_special_tokens,
289
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
290
+ spaces_between_special_tokens=spaces_between_special_tokens,
291
+ **kwargs,
292
+ )
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:76d43d618fc0c5a7c79dc4e72579f9f29bb803b36e4a4d709d1233626fd8fe2a
3
+ size 1535725
tokenizer_config.json ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<unk>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<s>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<pad>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "96499": {
36
+ "content": "<|start|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "96500": {
44
+ "content": "<|end|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "96501": {
52
+ "content": "<|message|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "96502": {
60
+ "content": "<|tool_start|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "96503": {
68
+ "content": "<|tool_excute|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "96504": {
76
+ "content": "<|tool_end|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "96505": {
84
+ "content": "<|pad|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "96506": {
92
+ "content": "<|endoftext|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ }
99
+ },
100
+ "additional_special_tokens": [
101
+ "<|start|>",
102
+ "<|end|>",
103
+ "<|message|>",
104
+ "<|tool_start|>",
105
+ "<|tool_excute|>",
106
+ "<|tool_end|>",
107
+ "<|pad|>",
108
+ "<|endoftext|>"
109
+ ],
110
+ "auto_map": {
111
+ "AutoTokenizer": [
112
+ "tokenization_inflm.INFLMTokenizer",
113
+ null
114
+ ]
115
+ },
116
+ "add_bos_token": false,
117
+ "add_eos_token": false,
118
+ "add_prefix_space": false,
119
+ "bos_token": "<s>",
120
+ "clean_up_tokenization_spaces": false,
121
+ "eos_token": "</s>",
122
+ "model_max_length": 1000000000000000019884624838656,
123
+ "chat_template": "{% for message in messages %}{% if message['role'] == 'user' %}{% if not loop.first %}{{ '\\n' }}{% endif %}{{'<|start|>user\\n' + message['content'] + '<|end|>\\n' }}{% if (loop.last and add_generation_prompt) %}{{ '<|start|>assistant<|message|>' }}{% endif %}{% elif message['role'] == 'system' %}{{ '<|start|>system\\n' + message['content'] + '<|end|>' }}{% elif message['role'] == 'assistant' %}{{ '<|start|>assistant<|message|>' + message['content'] + '<|end|>' }}{% endif %}{% endfor %}",
124
+ "pad_token": "<pad>",
125
+ "return_tensors": true,
126
+ "spaces_between_special_tokens": false,
127
+ "tokenizer_class": "INFLMTokenizer",
128
+ "unk_token": "<unk>"
129
+ }