noneUsername
commited on
Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/config-checkpoint.json +39 -0
- .ipynb_checkpoints/tokenizer_config-checkpoint.json +68 -0
- added_tokens.json +5 -0
- config.json +39 -0
- generation_config.json +7 -0
- inputs_stats.pth +3 -0
- modeling_llama.py +1297 -0
- outputs_stats.pth +3 -0
- pytorch_model-00001-of-00007.bin +3 -0
- pytorch_model-00002-of-00007.bin +3 -0
- pytorch_model-00003-of-00007.bin +3 -0
- pytorch_model-00004-of-00007.bin +3 -0
- pytorch_model-00005-of-00007.bin +3 -0
- pytorch_model-00006-of-00007.bin +3 -0
- pytorch_model-00007-of-00007.bin +3 -0
- pytorch_model.bin.index.json +650 -0
- special_tokens_map.json +30 -0
- tokenizer.model +3 -0
- tokenizer_config.json +68 -0
.ipynb_checkpoints/config-checkpoint.json
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/root/autodl-tmp/Orca-2-13b",
|
3 |
+
"architectures": [
|
4 |
+
"LlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"auto_map": {
|
9 |
+
"AutoModel": "modeling_llama.LlamaForCausalLM",
|
10 |
+
"AutoModelForCausalLM": "modeling_llama.LlamaForCausalLM"
|
11 |
+
},
|
12 |
+
"bos_token_id": 1,
|
13 |
+
"eos_token_id": 2,
|
14 |
+
"fp16": true,
|
15 |
+
"head_dim": 128,
|
16 |
+
"hidden_act": "silu",
|
17 |
+
"hidden_size": 5120,
|
18 |
+
"initializer_range": 0.02,
|
19 |
+
"intermediate_size": 13824,
|
20 |
+
"max_position_embeddings": 4096,
|
21 |
+
"mlp_bias": false,
|
22 |
+
"model_type": "llama",
|
23 |
+
"num_attention_heads": 40,
|
24 |
+
"num_hidden_layers": 40,
|
25 |
+
"num_key_value_heads": 40,
|
26 |
+
"pad_token_id": 0,
|
27 |
+
"pretraining_tp": 1,
|
28 |
+
"quantization_config": {
|
29 |
+
"quant_method": "smooth_quant"
|
30 |
+
},
|
31 |
+
"rms_norm_eps": 1e-05,
|
32 |
+
"rope_scaling": null,
|
33 |
+
"rope_theta": 10000.0,
|
34 |
+
"tie_word_embeddings": false,
|
35 |
+
"torch_dtype": "float16",
|
36 |
+
"transformers_version": "4.45.2",
|
37 |
+
"use_cache": false,
|
38 |
+
"vocab_size": 32003
|
39 |
+
}
|
.ipynb_checkpoints/tokenizer_config-checkpoint.json
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": true,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "[PAD]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<|im_start|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": true,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": false
|
45 |
+
},
|
46 |
+
"32002": {
|
47 |
+
"content": "<|im_end|>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": true,
|
50 |
+
"rstrip": false,
|
51 |
+
"single_word": false,
|
52 |
+
"special": false
|
53 |
+
}
|
54 |
+
},
|
55 |
+
"bos_token": "<s>",
|
56 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
57 |
+
"clean_up_tokenization_spaces": false,
|
58 |
+
"eos_token": "</s>",
|
59 |
+
"legacy": false,
|
60 |
+
"model_max_length": 4096,
|
61 |
+
"pad_token": "[PAD]",
|
62 |
+
"padding_side": "right",
|
63 |
+
"sp_model_kwargs": {},
|
64 |
+
"spaces_between_special_tokens": false,
|
65 |
+
"tokenizer_class": "LlamaTokenizer",
|
66 |
+
"unk_token": "<unk>",
|
67 |
+
"use_default_system_prompt": true
|
68 |
+
}
|
added_tokens.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|im_end|>": 32002,
|
3 |
+
"<|im_start|>": 32001,
|
4 |
+
"[PAD]": 32000
|
5 |
+
}
|
config.json
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "/root/autodl-tmp/Orca-2-13b",
|
3 |
+
"architectures": [
|
4 |
+
"LlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"attention_bias": false,
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"auto_map": {
|
9 |
+
"AutoModel": "modeling_llama.LlamaForCausalLM",
|
10 |
+
"AutoModelForCausalLM": "modeling_llama.LlamaForCausalLM"
|
11 |
+
},
|
12 |
+
"bos_token_id": 1,
|
13 |
+
"eos_token_id": 2,
|
14 |
+
"fp16": true,
|
15 |
+
"head_dim": 128,
|
16 |
+
"hidden_act": "silu",
|
17 |
+
"hidden_size": 5120,
|
18 |
+
"initializer_range": 0.02,
|
19 |
+
"intermediate_size": 13824,
|
20 |
+
"max_position_embeddings": 4096,
|
21 |
+
"mlp_bias": false,
|
22 |
+
"model_type": "llama",
|
23 |
+
"num_attention_heads": 40,
|
24 |
+
"num_hidden_layers": 40,
|
25 |
+
"num_key_value_heads": 40,
|
26 |
+
"pad_token_id": 0,
|
27 |
+
"pretraining_tp": 1,
|
28 |
+
"quantization_config": {
|
29 |
+
"quant_method": "smooth_quant"
|
30 |
+
},
|
31 |
+
"rms_norm_eps": 1e-05,
|
32 |
+
"rope_scaling": null,
|
33 |
+
"rope_theta": 10000.0,
|
34 |
+
"tie_word_embeddings": false,
|
35 |
+
"torch_dtype": "float16",
|
36 |
+
"transformers_version": "4.45.2",
|
37 |
+
"use_cache": false,
|
38 |
+
"vocab_size": 32003
|
39 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 1,
|
3 |
+
"eos_token_id": 2,
|
4 |
+
"max_length": 4096,
|
5 |
+
"pad_token_id": 0,
|
6 |
+
"transformers_version": "4.45.2"
|
7 |
+
}
|
inputs_stats.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8b2a437a7155e3626dffd995ebebe6f00574ee9afee230c534b73fb4aa7ae81b
|
3 |
+
size 18211582
|
modeling_llama.py
ADDED
@@ -0,0 +1,1297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
|
2 |
+
#
|
3 |
+
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
|
4 |
+
# and OPT implementations in this library. It has been modified from its
|
5 |
+
# original forms to accommodate minor architectural differences compared
|
6 |
+
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
|
7 |
+
#
|
8 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9 |
+
# you may not use this file except in compliance with the License.
|
10 |
+
# You may obtain a copy of the License at
|
11 |
+
#
|
12 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13 |
+
#
|
14 |
+
# Unless required by applicable law or agreed to in writing, software
|
15 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17 |
+
# See the License for the specific language governing permissions and
|
18 |
+
# limitations under the License.
|
19 |
+
"""PyTorch LLaMA model."""
|
20 |
+
import math
|
21 |
+
from typing import List, Optional, Tuple, Union
|
22 |
+
|
23 |
+
import torch
|
24 |
+
import torch.nn.functional as F
|
25 |
+
import torch.utils.checkpoint
|
26 |
+
from torch import nn
|
27 |
+
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
|
28 |
+
from transformers.activations import ACT2FN
|
29 |
+
from transformers.modeling_outputs import (BaseModelOutputWithPast,
|
30 |
+
CausalLMOutputWithPast,
|
31 |
+
SequenceClassifierOutputWithPast)
|
32 |
+
from transformers.modeling_utils import PreTrainedModel
|
33 |
+
from transformers.models.llama.configuration_llama import LlamaConfig
|
34 |
+
from transformers.utils import (add_start_docstrings,
|
35 |
+
add_start_docstrings_to_model_forward,
|
36 |
+
replace_return_docstrings)
|
37 |
+
|
38 |
+
from lmdeploy.pytorch.modeling.convert_to_qmodules import convert_to_qmodules
|
39 |
+
from lmdeploy.utils import get_logger
|
40 |
+
|
41 |
+
logger = get_logger('lmdeploy')
|
42 |
+
|
43 |
+
_CONFIG_FOR_DOC = 'LlamaConfig'
|
44 |
+
|
45 |
+
|
46 |
+
# Copied from transformers.models.bart.modeling_bart._make_causal_mask
|
47 |
+
def _make_causal_mask(input_ids_shape: torch.Size,
|
48 |
+
dtype: torch.dtype,
|
49 |
+
device: torch.device,
|
50 |
+
past_key_values_length: int = 0):
|
51 |
+
"""Make causal mask used for bi-directional self-attention."""
|
52 |
+
bsz, tgt_len = input_ids_shape
|
53 |
+
mask = torch.full((tgt_len, tgt_len),
|
54 |
+
torch.finfo(dtype).min,
|
55 |
+
device=device)
|
56 |
+
mask_cond = torch.arange(mask.size(-1), device=device)
|
57 |
+
mask.masked_fill_(mask_cond < (mask_cond + 1).view(mask.size(-1), 1), 0)
|
58 |
+
mask = mask.to(dtype)
|
59 |
+
|
60 |
+
if past_key_values_length > 0:
|
61 |
+
mask = torch.cat([
|
62 |
+
torch.zeros(
|
63 |
+
tgt_len, past_key_values_length, dtype=dtype, device=device),
|
64 |
+
mask
|
65 |
+
],
|
66 |
+
dim=-1)
|
67 |
+
return mask[None, None, :, :].expand(bsz, 1, tgt_len,
|
68 |
+
tgt_len + past_key_values_length)
|
69 |
+
|
70 |
+
|
71 |
+
# Copied from transformers.models.bart.modeling_bart._expand_mask
|
72 |
+
def _expand_mask(mask: torch.Tensor,
|
73 |
+
dtype: torch.dtype,
|
74 |
+
tgt_len: Optional[int] = None):
|
75 |
+
"""Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len,
|
76 |
+
src_seq_len]`."""
|
77 |
+
bsz, src_len = mask.size()
|
78 |
+
tgt_len = tgt_len if tgt_len is not None else src_len
|
79 |
+
|
80 |
+
expanded_mask = mask[:, None, None, :].expand(bsz, 1, tgt_len,
|
81 |
+
src_len).to(dtype)
|
82 |
+
|
83 |
+
inverted_mask = 1.0 - expanded_mask
|
84 |
+
|
85 |
+
return inverted_mask.masked_fill(inverted_mask.to(torch.bool),
|
86 |
+
torch.finfo(dtype).min)
|
87 |
+
|
88 |
+
|
89 |
+
class LlamaRMSNorm(nn.Module):
|
90 |
+
|
91 |
+
def __init__(self, hidden_size, eps=1e-6):
|
92 |
+
"""LlamaRMSNorm is equivalent to T5LayerNorm."""
|
93 |
+
super().__init__()
|
94 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
95 |
+
self.variance_epsilon = eps
|
96 |
+
|
97 |
+
def forward(self, hidden_states):
|
98 |
+
input_dtype = hidden_states.dtype
|
99 |
+
hidden_states = hidden_states.to(torch.float32)
|
100 |
+
variance = hidden_states.pow(2).mean(-1, keepdim=True)
|
101 |
+
hidden_states = hidden_states * torch.rsqrt(variance +
|
102 |
+
self.variance_epsilon)
|
103 |
+
return self.weight * hidden_states.to(input_dtype)
|
104 |
+
|
105 |
+
|
106 |
+
class LlamaRotaryEmbedding(torch.nn.Module):
|
107 |
+
"""RotaryEmbedding for Llama Model.
|
108 |
+
|
109 |
+
This module generates sine and cosine positional encodings based on
|
110 |
+
the paper "RoFormer: Enhanced Transformer with Rotary Position Embedding".
|
111 |
+
The purpose of this class is to provide positional embeddings to the
|
112 |
+
input tensors. It utilizes a cache mechanism to store precomputed
|
113 |
+
sine and cosine values for speedup.
|
114 |
+
|
115 |
+
Args:
|
116 |
+
dim (int): The dimensionality of the embeddings.
|
117 |
+
max_position_embeddings (int, optional): The maximum number of
|
118 |
+
position embeddings. Default is 2048.
|
119 |
+
base (int, optional): The base value for the inverse frequency
|
120 |
+
calculation. Default is 10000.
|
121 |
+
device (str, optional): The device to run operations on.
|
122 |
+
If None, defaults to the device of the model.
|
123 |
+
"""
|
124 |
+
|
125 |
+
def __init__(self,
|
126 |
+
dim,
|
127 |
+
max_position_embeddings=2048,
|
128 |
+
base=10000,
|
129 |
+
device=None):
|
130 |
+
super().__init__()
|
131 |
+
|
132 |
+
self.dim = dim
|
133 |
+
self.max_position_embeddings = max_position_embeddings
|
134 |
+
self.base = base
|
135 |
+
inv_freq = 1.0 / (self.base**(
|
136 |
+
torch.arange(0, self.dim, 2).float().to(device) / self.dim))
|
137 |
+
self.register_buffer('inv_freq', inv_freq, persistent=False)
|
138 |
+
|
139 |
+
# Build here to make `torch.jit.trace` work.
|
140 |
+
self._set_cos_sin_cache(seq_len=max_position_embeddings,
|
141 |
+
device=self.inv_freq.device,
|
142 |
+
dtype=torch.get_default_dtype())
|
143 |
+
|
144 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
145 |
+
"""Sets the cached sine and cosine values for the specified sequence
|
146 |
+
length.
|
147 |
+
|
148 |
+
Args:
|
149 |
+
seq_len (int): The sequence length for which to set the cache.
|
150 |
+
device (str): The device to use for computation.
|
151 |
+
dtype (torch.dtype): The data type to be used for tensors.
|
152 |
+
"""
|
153 |
+
self.max_seq_len_cached = seq_len
|
154 |
+
t = torch.arange(self.max_seq_len_cached,
|
155 |
+
device=device,
|
156 |
+
dtype=self.inv_freq.dtype)
|
157 |
+
|
158 |
+
freqs = torch.einsum('i,j->ij', t, self.inv_freq)
|
159 |
+
# Different from paper, but it uses a different permutation in order
|
160 |
+
# to obtain the same calculation
|
161 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
162 |
+
self.register_buffer('cos_cached',
|
163 |
+
emb.cos()[None, None, :, :].to(dtype),
|
164 |
+
persistent=False)
|
165 |
+
self.register_buffer('sin_cached',
|
166 |
+
emb.sin()[None, None, :, :].to(dtype),
|
167 |
+
persistent=False)
|
168 |
+
|
169 |
+
def forward(self, x, seq_len=None):
|
170 |
+
"""Forward propagation method for the embedding layer. Generates
|
171 |
+
positional embeddings for the given input tensor.
|
172 |
+
|
173 |
+
If the sequence length is larger than the cache, it resets the cache.
|
174 |
+
|
175 |
+
Args:
|
176 |
+
x (torch.Tensor): Input tensor of shape
|
177 |
+
[batch_size, num_attention_heads, seq_len, head_size].
|
178 |
+
seq_len (int, optional): Sequence length. If None, it is obtained
|
179 |
+
from `x`.
|
180 |
+
|
181 |
+
Returns:
|
182 |
+
tuple: Tuple containing cosine and sine positional embeddings.
|
183 |
+
"""
|
184 |
+
# x: [bs, num_attention_heads, seq_len, head_size]
|
185 |
+
if seq_len > self.max_seq_len_cached:
|
186 |
+
self._set_cos_sin_cache(seq_len=seq_len,
|
187 |
+
device=x.device,
|
188 |
+
dtype=x.dtype)
|
189 |
+
|
190 |
+
return (
|
191 |
+
self.cos_cached[:, :, :seq_len, ...].to(dtype=x.dtype),
|
192 |
+
self.sin_cached[:, :, :seq_len, ...].to(dtype=x.dtype),
|
193 |
+
)
|
194 |
+
|
195 |
+
|
196 |
+
class LlamaLinearScalingRotaryEmbedding(LlamaRotaryEmbedding):
|
197 |
+
"""This class extends the `LlamaRotaryEmbedding` with linear scaling.
|
198 |
+
|
199 |
+
It provides a mechanism for adjusting the scale of the positional
|
200 |
+
embeddings by dividing the tensor generated by the range of sequence length
|
201 |
+
with a scaling factor. This is useful when dealing with sequences of
|
202 |
+
varying lengths.
|
203 |
+
|
204 |
+
Credits to Reddit User /u/kaiokendev for this extension.
|
205 |
+
|
206 |
+
Args:
|
207 |
+
dim (int): The dimensionality of the embeddings.
|
208 |
+
max_position_embeddings (int, optional): The maximum number of
|
209 |
+
position embeddings. Default is 2048.
|
210 |
+
base (int, optional): The base value for the inverse frequency
|
211 |
+
calculation. Default is 10000.
|
212 |
+
device (str, optional): The device to run operations on. If None,
|
213 |
+
defaults to the device of the model.
|
214 |
+
scaling_factor (float, optional): Scaling factor used in adjusting
|
215 |
+
the scale of positional embeddings. Default is 1.0.
|
216 |
+
"""
|
217 |
+
|
218 |
+
def __init__(self,
|
219 |
+
dim,
|
220 |
+
max_position_embeddings=2048,
|
221 |
+
base=10000,
|
222 |
+
device=None,
|
223 |
+
scaling_factor=1.0):
|
224 |
+
self.scaling_factor = scaling_factor
|
225 |
+
super().__init__(dim, max_position_embeddings, base, device)
|
226 |
+
|
227 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
228 |
+
"""Sets the cached sine and cosine values for the specified sequence
|
229 |
+
length.
|
230 |
+
|
231 |
+
Args:
|
232 |
+
seq_len (int): The sequence length for which to set the cache.
|
233 |
+
device (str): The device to use for computation.
|
234 |
+
dtype (torch.dtype): The data type to use for tensors.
|
235 |
+
"""
|
236 |
+
self.max_seq_len_cached = seq_len
|
237 |
+
t = torch.arange(self.max_seq_len_cached,
|
238 |
+
device=device,
|
239 |
+
dtype=self.inv_freq.dtype)
|
240 |
+
t = t / self.scaling_factor
|
241 |
+
|
242 |
+
freqs = torch.einsum('i,j->ij', t, self.inv_freq)
|
243 |
+
# Different from paper, but it uses a different permutation in order
|
244 |
+
# to obtain the same calculation
|
245 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
246 |
+
self.register_buffer('cos_cached',
|
247 |
+
emb.cos()[None, None, :, :].to(dtype),
|
248 |
+
persistent=False)
|
249 |
+
self.register_buffer('sin_cached',
|
250 |
+
emb.sin()[None, None, :, :].to(dtype),
|
251 |
+
persistent=False)
|
252 |
+
|
253 |
+
|
254 |
+
class LlamaDynamicNTKScalingRotaryEmbedding(LlamaRotaryEmbedding):
|
255 |
+
"""LlamaRotaryEmbedding extended with Dynamic NTK scaling.
|
256 |
+
|
257 |
+
Credits to the Reddit users /u/bloc97 and /u/emozilla
|
258 |
+
"""
|
259 |
+
|
260 |
+
def __init__(self,
|
261 |
+
dim,
|
262 |
+
max_position_embeddings=2048,
|
263 |
+
base=10000,
|
264 |
+
device=None,
|
265 |
+
scaling_factor=1.0):
|
266 |
+
self.scaling_factor = scaling_factor
|
267 |
+
super().__init__(dim, max_position_embeddings, base, device)
|
268 |
+
|
269 |
+
def _set_cos_sin_cache(self, seq_len, device, dtype):
|
270 |
+
self.max_seq_len_cached = seq_len
|
271 |
+
|
272 |
+
if seq_len > self.max_position_embeddings:
|
273 |
+
base = self.base * ((self.scaling_factor * seq_len /
|
274 |
+
self.max_position_embeddings) -
|
275 |
+
(self.scaling_factor - 1))**(self.dim /
|
276 |
+
(self.dim - 2))
|
277 |
+
inv_freq = 1.0 / (base**(
|
278 |
+
torch.arange(0, self.dim, 2).float().to(device) / self.dim))
|
279 |
+
self.register_buffer('inv_freq', inv_freq, persistent=False)
|
280 |
+
|
281 |
+
t = torch.arange(self.max_seq_len_cached,
|
282 |
+
device=device,
|
283 |
+
dtype=self.inv_freq.dtype)
|
284 |
+
|
285 |
+
freqs = torch.einsum('i,j->ij', t, self.inv_freq)
|
286 |
+
# Different from paper, but it uses a different permutation in order
|
287 |
+
# to obtain the same calculation
|
288 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
289 |
+
self.register_buffer('cos_cached',
|
290 |
+
emb.cos()[None, None, :, :].to(dtype),
|
291 |
+
persistent=False)
|
292 |
+
self.register_buffer('sin_cached',
|
293 |
+
emb.sin()[None, None, :, :].to(dtype),
|
294 |
+
persistent=False)
|
295 |
+
|
296 |
+
|
297 |
+
def rotate_half(x):
|
298 |
+
"""Rotates half the hidden dims of the input."""
|
299 |
+
x1 = x[..., :x.shape[-1] // 2]
|
300 |
+
x2 = x[..., x.shape[-1] // 2:]
|
301 |
+
return torch.cat((-x2, x1), dim=-1)
|
302 |
+
|
303 |
+
|
304 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids):
|
305 |
+
"""Apply rotary positional embeddings to query and key tensors.
|
306 |
+
|
307 |
+
This function applies the cosine and sine positional embeddings on the
|
308 |
+
input query (q) and key (k) tensors using element-wise multiplication and
|
309 |
+
addition.
|
310 |
+
"""
|
311 |
+
# The first two dimensions of cos and sin are always 1,
|
312 |
+
# so we can `squeeze` them.
|
313 |
+
cos = cos.squeeze(1).squeeze(0) # [seq_len, dim]
|
314 |
+
sin = sin.squeeze(1).squeeze(0) # [seq_len, dim]
|
315 |
+
cos = cos[position_ids].unsqueeze(1) # [bs, 1, seq_len, dim]
|
316 |
+
sin = sin[position_ids].unsqueeze(1) # [bs, 1, seq_len, dim]
|
317 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
318 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
319 |
+
return q_embed, k_embed
|
320 |
+
|
321 |
+
|
322 |
+
class LlamaMLP(nn.Module):
|
323 |
+
"""MLP for Llama Model."""
|
324 |
+
|
325 |
+
def __init__(self, config):
|
326 |
+
super().__init__()
|
327 |
+
self.config = config
|
328 |
+
self.hidden_size = config.hidden_size
|
329 |
+
self.intermediate_size = config.intermediate_size
|
330 |
+
self.gate_proj = nn.Linear(self.hidden_size,
|
331 |
+
self.intermediate_size,
|
332 |
+
bias=False)
|
333 |
+
self.up_proj = nn.Linear(self.hidden_size,
|
334 |
+
self.intermediate_size,
|
335 |
+
bias=False)
|
336 |
+
self.down_proj = nn.Linear(self.intermediate_size,
|
337 |
+
self.hidden_size,
|
338 |
+
bias=False)
|
339 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
340 |
+
|
341 |
+
def forward(self, x):
|
342 |
+
if self.config.pretraining_tp > 1:
|
343 |
+
slice = self.intermediate_size // self.config.pretraining_tp
|
344 |
+
gate_proj_slices = self.gate_proj.weight.split(slice, dim=0)
|
345 |
+
up_proj_slices = self.up_proj.weight.split(slice, dim=0)
|
346 |
+
down_proj_slices = self.down_proj.weight.split(slice, dim=1)
|
347 |
+
|
348 |
+
gate_proj = torch.cat([
|
349 |
+
F.linear(x, gate_proj_slices[i])
|
350 |
+
for i in range(self.config.pretraining_tp)
|
351 |
+
],
|
352 |
+
dim=-1)
|
353 |
+
up_proj = torch.cat([
|
354 |
+
F.linear(x, up_proj_slices[i])
|
355 |
+
for i in range(self.config.pretraining_tp)
|
356 |
+
],
|
357 |
+
dim=-1)
|
358 |
+
|
359 |
+
intermediate_states = (self.act_fn(gate_proj) * up_proj).split(
|
360 |
+
slice, dim=2)
|
361 |
+
down_proj = [
|
362 |
+
F.linear(intermediate_states[i], down_proj_slices[i])
|
363 |
+
for i in range(self.config.pretraining_tp)
|
364 |
+
]
|
365 |
+
down_proj = sum(down_proj)
|
366 |
+
else:
|
367 |
+
down_proj = self.down_proj(
|
368 |
+
self.act_fn(self.gate_proj(x)) * self.up_proj(x))
|
369 |
+
|
370 |
+
return down_proj
|
371 |
+
|
372 |
+
|
373 |
+
def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
|
374 |
+
"""This is the equivalent of torch.repeat_interleave(x, dim=1,
|
375 |
+
repeats=n_rep).
|
376 |
+
|
377 |
+
The hidden states go from (batch, num_key_value_heads, seqlen, head_dim) to
|
378 |
+
(batch, num_attention_heads, seqlen, head_dim)
|
379 |
+
"""
|
380 |
+
batch, num_key_value_heads, slen, head_dim = hidden_states.shape
|
381 |
+
if n_rep == 1:
|
382 |
+
return hidden_states
|
383 |
+
hidden_states = hidden_states[:, :,
|
384 |
+
None, :, :].expand(batch,
|
385 |
+
num_key_value_heads,
|
386 |
+
n_rep, slen, head_dim)
|
387 |
+
return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen,
|
388 |
+
head_dim)
|
389 |
+
|
390 |
+
|
391 |
+
class LlamaAttention(nn.Module):
|
392 |
+
"""Multi-headed attention from 'Attention Is All You Need' paper."""
|
393 |
+
|
394 |
+
def __init__(self, config: LlamaConfig):
|
395 |
+
super().__init__()
|
396 |
+
self.config = config
|
397 |
+
self.hidden_size = config.hidden_size
|
398 |
+
self.num_heads = config.num_attention_heads
|
399 |
+
self.head_dim = self.hidden_size // self.num_heads
|
400 |
+
self.num_key_value_heads = config.num_key_value_heads
|
401 |
+
self.num_key_value_groups = self.num_heads // self.num_key_value_heads
|
402 |
+
self.max_position_embeddings = config.max_position_embeddings
|
403 |
+
self.rope_theta = config.rope_theta
|
404 |
+
|
405 |
+
if (self.head_dim * self.num_heads) != self.hidden_size:
|
406 |
+
raise ValueError('hidden_size must be divisible by num_heads '
|
407 |
+
f'(got `hidden_size`: {self.hidden_size}'
|
408 |
+
f' and `num_heads`: {self.num_heads}).')
|
409 |
+
self.q_proj = nn.Linear(self.hidden_size,
|
410 |
+
self.num_heads * self.head_dim,
|
411 |
+
bias=False)
|
412 |
+
self.k_proj = nn.Linear(self.hidden_size,
|
413 |
+
self.num_key_value_heads * self.head_dim,
|
414 |
+
bias=False)
|
415 |
+
self.v_proj = nn.Linear(self.hidden_size,
|
416 |
+
self.num_key_value_heads * self.head_dim,
|
417 |
+
bias=False)
|
418 |
+
self.o_proj = nn.Linear(self.num_heads * self.head_dim,
|
419 |
+
self.hidden_size,
|
420 |
+
bias=False)
|
421 |
+
self._init_rope()
|
422 |
+
|
423 |
+
def _init_rope(self):
|
424 |
+
"""Initialize the Rotary Embedding Module."""
|
425 |
+
if self.config.rope_scaling is None:
|
426 |
+
self.rotary_emb = LlamaRotaryEmbedding(
|
427 |
+
self.head_dim,
|
428 |
+
max_position_embeddings=self.max_position_embeddings,
|
429 |
+
base=self.rope_theta,
|
430 |
+
)
|
431 |
+
else:
|
432 |
+
scaling_type = self.config.rope_scaling['type']
|
433 |
+
scaling_factor = self.config.rope_scaling['factor']
|
434 |
+
if scaling_type == 'linear':
|
435 |
+
self.rotary_emb = LlamaLinearScalingRotaryEmbedding(
|
436 |
+
self.head_dim,
|
437 |
+
max_position_embeddings=self.max_position_embeddings,
|
438 |
+
scaling_factor=scaling_factor,
|
439 |
+
base=self.rope_theta,
|
440 |
+
)
|
441 |
+
elif scaling_type == 'dynamic':
|
442 |
+
self.rotary_emb = LlamaDynamicNTKScalingRotaryEmbedding(
|
443 |
+
self.head_dim,
|
444 |
+
max_position_embeddings=self.max_position_embeddings,
|
445 |
+
scaling_factor=scaling_factor,
|
446 |
+
base=self.rope_theta,
|
447 |
+
)
|
448 |
+
else:
|
449 |
+
raise ValueError(f'Unknown RoPE scaling type {scaling_type}')
|
450 |
+
|
451 |
+
def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
|
452 |
+
return tensor.view(bsz, seq_len, self.num_heads,
|
453 |
+
self.head_dim).transpose(1, 2).contiguous()
|
454 |
+
|
455 |
+
def forward(
|
456 |
+
self,
|
457 |
+
hidden_states: torch.Tensor,
|
458 |
+
attention_mask: Optional[torch.Tensor] = None,
|
459 |
+
position_ids: Optional[torch.LongTensor] = None,
|
460 |
+
past_key_value: Optional[Tuple[torch.Tensor]] = None,
|
461 |
+
output_attentions: bool = False,
|
462 |
+
use_cache: bool = False,
|
463 |
+
) -> Tuple[torch.Tensor, Optional[torch.Tensor],
|
464 |
+
Optional[Tuple[torch.Tensor]]]:
|
465 |
+
"""Forward propagation method for the attention layer."""
|
466 |
+
bsz, q_len, _ = hidden_states.size()
|
467 |
+
|
468 |
+
if self.config.pretraining_tp > 1:
|
469 |
+
key_value_slicing = (self.num_key_value_heads *
|
470 |
+
self.head_dim) // self.config.pretraining_tp
|
471 |
+
query_slices = self.q_proj.weight.split(
|
472 |
+
(self.num_heads * self.head_dim) // self.config.pretraining_tp,
|
473 |
+
dim=0)
|
474 |
+
key_slices = self.k_proj.weight.split(key_value_slicing, dim=0)
|
475 |
+
value_slices = self.v_proj.weight.split(key_value_slicing, dim=0)
|
476 |
+
|
477 |
+
query_states = [
|
478 |
+
F.linear(hidden_states, query_slices[i])
|
479 |
+
for i in range(self.config.pretraining_tp)
|
480 |
+
]
|
481 |
+
query_states = torch.cat(query_states, dim=-1)
|
482 |
+
|
483 |
+
key_states = [
|
484 |
+
F.linear(hidden_states, key_slices[i])
|
485 |
+
for i in range(self.config.pretraining_tp)
|
486 |
+
]
|
487 |
+
key_states = torch.cat(key_states, dim=-1)
|
488 |
+
|
489 |
+
value_states = [
|
490 |
+
F.linear(hidden_states, value_slices[i])
|
491 |
+
for i in range(self.config.pretraining_tp)
|
492 |
+
]
|
493 |
+
value_states = torch.cat(value_states, dim=-1)
|
494 |
+
|
495 |
+
else:
|
496 |
+
query_states = self.q_proj(hidden_states)
|
497 |
+
key_states = self.k_proj(hidden_states)
|
498 |
+
value_states = self.v_proj(hidden_states)
|
499 |
+
|
500 |
+
query_states = query_states.view(bsz, q_len, self.num_heads,
|
501 |
+
self.head_dim).transpose(1, 2)
|
502 |
+
key_states = key_states.view(bsz, q_len, self.num_key_value_heads,
|
503 |
+
self.head_dim).transpose(1, 2)
|
504 |
+
value_states = value_states.view(bsz, q_len, self.num_key_value_heads,
|
505 |
+
self.head_dim).transpose(1, 2)
|
506 |
+
|
507 |
+
kv_seq_len = key_states.shape[-2]
|
508 |
+
if past_key_value is not None:
|
509 |
+
kv_seq_len += past_key_value[0].shape[-2]
|
510 |
+
cos, sin = self.rotary_emb(value_states, seq_len=kv_seq_len)
|
511 |
+
query_states, key_states = apply_rotary_pos_emb(
|
512 |
+
query_states, key_states, cos, sin, position_ids)
|
513 |
+
|
514 |
+
if past_key_value is not None:
|
515 |
+
# reuse k, v, self_attention
|
516 |
+
key_states = torch.cat([past_key_value[0], key_states], dim=2)
|
517 |
+
value_states = torch.cat([past_key_value[1], value_states], dim=2)
|
518 |
+
|
519 |
+
past_key_value = (key_states, value_states) if use_cache else None
|
520 |
+
|
521 |
+
# repeat k/v heads if n_kv_heads < n_heads
|
522 |
+
key_states = repeat_kv(key_states, self.num_key_value_groups)
|
523 |
+
value_states = repeat_kv(value_states, self.num_key_value_groups)
|
524 |
+
|
525 |
+
attn_weights = torch.matmul(query_states, key_states.transpose(
|
526 |
+
2, 3)) / math.sqrt(self.head_dim)
|
527 |
+
|
528 |
+
if attn_weights.size() != (bsz, self.num_heads, q_len, kv_seq_len):
|
529 |
+
raise ValueError(
|
530 |
+
'Attention weights should be of size '
|
531 |
+
f'{(bsz, self.num_heads, q_len, kv_seq_len)}, but is'
|
532 |
+
f' {attn_weights.size()}')
|
533 |
+
|
534 |
+
if attention_mask is not None:
|
535 |
+
if attention_mask.size() != (bsz, 1, q_len, kv_seq_len):
|
536 |
+
raise ValueError('Attention mask should be of size '
|
537 |
+
f'{(bsz, 1, q_len, kv_seq_len)}, '
|
538 |
+
f'but is {attention_mask.size()}')
|
539 |
+
attn_weights = attn_weights + attention_mask
|
540 |
+
|
541 |
+
# upcast attention to fp32
|
542 |
+
attn_weights = nn.functional.softmax(attn_weights,
|
543 |
+
dim=-1,
|
544 |
+
dtype=torch.float32).to(
|
545 |
+
query_states.dtype)
|
546 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
547 |
+
|
548 |
+
if attn_output.size() != (bsz, self.num_heads, q_len, self.head_dim):
|
549 |
+
raise ValueError(
|
550 |
+
'`attn_output` should be of size '
|
551 |
+
f'{(bsz, self.num_heads, q_len, self.head_dim)}, but is'
|
552 |
+
f' {attn_output.size()}')
|
553 |
+
|
554 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
555 |
+
attn_output = attn_output.reshape(bsz, q_len, self.hidden_size)
|
556 |
+
|
557 |
+
if self.config.pretraining_tp > 1:
|
558 |
+
attn_output = attn_output.split(self.hidden_size //
|
559 |
+
self.config.pretraining_tp,
|
560 |
+
dim=2)
|
561 |
+
o_proj_slices = self.o_proj.weight.split(
|
562 |
+
self.hidden_size // self.config.pretraining_tp, dim=1)
|
563 |
+
attn_output = sum([
|
564 |
+
F.linear(attn_output[i], o_proj_slices[i])
|
565 |
+
for i in range(self.config.pretraining_tp)
|
566 |
+
])
|
567 |
+
else:
|
568 |
+
attn_output = self.o_proj(attn_output)
|
569 |
+
|
570 |
+
if not output_attentions:
|
571 |
+
attn_weights = None
|
572 |
+
|
573 |
+
return attn_output, attn_weights, past_key_value
|
574 |
+
|
575 |
+
|
576 |
+
class LlamaDecoderLayer(nn.Module):
|
577 |
+
"""Decoder layer for Llama Model."""
|
578 |
+
|
579 |
+
def __init__(self, config: LlamaConfig):
|
580 |
+
super().__init__()
|
581 |
+
self.hidden_size = config.hidden_size
|
582 |
+
self.self_attn = LlamaAttention(config=config)
|
583 |
+
self.mlp = LlamaMLP(config)
|
584 |
+
self.input_layernorm = LlamaRMSNorm(config.hidden_size,
|
585 |
+
eps=config.rms_norm_eps)
|
586 |
+
self.post_attention_layernorm = LlamaRMSNorm(config.hidden_size,
|
587 |
+
eps=config.rms_norm_eps)
|
588 |
+
|
589 |
+
def forward(
|
590 |
+
self,
|
591 |
+
hidden_states: torch.Tensor,
|
592 |
+
attention_mask: Optional[torch.Tensor] = None,
|
593 |
+
position_ids: Optional[torch.LongTensor] = None,
|
594 |
+
past_key_value: Optional[Tuple[torch.Tensor]] = None,
|
595 |
+
output_attentions: Optional[bool] = False,
|
596 |
+
use_cache: Optional[bool] = False,
|
597 |
+
) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor,
|
598 |
+
torch.FloatTensor]]]:
|
599 |
+
"""
|
600 |
+
Args:
|
601 |
+
hidden_states (`torch.FloatTensor`): input to the layer of shape
|
602 |
+
`(batch, seq_len, embed_dim)`
|
603 |
+
attention_mask (`torch.FloatTensor`, *optional*): attention mask
|
604 |
+
of size `(batch, 1, tgt_len, src_len)` where padding elements
|
605 |
+
are indicated by very large negative values.
|
606 |
+
output_attentions (`bool`, *optional*):
|
607 |
+
Whether or not to return the attentions tensors of all
|
608 |
+
attention layers. See `attentions` under
|
609 |
+
returned tensors for more detail.
|
610 |
+
use_cache (`bool`, *optional*):
|
611 |
+
If set to `True`, `past_key_values` key value states are
|
612 |
+
returned and can be used to speed up decoding
|
613 |
+
(see `past_key_values`).
|
614 |
+
past_key_value (`Tuple(torch.FloatTensor)`, *optional*): cached
|
615 |
+
past key and value projection states
|
616 |
+
"""
|
617 |
+
|
618 |
+
residual = hidden_states
|
619 |
+
|
620 |
+
hidden_states = self.input_layernorm(hidden_states)
|
621 |
+
|
622 |
+
# Self Attention
|
623 |
+
hidden_states, self_attn_weights, present_key_value = self.self_attn(
|
624 |
+
hidden_states=hidden_states,
|
625 |
+
attention_mask=attention_mask,
|
626 |
+
position_ids=position_ids,
|
627 |
+
past_key_value=past_key_value,
|
628 |
+
output_attentions=output_attentions,
|
629 |
+
use_cache=use_cache,
|
630 |
+
)
|
631 |
+
hidden_states = residual + hidden_states
|
632 |
+
|
633 |
+
# Fully Connected
|
634 |
+
residual = hidden_states
|
635 |
+
hidden_states = self.post_attention_layernorm(hidden_states)
|
636 |
+
hidden_states = self.mlp(hidden_states)
|
637 |
+
hidden_states = residual + hidden_states
|
638 |
+
|
639 |
+
outputs = (hidden_states, )
|
640 |
+
|
641 |
+
if output_attentions:
|
642 |
+
outputs += (self_attn_weights, )
|
643 |
+
|
644 |
+
if use_cache:
|
645 |
+
outputs += (present_key_value, )
|
646 |
+
|
647 |
+
return outputs
|
648 |
+
|
649 |
+
|
650 |
+
LLAMA_START_DOCSTRING = r""" # noqa: E501
|
651 |
+
This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
|
652 |
+
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
|
653 |
+
etc.)
|
654 |
+
|
655 |
+
This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
|
656 |
+
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
|
657 |
+
and behavior.
|
658 |
+
|
659 |
+
Parameters:
|
660 |
+
config ([`LlamaConfig`]):
|
661 |
+
Model configuration class with all the parameters of the model. Initializing with a config file does not
|
662 |
+
load the weights associated with the model, only the configuration. Check out the
|
663 |
+
[`~PreTrainedModel.from_pretrained`] method to load the model weights.
|
664 |
+
"""
|
665 |
+
|
666 |
+
|
667 |
+
@add_start_docstrings(
|
668 |
+
'The bare LLaMA Model outputting raw hidden-states without any specific head on top.', # noqa: E501
|
669 |
+
LLAMA_START_DOCSTRING,
|
670 |
+
)
|
671 |
+
class LlamaPreTrainedModel(PreTrainedModel):
|
672 |
+
config_class = LlamaConfig
|
673 |
+
base_model_prefix = 'model'
|
674 |
+
supports_gradient_checkpointing = True
|
675 |
+
_no_split_modules = ['LlamaDecoderLayer']
|
676 |
+
_skip_keys_device_placement = 'past_key_values'
|
677 |
+
|
678 |
+
def _init_weights(self, module):
|
679 |
+
std = self.config.initializer_range
|
680 |
+
if isinstance(module, nn.Linear):
|
681 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
682 |
+
if module.bias is not None:
|
683 |
+
module.bias.data.zero_()
|
684 |
+
elif isinstance(module, nn.Embedding):
|
685 |
+
module.weight.data.normal_(mean=0.0, std=std)
|
686 |
+
if module.padding_idx is not None:
|
687 |
+
module.weight.data[module.padding_idx].zero_()
|
688 |
+
|
689 |
+
def _set_gradient_checkpointing(self, module, value=False):
|
690 |
+
if isinstance(module, LlamaModel):
|
691 |
+
module.gradient_checkpointing = value
|
692 |
+
|
693 |
+
|
694 |
+
LLAMA_INPUTS_DOCSTRING = r""" # noqa: E501
|
695 |
+
Args:
|
696 |
+
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
|
697 |
+
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
|
698 |
+
it.
|
699 |
+
|
700 |
+
Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
|
701 |
+
[`PreTrainedTokenizer.__call__`] for details.
|
702 |
+
|
703 |
+
[What are input IDs?](../glossary#input-ids)
|
704 |
+
attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
|
705 |
+
Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
|
706 |
+
|
707 |
+
- 1 for tokens that are **not masked**,
|
708 |
+
- 0 for tokens that are **masked**.
|
709 |
+
|
710 |
+
[What are attention masks?](../glossary#attention-mask)
|
711 |
+
|
712 |
+
Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
|
713 |
+
[`PreTrainedTokenizer.__call__`] for details.
|
714 |
+
|
715 |
+
If `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
|
716 |
+
`past_key_values`).
|
717 |
+
|
718 |
+
If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
|
719 |
+
and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
|
720 |
+
information on the default strategy.
|
721 |
+
|
722 |
+
- 1 indicates the head is **not masked**,
|
723 |
+
- 0 indicates the head is **masked**.
|
724 |
+
position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
725 |
+
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
|
726 |
+
config.n_positions - 1]`.
|
727 |
+
|
728 |
+
[What are position IDs?](../glossary#position-ids)
|
729 |
+
past_key_values (`tuple(tuple(torch.FloatTensor))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
|
730 |
+
Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of shape
|
731 |
+
`(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
|
732 |
+
`(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.
|
733 |
+
|
734 |
+
Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
|
735 |
+
blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
|
736 |
+
|
737 |
+
If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those that
|
738 |
+
don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of all
|
739 |
+
`decoder_input_ids` of shape `(batch_size, sequence_length)`.
|
740 |
+
inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
|
741 |
+
Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
|
742 |
+
is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
|
743 |
+
model's internal embedding lookup matrix.
|
744 |
+
use_cache (`bool`, *optional*):
|
745 |
+
If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
|
746 |
+
`past_key_values`).
|
747 |
+
output_attentions (`bool`, *optional*):
|
748 |
+
Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
|
749 |
+
tensors for more detail.
|
750 |
+
output_hidden_states (`bool`, *optional*):
|
751 |
+
Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
|
752 |
+
more detail.
|
753 |
+
return_dict (`bool`, *optional*):
|
754 |
+
Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
|
755 |
+
"""
|
756 |
+
|
757 |
+
|
758 |
+
@add_start_docstrings(
|
759 |
+
'The bare LLaMA Model outputting raw hidden-states without any specific head on top.', # noqa: E501
|
760 |
+
LLAMA_START_DOCSTRING,
|
761 |
+
)
|
762 |
+
class LlamaModel(LlamaPreTrainedModel):
|
763 |
+
"""Transformer decoder consisting of *config.num_hidden_layers* layers.
|
764 |
+
Each layer is a [`LlamaDecoderLayer`]
|
765 |
+
|
766 |
+
Args:
|
767 |
+
config: LlamaConfig
|
768 |
+
"""
|
769 |
+
|
770 |
+
def __init__(self, config: LlamaConfig):
|
771 |
+
super().__init__(config)
|
772 |
+
self.padding_idx = config.pad_token_id
|
773 |
+
self.vocab_size = config.vocab_size
|
774 |
+
|
775 |
+
self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size,
|
776 |
+
self.padding_idx)
|
777 |
+
self.layers = nn.ModuleList([
|
778 |
+
LlamaDecoderLayer(config) for _ in range(config.num_hidden_layers)
|
779 |
+
])
|
780 |
+
self.norm = LlamaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
781 |
+
|
782 |
+
self.gradient_checkpointing = False
|
783 |
+
# Initialize weights and apply final processing
|
784 |
+
self.post_init()
|
785 |
+
|
786 |
+
def get_input_embeddings(self):
|
787 |
+
return self.embed_tokens
|
788 |
+
|
789 |
+
def set_input_embeddings(self, value):
|
790 |
+
self.embed_tokens = value
|
791 |
+
|
792 |
+
# Copied from transformers.models.bart.modeling_bart.BartDecoder._prepare_decoder_attention_mask # noqa
|
793 |
+
def _prepare_decoder_attention_mask(self, attention_mask, input_shape,
|
794 |
+
inputs_embeds, past_key_values_length):
|
795 |
+
# create causal mask
|
796 |
+
# [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
|
797 |
+
combined_attention_mask = None
|
798 |
+
if input_shape[-1] > 1:
|
799 |
+
combined_attention_mask = _make_causal_mask(
|
800 |
+
input_shape,
|
801 |
+
inputs_embeds.dtype,
|
802 |
+
device=inputs_embeds.device,
|
803 |
+
past_key_values_length=past_key_values_length,
|
804 |
+
)
|
805 |
+
|
806 |
+
if attention_mask is not None:
|
807 |
+
# [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
|
808 |
+
expanded_attn_mask = _expand_mask(attention_mask,
|
809 |
+
inputs_embeds.dtype,
|
810 |
+
tgt_len=input_shape[-1]).to(
|
811 |
+
inputs_embeds.device)
|
812 |
+
combined_attention_mask = (expanded_attn_mask
|
813 |
+
if combined_attention_mask is None else
|
814 |
+
expanded_attn_mask +
|
815 |
+
combined_attention_mask)
|
816 |
+
|
817 |
+
return combined_attention_mask
|
818 |
+
|
819 |
+
@add_start_docstrings_to_model_forward(LLAMA_INPUTS_DOCSTRING)
|
820 |
+
def forward(
|
821 |
+
self,
|
822 |
+
input_ids: torch.LongTensor = None,
|
823 |
+
attention_mask: Optional[torch.Tensor] = None,
|
824 |
+
position_ids: Optional[torch.LongTensor] = None,
|
825 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
826 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
827 |
+
use_cache: Optional[bool] = None,
|
828 |
+
output_attentions: Optional[bool] = None,
|
829 |
+
output_hidden_states: Optional[bool] = None,
|
830 |
+
return_dict: Optional[bool] = None,
|
831 |
+
) -> Union[Tuple, BaseModelOutputWithPast]:
|
832 |
+
output_attentions = (output_attentions if output_attentions is not None
|
833 |
+
else self.config.output_attentions)
|
834 |
+
output_hidden_states = (output_hidden_states
|
835 |
+
if output_hidden_states is not None else
|
836 |
+
self.config.output_hidden_states)
|
837 |
+
use_cache = (use_cache
|
838 |
+
if use_cache is not None else self.config.use_cache)
|
839 |
+
|
840 |
+
return_dict = (return_dict if return_dict is not None else
|
841 |
+
self.config.use_return_dict)
|
842 |
+
|
843 |
+
# retrieve input_ids and inputs_embeds
|
844 |
+
if input_ids is not None and inputs_embeds is not None:
|
845 |
+
raise ValueError('You cannot specify both decoder_input_ids'
|
846 |
+
'and decoder_inputs_embeds at the same time')
|
847 |
+
elif input_ids is not None:
|
848 |
+
batch_size, seq_length = input_ids.shape
|
849 |
+
elif inputs_embeds is not None:
|
850 |
+
batch_size, seq_length, _ = inputs_embeds.shape
|
851 |
+
else:
|
852 |
+
raise ValueError('You have to specify either decoder_input_ids'
|
853 |
+
'or decoder_inputs_embeds')
|
854 |
+
|
855 |
+
seq_length_with_past = seq_length
|
856 |
+
past_key_values_length = 0
|
857 |
+
|
858 |
+
if past_key_values is not None:
|
859 |
+
past_key_values_length = past_key_values[0][0].shape[2]
|
860 |
+
seq_length_with_past = (seq_length_with_past +
|
861 |
+
past_key_values_length)
|
862 |
+
|
863 |
+
if position_ids is None:
|
864 |
+
device = (input_ids.device
|
865 |
+
if input_ids is not None else inputs_embeds.device)
|
866 |
+
position_ids = torch.arange(past_key_values_length,
|
867 |
+
seq_length + past_key_values_length,
|
868 |
+
dtype=torch.long,
|
869 |
+
device=device)
|
870 |
+
position_ids = position_ids.unsqueeze(0).view(-1, seq_length)
|
871 |
+
else:
|
872 |
+
position_ids = position_ids.view(-1, seq_length).long()
|
873 |
+
|
874 |
+
if inputs_embeds is None:
|
875 |
+
inputs_embeds = self.embed_tokens(input_ids)
|
876 |
+
# embed positions
|
877 |
+
if attention_mask is None:
|
878 |
+
attention_mask = torch.ones((batch_size, seq_length_with_past),
|
879 |
+
dtype=torch.bool,
|
880 |
+
device=inputs_embeds.device)
|
881 |
+
attention_mask = self._prepare_decoder_attention_mask(
|
882 |
+
attention_mask, (batch_size, seq_length), inputs_embeds,
|
883 |
+
past_key_values_length)
|
884 |
+
|
885 |
+
hidden_states = inputs_embeds
|
886 |
+
|
887 |
+
if self.gradient_checkpointing and self.training:
|
888 |
+
if use_cache:
|
889 |
+
logger.warning_once(
|
890 |
+
'`use_cache=True` is incompatible with gradient'
|
891 |
+
' checkpointing. Setting `use_cache=False`...')
|
892 |
+
use_cache = False
|
893 |
+
|
894 |
+
# decoder layers
|
895 |
+
all_hidden_states = () if output_hidden_states else None
|
896 |
+
all_self_attns = () if output_attentions else None
|
897 |
+
next_decoder_cache = () if use_cache else None
|
898 |
+
|
899 |
+
for idx, decoder_layer in enumerate(self.layers):
|
900 |
+
if output_hidden_states:
|
901 |
+
all_hidden_states += (hidden_states, )
|
902 |
+
|
903 |
+
past_key_value = past_key_values[
|
904 |
+
idx] if past_key_values is not None else None
|
905 |
+
|
906 |
+
if self.gradient_checkpointing and self.training:
|
907 |
+
|
908 |
+
def create_custom_forward(module):
|
909 |
+
|
910 |
+
def custom_forward(*inputs):
|
911 |
+
# None for past_key_value
|
912 |
+
return module(*inputs, past_key_value,
|
913 |
+
output_attentions)
|
914 |
+
|
915 |
+
return custom_forward
|
916 |
+
|
917 |
+
layer_outputs = torch.utils.checkpoint.checkpoint(
|
918 |
+
create_custom_forward(decoder_layer),
|
919 |
+
hidden_states,
|
920 |
+
attention_mask,
|
921 |
+
position_ids,
|
922 |
+
)
|
923 |
+
else:
|
924 |
+
layer_outputs = decoder_layer(
|
925 |
+
hidden_states,
|
926 |
+
attention_mask=attention_mask,
|
927 |
+
position_ids=position_ids,
|
928 |
+
past_key_value=past_key_value,
|
929 |
+
output_attentions=output_attentions,
|
930 |
+
use_cache=use_cache,
|
931 |
+
)
|
932 |
+
|
933 |
+
hidden_states = layer_outputs[0]
|
934 |
+
|
935 |
+
if use_cache:
|
936 |
+
next_decoder_cache += (
|
937 |
+
layer_outputs[2 if output_attentions else 1], )
|
938 |
+
|
939 |
+
if output_attentions:
|
940 |
+
all_self_attns += (layer_outputs[1], )
|
941 |
+
|
942 |
+
hidden_states = self.norm(hidden_states)
|
943 |
+
|
944 |
+
# add hidden states from the last decoder layer
|
945 |
+
if output_hidden_states:
|
946 |
+
all_hidden_states += (hidden_states, )
|
947 |
+
|
948 |
+
next_cache = next_decoder_cache if use_cache else None
|
949 |
+
if not return_dict:
|
950 |
+
return tuple(
|
951 |
+
v for v in
|
952 |
+
[hidden_states, next_cache, all_hidden_states, all_self_attns]
|
953 |
+
if v is not None)
|
954 |
+
return BaseModelOutputWithPast(
|
955 |
+
last_hidden_state=hidden_states,
|
956 |
+
past_key_values=next_cache,
|
957 |
+
hidden_states=all_hidden_states,
|
958 |
+
attentions=all_self_attns,
|
959 |
+
)
|
960 |
+
|
961 |
+
|
962 |
+
class LlamaForCausalLM(LlamaPreTrainedModel):
|
963 |
+
"""This class extends the `LlamaPreTrainedModel` to enable causal language
|
964 |
+
modeling.
|
965 |
+
|
966 |
+
It wraps the basic Llama model (`LlamaModel`) and includes a linear layer
|
967 |
+
as a language model head (`lm_head`). The purpose is to predict token
|
968 |
+
probabilities, given the previous tokens in the sequence.
|
969 |
+
"""
|
970 |
+
_tied_weights_keys = ['lm_head.weight']
|
971 |
+
|
972 |
+
def __init__(self, config):
|
973 |
+
super().__init__(config)
|
974 |
+
self.model = LlamaModel(config)
|
975 |
+
self.vocab_size = config.vocab_size
|
976 |
+
self.lm_head = nn.Linear(config.hidden_size,
|
977 |
+
config.vocab_size,
|
978 |
+
bias=False)
|
979 |
+
|
980 |
+
# Initialize weights and apply final processing
|
981 |
+
self.post_init()
|
982 |
+
convert_to_qmodules(self)
|
983 |
+
|
984 |
+
def get_input_embeddings(self):
|
985 |
+
"""Get the token embedding layer."""
|
986 |
+
return self.model.embed_tokens
|
987 |
+
|
988 |
+
def set_input_embeddings(self, value):
|
989 |
+
"""Set the token embedding layer."""
|
990 |
+
self.model.embed_tokens = value
|
991 |
+
|
992 |
+
def get_output_embeddings(self):
|
993 |
+
"""Get the output embedding layer."""
|
994 |
+
return self.lm_head
|
995 |
+
|
996 |
+
def set_output_embeddings(self, new_embeddings):
|
997 |
+
"""Set the output embedding layer."""
|
998 |
+
self.lm_head = new_embeddings
|
999 |
+
|
1000 |
+
def set_decoder(self, decoder):
|
1001 |
+
"""Set the decoder model."""
|
1002 |
+
self.model = decoder
|
1003 |
+
|
1004 |
+
def get_decoder(self):
|
1005 |
+
"""Get the decoder model."""
|
1006 |
+
return self.model
|
1007 |
+
|
1008 |
+
@add_start_docstrings_to_model_forward(LLAMA_INPUTS_DOCSTRING)
|
1009 |
+
@replace_return_docstrings(output_type=CausalLMOutputWithPast,
|
1010 |
+
config_class=_CONFIG_FOR_DOC)
|
1011 |
+
def forward(
|
1012 |
+
self,
|
1013 |
+
input_ids: torch.LongTensor = None,
|
1014 |
+
attention_mask: Optional[torch.Tensor] = None,
|
1015 |
+
position_ids: Optional[torch.LongTensor] = None,
|
1016 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
1017 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
1018 |
+
labels: Optional[torch.LongTensor] = None,
|
1019 |
+
use_cache: Optional[bool] = None,
|
1020 |
+
output_attentions: Optional[bool] = None,
|
1021 |
+
output_hidden_states: Optional[bool] = None,
|
1022 |
+
return_dict: Optional[bool] = None,
|
1023 |
+
) -> Union[Tuple, CausalLMOutputWithPast]:
|
1024 |
+
r""" # noqa: E501
|
1025 |
+
Args:
|
1026 |
+
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
|
1027 |
+
Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
|
1028 |
+
config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
|
1029 |
+
(masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
|
1030 |
+
|
1031 |
+
Returns:
|
1032 |
+
|
1033 |
+
Example:
|
1034 |
+
|
1035 |
+
```python
|
1036 |
+
>>> from transformers import AutoTokenizer, LlamaForCausalLM
|
1037 |
+
|
1038 |
+
>>> model = LlamaForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
|
1039 |
+
>>> tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
|
1040 |
+
|
1041 |
+
>>> prompt = "Hey, are you conscious? Can you talk to me?"
|
1042 |
+
>>> inputs = tokenizer(prompt, return_tensors="pt")
|
1043 |
+
|
1044 |
+
>>> # Generate
|
1045 |
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
1046 |
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
1047 |
+
"Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
|
1048 |
+
```"""
|
1049 |
+
|
1050 |
+
output_attentions = (output_attentions if output_attentions is not None
|
1051 |
+
else self.config.output_attentions)
|
1052 |
+
output_hidden_states = (output_hidden_states
|
1053 |
+
if output_hidden_states is not None else
|
1054 |
+
self.config.output_hidden_states)
|
1055 |
+
return_dict = (return_dict if return_dict is not None else
|
1056 |
+
self.config.use_return_dict)
|
1057 |
+
|
1058 |
+
# decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn) # noqa: E501
|
1059 |
+
outputs = self.model(
|
1060 |
+
input_ids=input_ids,
|
1061 |
+
attention_mask=attention_mask,
|
1062 |
+
position_ids=position_ids,
|
1063 |
+
past_key_values=past_key_values,
|
1064 |
+
inputs_embeds=inputs_embeds,
|
1065 |
+
use_cache=use_cache,
|
1066 |
+
output_attentions=output_attentions,
|
1067 |
+
output_hidden_states=output_hidden_states,
|
1068 |
+
return_dict=return_dict,
|
1069 |
+
)
|
1070 |
+
|
1071 |
+
hidden_states = outputs[0]
|
1072 |
+
if self.config.pretraining_tp > 1:
|
1073 |
+
lm_head_slices = self.lm_head.weight.split(
|
1074 |
+
self.vocab_size // self.config.pretraining_tp, dim=0)
|
1075 |
+
logits = [
|
1076 |
+
F.linear(hidden_states, lm_head_slices[i])
|
1077 |
+
for i in range(self.config.pretraining_tp)
|
1078 |
+
]
|
1079 |
+
logits = torch.cat(logits, dim=-1)
|
1080 |
+
else:
|
1081 |
+
logits = self.lm_head(hidden_states)
|
1082 |
+
logits = logits.float()
|
1083 |
+
|
1084 |
+
loss = None
|
1085 |
+
if labels is not None:
|
1086 |
+
# Shift so that tokens < n predict n
|
1087 |
+
shift_logits = logits[..., :-1, :].contiguous()
|
1088 |
+
shift_labels = labels[..., 1:].contiguous()
|
1089 |
+
# Flatten the tokens
|
1090 |
+
loss_fct = CrossEntropyLoss()
|
1091 |
+
shift_logits = shift_logits.view(-1, self.config.vocab_size)
|
1092 |
+
shift_labels = shift_labels.view(-1)
|
1093 |
+
# Enable model parallelism
|
1094 |
+
shift_labels = shift_labels.to(shift_logits.device)
|
1095 |
+
loss = loss_fct(shift_logits, shift_labels)
|
1096 |
+
|
1097 |
+
if not return_dict:
|
1098 |
+
output = (logits, ) + outputs[1:]
|
1099 |
+
return (loss, ) + output if loss is not None else output
|
1100 |
+
|
1101 |
+
return CausalLMOutputWithPast(
|
1102 |
+
loss=loss,
|
1103 |
+
logits=logits,
|
1104 |
+
past_key_values=outputs.past_key_values,
|
1105 |
+
hidden_states=outputs.hidden_states,
|
1106 |
+
attentions=outputs.attentions,
|
1107 |
+
)
|
1108 |
+
|
1109 |
+
def prepare_inputs_for_generation(self,
|
1110 |
+
input_ids,
|
1111 |
+
past_key_values=None,
|
1112 |
+
attention_mask=None,
|
1113 |
+
inputs_embeds=None,
|
1114 |
+
**kwargs):
|
1115 |
+
"""Prepare inputs for generating sequences using the model.
|
1116 |
+
|
1117 |
+
Args:
|
1118 |
+
input_ids (torch.Tensor): Input token ids.
|
1119 |
+
past_key_values (list[torch.Tensor], optional): List of past key
|
1120 |
+
and value states.
|
1121 |
+
attention_mask (torch.Tensor, optional): Mask indicating which
|
1122 |
+
tokens should be attended to.
|
1123 |
+
inputs_embeds (torch.FloatTensor, optional): Optionally,
|
1124 |
+
the input embeddings instead of token ids.
|
1125 |
+
|
1126 |
+
Returns:
|
1127 |
+
dict: Dictionary containing prepared inputs for model generation.
|
1128 |
+
"""
|
1129 |
+
if past_key_values:
|
1130 |
+
input_ids = input_ids[:, -1:]
|
1131 |
+
|
1132 |
+
position_ids = kwargs.get('position_ids', None)
|
1133 |
+
if attention_mask is not None and position_ids is None:
|
1134 |
+
# create position_ids on the fly for batch generation
|
1135 |
+
position_ids = attention_mask.long().cumsum(-1) - 1
|
1136 |
+
position_ids.masked_fill_(attention_mask == 0, 1)
|
1137 |
+
if past_key_values:
|
1138 |
+
position_ids = position_ids[:, -1].unsqueeze(-1)
|
1139 |
+
|
1140 |
+
# if `inputs_embeds` are passed, we only want to use them
|
1141 |
+
# in the 1st generation step
|
1142 |
+
if inputs_embeds is not None and past_key_values is None:
|
1143 |
+
model_inputs = {'inputs_embeds': inputs_embeds}
|
1144 |
+
else:
|
1145 |
+
model_inputs = {'input_ids': input_ids}
|
1146 |
+
|
1147 |
+
model_inputs.update({
|
1148 |
+
'position_ids': position_ids,
|
1149 |
+
'past_key_values': past_key_values,
|
1150 |
+
'use_cache': kwargs.get('use_cache'),
|
1151 |
+
'attention_mask': attention_mask,
|
1152 |
+
})
|
1153 |
+
return model_inputs
|
1154 |
+
|
1155 |
+
@staticmethod
|
1156 |
+
def _reorder_cache(past_key_values, beam_idx):
|
1157 |
+
"""Reorder cached past key-values during generation using beam search.
|
1158 |
+
|
1159 |
+
This function reorders the cached past key-values according to the
|
1160 |
+
given indices. It's useful in beam search where the order of hypotheses
|
1161 |
+
can change from one time-step to another.
|
1162 |
+
"""
|
1163 |
+
reordered_past = ()
|
1164 |
+
for layer_past in past_key_values:
|
1165 |
+
reordered_past += (tuple(
|
1166 |
+
past_state.index_select(0, beam_idx.to(past_state.device))
|
1167 |
+
for past_state in layer_past), )
|
1168 |
+
return reordered_past
|
1169 |
+
|
1170 |
+
|
1171 |
+
@add_start_docstrings(
|
1172 |
+
""" # noqa: E501
|
1173 |
+
The LLaMa Model transformer with a sequence classification head on top (linear layer).
|
1174 |
+
|
1175 |
+
[`LlamaForSequenceClassification`] uses the last token in order to do the classification, as other causal models
|
1176 |
+
(e.g. GPT-2) do.
|
1177 |
+
|
1178 |
+
Since it does classification on the last token, it requires to know the position of the last token. If a
|
1179 |
+
`pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
|
1180 |
+
no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
|
1181 |
+
padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
|
1182 |
+
each row of the batch).
|
1183 |
+
""",
|
1184 |
+
LLAMA_START_DOCSTRING,
|
1185 |
+
)
|
1186 |
+
class LlamaForSequenceClassification(LlamaPreTrainedModel):
|
1187 |
+
|
1188 |
+
def __init__(self, config):
|
1189 |
+
super().__init__(config)
|
1190 |
+
self.num_labels = config.num_labels
|
1191 |
+
self.model = LlamaModel(config)
|
1192 |
+
self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
|
1193 |
+
|
1194 |
+
# Initialize weights and apply final processing
|
1195 |
+
self.post_init()
|
1196 |
+
|
1197 |
+
def get_input_embeddings(self):
|
1198 |
+
return self.model.embed_tokens
|
1199 |
+
|
1200 |
+
def set_input_embeddings(self, value):
|
1201 |
+
self.model.embed_tokens = value
|
1202 |
+
|
1203 |
+
@add_start_docstrings_to_model_forward(LLAMA_INPUTS_DOCSTRING)
|
1204 |
+
def forward(
|
1205 |
+
self,
|
1206 |
+
input_ids: torch.LongTensor = None,
|
1207 |
+
attention_mask: Optional[torch.Tensor] = None,
|
1208 |
+
position_ids: Optional[torch.LongTensor] = None,
|
1209 |
+
past_key_values: Optional[List[torch.FloatTensor]] = None,
|
1210 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
1211 |
+
labels: Optional[torch.LongTensor] = None,
|
1212 |
+
use_cache: Optional[bool] = None,
|
1213 |
+
output_attentions: Optional[bool] = None,
|
1214 |
+
output_hidden_states: Optional[bool] = None,
|
1215 |
+
return_dict: Optional[bool] = None,
|
1216 |
+
) -> Union[Tuple, SequenceClassifierOutputWithPast]:
|
1217 |
+
r""" # noqa: E501
|
1218 |
+
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
|
1219 |
+
Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
|
1220 |
+
config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
|
1221 |
+
`config.num_labels > 1` a classification loss is computed (Cross-Entropy).
|
1222 |
+
"""
|
1223 |
+
return_dict = (return_dict if return_dict is not None else
|
1224 |
+
self.config.use_return_dict)
|
1225 |
+
|
1226 |
+
transformer_outputs = self.model(
|
1227 |
+
input_ids,
|
1228 |
+
attention_mask=attention_mask,
|
1229 |
+
position_ids=position_ids,
|
1230 |
+
past_key_values=past_key_values,
|
1231 |
+
inputs_embeds=inputs_embeds,
|
1232 |
+
use_cache=use_cache,
|
1233 |
+
output_attentions=output_attentions,
|
1234 |
+
output_hidden_states=output_hidden_states,
|
1235 |
+
return_dict=return_dict,
|
1236 |
+
)
|
1237 |
+
hidden_states = transformer_outputs[0]
|
1238 |
+
logits = self.score(hidden_states)
|
1239 |
+
|
1240 |
+
if input_ids is not None:
|
1241 |
+
batch_size = input_ids.shape[0]
|
1242 |
+
else:
|
1243 |
+
batch_size = inputs_embeds.shape[0]
|
1244 |
+
|
1245 |
+
if self.config.pad_token_id is None and batch_size != 1:
|
1246 |
+
raise ValueError(
|
1247 |
+
'Cannot handle batch sizes > 1 if no padding token is defined.'
|
1248 |
+
)
|
1249 |
+
if self.config.pad_token_id is None:
|
1250 |
+
sequence_lengths = -1
|
1251 |
+
else:
|
1252 |
+
if input_ids is not None:
|
1253 |
+
sequence_lengths = (torch.eq(
|
1254 |
+
input_ids, self.config.pad_token_id).long().argmax(-1) -
|
1255 |
+
1).to(logits.device)
|
1256 |
+
else:
|
1257 |
+
sequence_lengths = -1
|
1258 |
+
|
1259 |
+
pooled_logits = logits[torch.arange(batch_size, device=logits.device),
|
1260 |
+
sequence_lengths]
|
1261 |
+
|
1262 |
+
loss = None
|
1263 |
+
if labels is not None:
|
1264 |
+
labels = labels.to(logits.device)
|
1265 |
+
if self.config.problem_type is None:
|
1266 |
+
if self.num_labels == 1:
|
1267 |
+
self.config.problem_type = 'regression'
|
1268 |
+
elif self.num_labels > 1 and (labels.dtype == torch.long
|
1269 |
+
or labels.dtype == torch.int):
|
1270 |
+
self.config.problem_type = 'single_label_classification'
|
1271 |
+
else:
|
1272 |
+
self.config.problem_type = 'multi_label_classification'
|
1273 |
+
|
1274 |
+
if self.config.problem_type == 'regression':
|
1275 |
+
loss_fct = MSELoss()
|
1276 |
+
if self.num_labels == 1:
|
1277 |
+
loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
|
1278 |
+
else:
|
1279 |
+
loss = loss_fct(pooled_logits, labels)
|
1280 |
+
elif self.config.problem_type == 'single_label_classification':
|
1281 |
+
loss_fct = CrossEntropyLoss()
|
1282 |
+
loss = loss_fct(pooled_logits.view(-1, self.num_labels),
|
1283 |
+
labels.view(-1))
|
1284 |
+
elif self.config.problem_type == 'multi_label_classification':
|
1285 |
+
loss_fct = BCEWithLogitsLoss()
|
1286 |
+
loss = loss_fct(pooled_logits, labels)
|
1287 |
+
if not return_dict:
|
1288 |
+
output = (pooled_logits, ) + transformer_outputs[1:]
|
1289 |
+
return ((loss, ) + output) if loss is not None else output
|
1290 |
+
|
1291 |
+
return SequenceClassifierOutputWithPast(
|
1292 |
+
loss=loss,
|
1293 |
+
logits=pooled_logits,
|
1294 |
+
past_key_values=transformer_outputs.past_key_values,
|
1295 |
+
hidden_states=transformer_outputs.hidden_states,
|
1296 |
+
attentions=transformer_outputs.attentions,
|
1297 |
+
)
|
outputs_stats.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:627291100a05c04d3242c86e297bb57b21d6d6f400377ea4864e0fa8a2cf6186
|
3 |
+
size 25957219
|
pytorch_model-00001-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5a27b1903bff4f27dc5f26dfde2fb495dc95dc135b8487fccab3ce9a8039e6db
|
3 |
+
size 1993584648
|
pytorch_model-00002-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6ab5ed7fc9d31dbda800a3350079b605abea39c195fc6e75d58477c0cfd7ac7f
|
3 |
+
size 1930835726
|
pytorch_model-00003-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bccb3dae15263a32a0c1cb184360a7d331f3972f83e088863c0b34a9ca47b0a2
|
3 |
+
size 1975435086
|
pytorch_model-00004-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:211cefb36dadd2ec21d400a4f67bee7526a35d36bf9a6ea782b4452c0dba42a3
|
3 |
+
size 1975435086
|
pytorch_model-00005-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:35a33532402753f14a4c670e7cfbf9539da79c4589acf0b1d5cec0ae04f58d70
|
3 |
+
size 1975421490
|
pytorch_model-00006-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dbeca98c6364bdceb9b605da6eec8f95e04d29df6b0b5f7f86a727de96c913e9
|
3 |
+
size 1983306968
|
pytorch_model-00007-of-00007.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b95a8c03defb66bf9aa44dbf8d77d6d28dc6f8737754c79534014b1dbd3d0aae
|
3 |
+
size 1518748450
|
pytorch_model.bin.index.json
ADDED
@@ -0,0 +1,650 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"metadata": {
|
3 |
+
"total_size": 13352540160
|
4 |
+
},
|
5 |
+
"weight_map": {
|
6 |
+
"lm_head.weight": "pytorch_model-00007-of-00007.bin",
|
7 |
+
"model.embed_tokens.weight": "pytorch_model-00001-of-00007.bin",
|
8 |
+
"model.layers.0.input_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
9 |
+
"model.layers.0.mlp.down_proj.scale": "pytorch_model-00001-of-00007.bin",
|
10 |
+
"model.layers.0.mlp.down_proj.weight": "pytorch_model-00001-of-00007.bin",
|
11 |
+
"model.layers.0.mlp.gate_proj.scale": "pytorch_model-00001-of-00007.bin",
|
12 |
+
"model.layers.0.mlp.gate_proj.weight": "pytorch_model-00001-of-00007.bin",
|
13 |
+
"model.layers.0.mlp.up_proj.scale": "pytorch_model-00001-of-00007.bin",
|
14 |
+
"model.layers.0.mlp.up_proj.weight": "pytorch_model-00001-of-00007.bin",
|
15 |
+
"model.layers.0.post_attention_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
16 |
+
"model.layers.0.self_attn.k_proj.scale": "pytorch_model-00001-of-00007.bin",
|
17 |
+
"model.layers.0.self_attn.k_proj.weight": "pytorch_model-00001-of-00007.bin",
|
18 |
+
"model.layers.0.self_attn.o_proj.scale": "pytorch_model-00001-of-00007.bin",
|
19 |
+
"model.layers.0.self_attn.o_proj.weight": "pytorch_model-00001-of-00007.bin",
|
20 |
+
"model.layers.0.self_attn.q_proj.scale": "pytorch_model-00001-of-00007.bin",
|
21 |
+
"model.layers.0.self_attn.q_proj.weight": "pytorch_model-00001-of-00007.bin",
|
22 |
+
"model.layers.0.self_attn.v_proj.scale": "pytorch_model-00001-of-00007.bin",
|
23 |
+
"model.layers.0.self_attn.v_proj.weight": "pytorch_model-00001-of-00007.bin",
|
24 |
+
"model.layers.1.input_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
25 |
+
"model.layers.1.mlp.down_proj.scale": "pytorch_model-00001-of-00007.bin",
|
26 |
+
"model.layers.1.mlp.down_proj.weight": "pytorch_model-00001-of-00007.bin",
|
27 |
+
"model.layers.1.mlp.gate_proj.scale": "pytorch_model-00001-of-00007.bin",
|
28 |
+
"model.layers.1.mlp.gate_proj.weight": "pytorch_model-00001-of-00007.bin",
|
29 |
+
"model.layers.1.mlp.up_proj.scale": "pytorch_model-00001-of-00007.bin",
|
30 |
+
"model.layers.1.mlp.up_proj.weight": "pytorch_model-00001-of-00007.bin",
|
31 |
+
"model.layers.1.post_attention_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
32 |
+
"model.layers.1.self_attn.k_proj.scale": "pytorch_model-00001-of-00007.bin",
|
33 |
+
"model.layers.1.self_attn.k_proj.weight": "pytorch_model-00001-of-00007.bin",
|
34 |
+
"model.layers.1.self_attn.o_proj.scale": "pytorch_model-00001-of-00007.bin",
|
35 |
+
"model.layers.1.self_attn.o_proj.weight": "pytorch_model-00001-of-00007.bin",
|
36 |
+
"model.layers.1.self_attn.q_proj.scale": "pytorch_model-00001-of-00007.bin",
|
37 |
+
"model.layers.1.self_attn.q_proj.weight": "pytorch_model-00001-of-00007.bin",
|
38 |
+
"model.layers.1.self_attn.v_proj.scale": "pytorch_model-00001-of-00007.bin",
|
39 |
+
"model.layers.1.self_attn.v_proj.weight": "pytorch_model-00001-of-00007.bin",
|
40 |
+
"model.layers.10.input_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
41 |
+
"model.layers.10.mlp.down_proj.scale": "pytorch_model-00002-of-00007.bin",
|
42 |
+
"model.layers.10.mlp.down_proj.weight": "pytorch_model-00002-of-00007.bin",
|
43 |
+
"model.layers.10.mlp.gate_proj.scale": "pytorch_model-00002-of-00007.bin",
|
44 |
+
"model.layers.10.mlp.gate_proj.weight": "pytorch_model-00002-of-00007.bin",
|
45 |
+
"model.layers.10.mlp.up_proj.scale": "pytorch_model-00002-of-00007.bin",
|
46 |
+
"model.layers.10.mlp.up_proj.weight": "pytorch_model-00002-of-00007.bin",
|
47 |
+
"model.layers.10.post_attention_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
48 |
+
"model.layers.10.self_attn.k_proj.scale": "pytorch_model-00002-of-00007.bin",
|
49 |
+
"model.layers.10.self_attn.k_proj.weight": "pytorch_model-00002-of-00007.bin",
|
50 |
+
"model.layers.10.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
51 |
+
"model.layers.10.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
52 |
+
"model.layers.10.self_attn.q_proj.scale": "pytorch_model-00002-of-00007.bin",
|
53 |
+
"model.layers.10.self_attn.q_proj.weight": "pytorch_model-00002-of-00007.bin",
|
54 |
+
"model.layers.10.self_attn.v_proj.scale": "pytorch_model-00002-of-00007.bin",
|
55 |
+
"model.layers.10.self_attn.v_proj.weight": "pytorch_model-00002-of-00007.bin",
|
56 |
+
"model.layers.11.input_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
57 |
+
"model.layers.11.mlp.down_proj.scale": "pytorch_model-00003-of-00007.bin",
|
58 |
+
"model.layers.11.mlp.down_proj.weight": "pytorch_model-00003-of-00007.bin",
|
59 |
+
"model.layers.11.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
60 |
+
"model.layers.11.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
61 |
+
"model.layers.11.mlp.up_proj.scale": "pytorch_model-00003-of-00007.bin",
|
62 |
+
"model.layers.11.mlp.up_proj.weight": "pytorch_model-00003-of-00007.bin",
|
63 |
+
"model.layers.11.post_attention_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
64 |
+
"model.layers.11.self_attn.k_proj.scale": "pytorch_model-00002-of-00007.bin",
|
65 |
+
"model.layers.11.self_attn.k_proj.weight": "pytorch_model-00002-of-00007.bin",
|
66 |
+
"model.layers.11.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
67 |
+
"model.layers.11.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
68 |
+
"model.layers.11.self_attn.q_proj.scale": "pytorch_model-00002-of-00007.bin",
|
69 |
+
"model.layers.11.self_attn.q_proj.weight": "pytorch_model-00002-of-00007.bin",
|
70 |
+
"model.layers.11.self_attn.v_proj.scale": "pytorch_model-00002-of-00007.bin",
|
71 |
+
"model.layers.11.self_attn.v_proj.weight": "pytorch_model-00002-of-00007.bin",
|
72 |
+
"model.layers.12.input_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
73 |
+
"model.layers.12.mlp.down_proj.scale": "pytorch_model-00003-of-00007.bin",
|
74 |
+
"model.layers.12.mlp.down_proj.weight": "pytorch_model-00003-of-00007.bin",
|
75 |
+
"model.layers.12.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
76 |
+
"model.layers.12.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
77 |
+
"model.layers.12.mlp.up_proj.scale": "pytorch_model-00003-of-00007.bin",
|
78 |
+
"model.layers.12.mlp.up_proj.weight": "pytorch_model-00003-of-00007.bin",
|
79 |
+
"model.layers.12.post_attention_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
80 |
+
"model.layers.12.self_attn.k_proj.scale": "pytorch_model-00003-of-00007.bin",
|
81 |
+
"model.layers.12.self_attn.k_proj.weight": "pytorch_model-00003-of-00007.bin",
|
82 |
+
"model.layers.12.self_attn.o_proj.scale": "pytorch_model-00003-of-00007.bin",
|
83 |
+
"model.layers.12.self_attn.o_proj.weight": "pytorch_model-00003-of-00007.bin",
|
84 |
+
"model.layers.12.self_attn.q_proj.scale": "pytorch_model-00003-of-00007.bin",
|
85 |
+
"model.layers.12.self_attn.q_proj.weight": "pytorch_model-00003-of-00007.bin",
|
86 |
+
"model.layers.12.self_attn.v_proj.scale": "pytorch_model-00003-of-00007.bin",
|
87 |
+
"model.layers.12.self_attn.v_proj.weight": "pytorch_model-00003-of-00007.bin",
|
88 |
+
"model.layers.13.input_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
89 |
+
"model.layers.13.mlp.down_proj.scale": "pytorch_model-00003-of-00007.bin",
|
90 |
+
"model.layers.13.mlp.down_proj.weight": "pytorch_model-00003-of-00007.bin",
|
91 |
+
"model.layers.13.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
92 |
+
"model.layers.13.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
93 |
+
"model.layers.13.mlp.up_proj.scale": "pytorch_model-00003-of-00007.bin",
|
94 |
+
"model.layers.13.mlp.up_proj.weight": "pytorch_model-00003-of-00007.bin",
|
95 |
+
"model.layers.13.post_attention_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
96 |
+
"model.layers.13.self_attn.k_proj.scale": "pytorch_model-00003-of-00007.bin",
|
97 |
+
"model.layers.13.self_attn.k_proj.weight": "pytorch_model-00003-of-00007.bin",
|
98 |
+
"model.layers.13.self_attn.o_proj.scale": "pytorch_model-00003-of-00007.bin",
|
99 |
+
"model.layers.13.self_attn.o_proj.weight": "pytorch_model-00003-of-00007.bin",
|
100 |
+
"model.layers.13.self_attn.q_proj.scale": "pytorch_model-00003-of-00007.bin",
|
101 |
+
"model.layers.13.self_attn.q_proj.weight": "pytorch_model-00003-of-00007.bin",
|
102 |
+
"model.layers.13.self_attn.v_proj.scale": "pytorch_model-00003-of-00007.bin",
|
103 |
+
"model.layers.13.self_attn.v_proj.weight": "pytorch_model-00003-of-00007.bin",
|
104 |
+
"model.layers.14.input_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
105 |
+
"model.layers.14.mlp.down_proj.scale": "pytorch_model-00003-of-00007.bin",
|
106 |
+
"model.layers.14.mlp.down_proj.weight": "pytorch_model-00003-of-00007.bin",
|
107 |
+
"model.layers.14.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
108 |
+
"model.layers.14.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
109 |
+
"model.layers.14.mlp.up_proj.scale": "pytorch_model-00003-of-00007.bin",
|
110 |
+
"model.layers.14.mlp.up_proj.weight": "pytorch_model-00003-of-00007.bin",
|
111 |
+
"model.layers.14.post_attention_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
112 |
+
"model.layers.14.self_attn.k_proj.scale": "pytorch_model-00003-of-00007.bin",
|
113 |
+
"model.layers.14.self_attn.k_proj.weight": "pytorch_model-00003-of-00007.bin",
|
114 |
+
"model.layers.14.self_attn.o_proj.scale": "pytorch_model-00003-of-00007.bin",
|
115 |
+
"model.layers.14.self_attn.o_proj.weight": "pytorch_model-00003-of-00007.bin",
|
116 |
+
"model.layers.14.self_attn.q_proj.scale": "pytorch_model-00003-of-00007.bin",
|
117 |
+
"model.layers.14.self_attn.q_proj.weight": "pytorch_model-00003-of-00007.bin",
|
118 |
+
"model.layers.14.self_attn.v_proj.scale": "pytorch_model-00003-of-00007.bin",
|
119 |
+
"model.layers.14.self_attn.v_proj.weight": "pytorch_model-00003-of-00007.bin",
|
120 |
+
"model.layers.15.input_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
121 |
+
"model.layers.15.mlp.down_proj.scale": "pytorch_model-00003-of-00007.bin",
|
122 |
+
"model.layers.15.mlp.down_proj.weight": "pytorch_model-00003-of-00007.bin",
|
123 |
+
"model.layers.15.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
124 |
+
"model.layers.15.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
125 |
+
"model.layers.15.mlp.up_proj.scale": "pytorch_model-00003-of-00007.bin",
|
126 |
+
"model.layers.15.mlp.up_proj.weight": "pytorch_model-00003-of-00007.bin",
|
127 |
+
"model.layers.15.post_attention_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
128 |
+
"model.layers.15.self_attn.k_proj.scale": "pytorch_model-00003-of-00007.bin",
|
129 |
+
"model.layers.15.self_attn.k_proj.weight": "pytorch_model-00003-of-00007.bin",
|
130 |
+
"model.layers.15.self_attn.o_proj.scale": "pytorch_model-00003-of-00007.bin",
|
131 |
+
"model.layers.15.self_attn.o_proj.weight": "pytorch_model-00003-of-00007.bin",
|
132 |
+
"model.layers.15.self_attn.q_proj.scale": "pytorch_model-00003-of-00007.bin",
|
133 |
+
"model.layers.15.self_attn.q_proj.weight": "pytorch_model-00003-of-00007.bin",
|
134 |
+
"model.layers.15.self_attn.v_proj.scale": "pytorch_model-00003-of-00007.bin",
|
135 |
+
"model.layers.15.self_attn.v_proj.weight": "pytorch_model-00003-of-00007.bin",
|
136 |
+
"model.layers.16.input_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
137 |
+
"model.layers.16.mlp.down_proj.scale": "pytorch_model-00003-of-00007.bin",
|
138 |
+
"model.layers.16.mlp.down_proj.weight": "pytorch_model-00003-of-00007.bin",
|
139 |
+
"model.layers.16.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
140 |
+
"model.layers.16.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
141 |
+
"model.layers.16.mlp.up_proj.scale": "pytorch_model-00003-of-00007.bin",
|
142 |
+
"model.layers.16.mlp.up_proj.weight": "pytorch_model-00003-of-00007.bin",
|
143 |
+
"model.layers.16.post_attention_layernorm.weight": "pytorch_model-00003-of-00007.bin",
|
144 |
+
"model.layers.16.self_attn.k_proj.scale": "pytorch_model-00003-of-00007.bin",
|
145 |
+
"model.layers.16.self_attn.k_proj.weight": "pytorch_model-00003-of-00007.bin",
|
146 |
+
"model.layers.16.self_attn.o_proj.scale": "pytorch_model-00003-of-00007.bin",
|
147 |
+
"model.layers.16.self_attn.o_proj.weight": "pytorch_model-00003-of-00007.bin",
|
148 |
+
"model.layers.16.self_attn.q_proj.scale": "pytorch_model-00003-of-00007.bin",
|
149 |
+
"model.layers.16.self_attn.q_proj.weight": "pytorch_model-00003-of-00007.bin",
|
150 |
+
"model.layers.16.self_attn.v_proj.scale": "pytorch_model-00003-of-00007.bin",
|
151 |
+
"model.layers.16.self_attn.v_proj.weight": "pytorch_model-00003-of-00007.bin",
|
152 |
+
"model.layers.17.input_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
153 |
+
"model.layers.17.mlp.down_proj.scale": "pytorch_model-00004-of-00007.bin",
|
154 |
+
"model.layers.17.mlp.down_proj.weight": "pytorch_model-00004-of-00007.bin",
|
155 |
+
"model.layers.17.mlp.gate_proj.scale": "pytorch_model-00003-of-00007.bin",
|
156 |
+
"model.layers.17.mlp.gate_proj.weight": "pytorch_model-00003-of-00007.bin",
|
157 |
+
"model.layers.17.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
158 |
+
"model.layers.17.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
159 |
+
"model.layers.17.post_attention_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
160 |
+
"model.layers.17.self_attn.k_proj.scale": "pytorch_model-00003-of-00007.bin",
|
161 |
+
"model.layers.17.self_attn.k_proj.weight": "pytorch_model-00003-of-00007.bin",
|
162 |
+
"model.layers.17.self_attn.o_proj.scale": "pytorch_model-00003-of-00007.bin",
|
163 |
+
"model.layers.17.self_attn.o_proj.weight": "pytorch_model-00003-of-00007.bin",
|
164 |
+
"model.layers.17.self_attn.q_proj.scale": "pytorch_model-00003-of-00007.bin",
|
165 |
+
"model.layers.17.self_attn.q_proj.weight": "pytorch_model-00003-of-00007.bin",
|
166 |
+
"model.layers.17.self_attn.v_proj.scale": "pytorch_model-00003-of-00007.bin",
|
167 |
+
"model.layers.17.self_attn.v_proj.weight": "pytorch_model-00003-of-00007.bin",
|
168 |
+
"model.layers.18.input_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
169 |
+
"model.layers.18.mlp.down_proj.scale": "pytorch_model-00004-of-00007.bin",
|
170 |
+
"model.layers.18.mlp.down_proj.weight": "pytorch_model-00004-of-00007.bin",
|
171 |
+
"model.layers.18.mlp.gate_proj.scale": "pytorch_model-00004-of-00007.bin",
|
172 |
+
"model.layers.18.mlp.gate_proj.weight": "pytorch_model-00004-of-00007.bin",
|
173 |
+
"model.layers.18.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
174 |
+
"model.layers.18.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
175 |
+
"model.layers.18.post_attention_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
176 |
+
"model.layers.18.self_attn.k_proj.scale": "pytorch_model-00004-of-00007.bin",
|
177 |
+
"model.layers.18.self_attn.k_proj.weight": "pytorch_model-00004-of-00007.bin",
|
178 |
+
"model.layers.18.self_attn.o_proj.scale": "pytorch_model-00004-of-00007.bin",
|
179 |
+
"model.layers.18.self_attn.o_proj.weight": "pytorch_model-00004-of-00007.bin",
|
180 |
+
"model.layers.18.self_attn.q_proj.scale": "pytorch_model-00004-of-00007.bin",
|
181 |
+
"model.layers.18.self_attn.q_proj.weight": "pytorch_model-00004-of-00007.bin",
|
182 |
+
"model.layers.18.self_attn.v_proj.scale": "pytorch_model-00004-of-00007.bin",
|
183 |
+
"model.layers.18.self_attn.v_proj.weight": "pytorch_model-00004-of-00007.bin",
|
184 |
+
"model.layers.19.input_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
185 |
+
"model.layers.19.mlp.down_proj.scale": "pytorch_model-00004-of-00007.bin",
|
186 |
+
"model.layers.19.mlp.down_proj.weight": "pytorch_model-00004-of-00007.bin",
|
187 |
+
"model.layers.19.mlp.gate_proj.scale": "pytorch_model-00004-of-00007.bin",
|
188 |
+
"model.layers.19.mlp.gate_proj.weight": "pytorch_model-00004-of-00007.bin",
|
189 |
+
"model.layers.19.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
190 |
+
"model.layers.19.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
191 |
+
"model.layers.19.post_attention_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
192 |
+
"model.layers.19.self_attn.k_proj.scale": "pytorch_model-00004-of-00007.bin",
|
193 |
+
"model.layers.19.self_attn.k_proj.weight": "pytorch_model-00004-of-00007.bin",
|
194 |
+
"model.layers.19.self_attn.o_proj.scale": "pytorch_model-00004-of-00007.bin",
|
195 |
+
"model.layers.19.self_attn.o_proj.weight": "pytorch_model-00004-of-00007.bin",
|
196 |
+
"model.layers.19.self_attn.q_proj.scale": "pytorch_model-00004-of-00007.bin",
|
197 |
+
"model.layers.19.self_attn.q_proj.weight": "pytorch_model-00004-of-00007.bin",
|
198 |
+
"model.layers.19.self_attn.v_proj.scale": "pytorch_model-00004-of-00007.bin",
|
199 |
+
"model.layers.19.self_attn.v_proj.weight": "pytorch_model-00004-of-00007.bin",
|
200 |
+
"model.layers.2.input_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
201 |
+
"model.layers.2.mlp.down_proj.scale": "pytorch_model-00001-of-00007.bin",
|
202 |
+
"model.layers.2.mlp.down_proj.weight": "pytorch_model-00001-of-00007.bin",
|
203 |
+
"model.layers.2.mlp.gate_proj.scale": "pytorch_model-00001-of-00007.bin",
|
204 |
+
"model.layers.2.mlp.gate_proj.weight": "pytorch_model-00001-of-00007.bin",
|
205 |
+
"model.layers.2.mlp.up_proj.scale": "pytorch_model-00001-of-00007.bin",
|
206 |
+
"model.layers.2.mlp.up_proj.weight": "pytorch_model-00001-of-00007.bin",
|
207 |
+
"model.layers.2.post_attention_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
208 |
+
"model.layers.2.self_attn.k_proj.scale": "pytorch_model-00001-of-00007.bin",
|
209 |
+
"model.layers.2.self_attn.k_proj.weight": "pytorch_model-00001-of-00007.bin",
|
210 |
+
"model.layers.2.self_attn.o_proj.scale": "pytorch_model-00001-of-00007.bin",
|
211 |
+
"model.layers.2.self_attn.o_proj.weight": "pytorch_model-00001-of-00007.bin",
|
212 |
+
"model.layers.2.self_attn.q_proj.scale": "pytorch_model-00001-of-00007.bin",
|
213 |
+
"model.layers.2.self_attn.q_proj.weight": "pytorch_model-00001-of-00007.bin",
|
214 |
+
"model.layers.2.self_attn.v_proj.scale": "pytorch_model-00001-of-00007.bin",
|
215 |
+
"model.layers.2.self_attn.v_proj.weight": "pytorch_model-00001-of-00007.bin",
|
216 |
+
"model.layers.20.input_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
217 |
+
"model.layers.20.mlp.down_proj.scale": "pytorch_model-00004-of-00007.bin",
|
218 |
+
"model.layers.20.mlp.down_proj.weight": "pytorch_model-00004-of-00007.bin",
|
219 |
+
"model.layers.20.mlp.gate_proj.scale": "pytorch_model-00004-of-00007.bin",
|
220 |
+
"model.layers.20.mlp.gate_proj.weight": "pytorch_model-00004-of-00007.bin",
|
221 |
+
"model.layers.20.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
222 |
+
"model.layers.20.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
223 |
+
"model.layers.20.post_attention_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
224 |
+
"model.layers.20.self_attn.k_proj.scale": "pytorch_model-00004-of-00007.bin",
|
225 |
+
"model.layers.20.self_attn.k_proj.weight": "pytorch_model-00004-of-00007.bin",
|
226 |
+
"model.layers.20.self_attn.o_proj.scale": "pytorch_model-00004-of-00007.bin",
|
227 |
+
"model.layers.20.self_attn.o_proj.weight": "pytorch_model-00004-of-00007.bin",
|
228 |
+
"model.layers.20.self_attn.q_proj.scale": "pytorch_model-00004-of-00007.bin",
|
229 |
+
"model.layers.20.self_attn.q_proj.weight": "pytorch_model-00004-of-00007.bin",
|
230 |
+
"model.layers.20.self_attn.v_proj.scale": "pytorch_model-00004-of-00007.bin",
|
231 |
+
"model.layers.20.self_attn.v_proj.weight": "pytorch_model-00004-of-00007.bin",
|
232 |
+
"model.layers.21.input_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
233 |
+
"model.layers.21.mlp.down_proj.scale": "pytorch_model-00004-of-00007.bin",
|
234 |
+
"model.layers.21.mlp.down_proj.weight": "pytorch_model-00004-of-00007.bin",
|
235 |
+
"model.layers.21.mlp.gate_proj.scale": "pytorch_model-00004-of-00007.bin",
|
236 |
+
"model.layers.21.mlp.gate_proj.weight": "pytorch_model-00004-of-00007.bin",
|
237 |
+
"model.layers.21.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
238 |
+
"model.layers.21.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
239 |
+
"model.layers.21.post_attention_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
240 |
+
"model.layers.21.self_attn.k_proj.scale": "pytorch_model-00004-of-00007.bin",
|
241 |
+
"model.layers.21.self_attn.k_proj.weight": "pytorch_model-00004-of-00007.bin",
|
242 |
+
"model.layers.21.self_attn.o_proj.scale": "pytorch_model-00004-of-00007.bin",
|
243 |
+
"model.layers.21.self_attn.o_proj.weight": "pytorch_model-00004-of-00007.bin",
|
244 |
+
"model.layers.21.self_attn.q_proj.scale": "pytorch_model-00004-of-00007.bin",
|
245 |
+
"model.layers.21.self_attn.q_proj.weight": "pytorch_model-00004-of-00007.bin",
|
246 |
+
"model.layers.21.self_attn.v_proj.scale": "pytorch_model-00004-of-00007.bin",
|
247 |
+
"model.layers.21.self_attn.v_proj.weight": "pytorch_model-00004-of-00007.bin",
|
248 |
+
"model.layers.22.input_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
249 |
+
"model.layers.22.mlp.down_proj.scale": "pytorch_model-00004-of-00007.bin",
|
250 |
+
"model.layers.22.mlp.down_proj.weight": "pytorch_model-00004-of-00007.bin",
|
251 |
+
"model.layers.22.mlp.gate_proj.scale": "pytorch_model-00004-of-00007.bin",
|
252 |
+
"model.layers.22.mlp.gate_proj.weight": "pytorch_model-00004-of-00007.bin",
|
253 |
+
"model.layers.22.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
254 |
+
"model.layers.22.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
255 |
+
"model.layers.22.post_attention_layernorm.weight": "pytorch_model-00004-of-00007.bin",
|
256 |
+
"model.layers.22.self_attn.k_proj.scale": "pytorch_model-00004-of-00007.bin",
|
257 |
+
"model.layers.22.self_attn.k_proj.weight": "pytorch_model-00004-of-00007.bin",
|
258 |
+
"model.layers.22.self_attn.o_proj.scale": "pytorch_model-00004-of-00007.bin",
|
259 |
+
"model.layers.22.self_attn.o_proj.weight": "pytorch_model-00004-of-00007.bin",
|
260 |
+
"model.layers.22.self_attn.q_proj.scale": "pytorch_model-00004-of-00007.bin",
|
261 |
+
"model.layers.22.self_attn.q_proj.weight": "pytorch_model-00004-of-00007.bin",
|
262 |
+
"model.layers.22.self_attn.v_proj.scale": "pytorch_model-00004-of-00007.bin",
|
263 |
+
"model.layers.22.self_attn.v_proj.weight": "pytorch_model-00004-of-00007.bin",
|
264 |
+
"model.layers.23.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
265 |
+
"model.layers.23.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
266 |
+
"model.layers.23.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
267 |
+
"model.layers.23.mlp.gate_proj.scale": "pytorch_model-00004-of-00007.bin",
|
268 |
+
"model.layers.23.mlp.gate_proj.weight": "pytorch_model-00004-of-00007.bin",
|
269 |
+
"model.layers.23.mlp.up_proj.scale": "pytorch_model-00004-of-00007.bin",
|
270 |
+
"model.layers.23.mlp.up_proj.weight": "pytorch_model-00004-of-00007.bin",
|
271 |
+
"model.layers.23.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
272 |
+
"model.layers.23.self_attn.k_proj.scale": "pytorch_model-00004-of-00007.bin",
|
273 |
+
"model.layers.23.self_attn.k_proj.weight": "pytorch_model-00004-of-00007.bin",
|
274 |
+
"model.layers.23.self_attn.o_proj.scale": "pytorch_model-00004-of-00007.bin",
|
275 |
+
"model.layers.23.self_attn.o_proj.weight": "pytorch_model-00004-of-00007.bin",
|
276 |
+
"model.layers.23.self_attn.q_proj.scale": "pytorch_model-00004-of-00007.bin",
|
277 |
+
"model.layers.23.self_attn.q_proj.weight": "pytorch_model-00004-of-00007.bin",
|
278 |
+
"model.layers.23.self_attn.v_proj.scale": "pytorch_model-00004-of-00007.bin",
|
279 |
+
"model.layers.23.self_attn.v_proj.weight": "pytorch_model-00004-of-00007.bin",
|
280 |
+
"model.layers.24.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
281 |
+
"model.layers.24.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
282 |
+
"model.layers.24.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
283 |
+
"model.layers.24.mlp.gate_proj.scale": "pytorch_model-00005-of-00007.bin",
|
284 |
+
"model.layers.24.mlp.gate_proj.weight": "pytorch_model-00005-of-00007.bin",
|
285 |
+
"model.layers.24.mlp.up_proj.scale": "pytorch_model-00005-of-00007.bin",
|
286 |
+
"model.layers.24.mlp.up_proj.weight": "pytorch_model-00005-of-00007.bin",
|
287 |
+
"model.layers.24.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
288 |
+
"model.layers.24.self_attn.k_proj.scale": "pytorch_model-00005-of-00007.bin",
|
289 |
+
"model.layers.24.self_attn.k_proj.weight": "pytorch_model-00005-of-00007.bin",
|
290 |
+
"model.layers.24.self_attn.o_proj.scale": "pytorch_model-00005-of-00007.bin",
|
291 |
+
"model.layers.24.self_attn.o_proj.weight": "pytorch_model-00005-of-00007.bin",
|
292 |
+
"model.layers.24.self_attn.q_proj.scale": "pytorch_model-00005-of-00007.bin",
|
293 |
+
"model.layers.24.self_attn.q_proj.weight": "pytorch_model-00005-of-00007.bin",
|
294 |
+
"model.layers.24.self_attn.v_proj.scale": "pytorch_model-00005-of-00007.bin",
|
295 |
+
"model.layers.24.self_attn.v_proj.weight": "pytorch_model-00005-of-00007.bin",
|
296 |
+
"model.layers.25.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
297 |
+
"model.layers.25.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
298 |
+
"model.layers.25.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
299 |
+
"model.layers.25.mlp.gate_proj.scale": "pytorch_model-00005-of-00007.bin",
|
300 |
+
"model.layers.25.mlp.gate_proj.weight": "pytorch_model-00005-of-00007.bin",
|
301 |
+
"model.layers.25.mlp.up_proj.scale": "pytorch_model-00005-of-00007.bin",
|
302 |
+
"model.layers.25.mlp.up_proj.weight": "pytorch_model-00005-of-00007.bin",
|
303 |
+
"model.layers.25.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
304 |
+
"model.layers.25.self_attn.k_proj.scale": "pytorch_model-00005-of-00007.bin",
|
305 |
+
"model.layers.25.self_attn.k_proj.weight": "pytorch_model-00005-of-00007.bin",
|
306 |
+
"model.layers.25.self_attn.o_proj.scale": "pytorch_model-00005-of-00007.bin",
|
307 |
+
"model.layers.25.self_attn.o_proj.weight": "pytorch_model-00005-of-00007.bin",
|
308 |
+
"model.layers.25.self_attn.q_proj.scale": "pytorch_model-00005-of-00007.bin",
|
309 |
+
"model.layers.25.self_attn.q_proj.weight": "pytorch_model-00005-of-00007.bin",
|
310 |
+
"model.layers.25.self_attn.v_proj.scale": "pytorch_model-00005-of-00007.bin",
|
311 |
+
"model.layers.25.self_attn.v_proj.weight": "pytorch_model-00005-of-00007.bin",
|
312 |
+
"model.layers.26.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
313 |
+
"model.layers.26.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
314 |
+
"model.layers.26.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
315 |
+
"model.layers.26.mlp.gate_proj.scale": "pytorch_model-00005-of-00007.bin",
|
316 |
+
"model.layers.26.mlp.gate_proj.weight": "pytorch_model-00005-of-00007.bin",
|
317 |
+
"model.layers.26.mlp.up_proj.scale": "pytorch_model-00005-of-00007.bin",
|
318 |
+
"model.layers.26.mlp.up_proj.weight": "pytorch_model-00005-of-00007.bin",
|
319 |
+
"model.layers.26.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
320 |
+
"model.layers.26.self_attn.k_proj.scale": "pytorch_model-00005-of-00007.bin",
|
321 |
+
"model.layers.26.self_attn.k_proj.weight": "pytorch_model-00005-of-00007.bin",
|
322 |
+
"model.layers.26.self_attn.o_proj.scale": "pytorch_model-00005-of-00007.bin",
|
323 |
+
"model.layers.26.self_attn.o_proj.weight": "pytorch_model-00005-of-00007.bin",
|
324 |
+
"model.layers.26.self_attn.q_proj.scale": "pytorch_model-00005-of-00007.bin",
|
325 |
+
"model.layers.26.self_attn.q_proj.weight": "pytorch_model-00005-of-00007.bin",
|
326 |
+
"model.layers.26.self_attn.v_proj.scale": "pytorch_model-00005-of-00007.bin",
|
327 |
+
"model.layers.26.self_attn.v_proj.weight": "pytorch_model-00005-of-00007.bin",
|
328 |
+
"model.layers.27.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
329 |
+
"model.layers.27.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
330 |
+
"model.layers.27.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
331 |
+
"model.layers.27.mlp.gate_proj.scale": "pytorch_model-00005-of-00007.bin",
|
332 |
+
"model.layers.27.mlp.gate_proj.weight": "pytorch_model-00005-of-00007.bin",
|
333 |
+
"model.layers.27.mlp.up_proj.scale": "pytorch_model-00005-of-00007.bin",
|
334 |
+
"model.layers.27.mlp.up_proj.weight": "pytorch_model-00005-of-00007.bin",
|
335 |
+
"model.layers.27.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
336 |
+
"model.layers.27.self_attn.k_proj.scale": "pytorch_model-00005-of-00007.bin",
|
337 |
+
"model.layers.27.self_attn.k_proj.weight": "pytorch_model-00005-of-00007.bin",
|
338 |
+
"model.layers.27.self_attn.o_proj.scale": "pytorch_model-00005-of-00007.bin",
|
339 |
+
"model.layers.27.self_attn.o_proj.weight": "pytorch_model-00005-of-00007.bin",
|
340 |
+
"model.layers.27.self_attn.q_proj.scale": "pytorch_model-00005-of-00007.bin",
|
341 |
+
"model.layers.27.self_attn.q_proj.weight": "pytorch_model-00005-of-00007.bin",
|
342 |
+
"model.layers.27.self_attn.v_proj.scale": "pytorch_model-00005-of-00007.bin",
|
343 |
+
"model.layers.27.self_attn.v_proj.weight": "pytorch_model-00005-of-00007.bin",
|
344 |
+
"model.layers.28.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
345 |
+
"model.layers.28.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
346 |
+
"model.layers.28.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
347 |
+
"model.layers.28.mlp.gate_proj.scale": "pytorch_model-00005-of-00007.bin",
|
348 |
+
"model.layers.28.mlp.gate_proj.weight": "pytorch_model-00005-of-00007.bin",
|
349 |
+
"model.layers.28.mlp.up_proj.scale": "pytorch_model-00005-of-00007.bin",
|
350 |
+
"model.layers.28.mlp.up_proj.weight": "pytorch_model-00005-of-00007.bin",
|
351 |
+
"model.layers.28.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
352 |
+
"model.layers.28.self_attn.k_proj.scale": "pytorch_model-00005-of-00007.bin",
|
353 |
+
"model.layers.28.self_attn.k_proj.weight": "pytorch_model-00005-of-00007.bin",
|
354 |
+
"model.layers.28.self_attn.o_proj.scale": "pytorch_model-00005-of-00007.bin",
|
355 |
+
"model.layers.28.self_attn.o_proj.weight": "pytorch_model-00005-of-00007.bin",
|
356 |
+
"model.layers.28.self_attn.q_proj.scale": "pytorch_model-00005-of-00007.bin",
|
357 |
+
"model.layers.28.self_attn.q_proj.weight": "pytorch_model-00005-of-00007.bin",
|
358 |
+
"model.layers.28.self_attn.v_proj.scale": "pytorch_model-00005-of-00007.bin",
|
359 |
+
"model.layers.28.self_attn.v_proj.weight": "pytorch_model-00005-of-00007.bin",
|
360 |
+
"model.layers.29.input_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
361 |
+
"model.layers.29.mlp.down_proj.scale": "pytorch_model-00005-of-00007.bin",
|
362 |
+
"model.layers.29.mlp.down_proj.weight": "pytorch_model-00005-of-00007.bin",
|
363 |
+
"model.layers.29.mlp.gate_proj.scale": "pytorch_model-00005-of-00007.bin",
|
364 |
+
"model.layers.29.mlp.gate_proj.weight": "pytorch_model-00005-of-00007.bin",
|
365 |
+
"model.layers.29.mlp.up_proj.scale": "pytorch_model-00005-of-00007.bin",
|
366 |
+
"model.layers.29.mlp.up_proj.weight": "pytorch_model-00005-of-00007.bin",
|
367 |
+
"model.layers.29.post_attention_layernorm.weight": "pytorch_model-00005-of-00007.bin",
|
368 |
+
"model.layers.29.self_attn.k_proj.scale": "pytorch_model-00005-of-00007.bin",
|
369 |
+
"model.layers.29.self_attn.k_proj.weight": "pytorch_model-00005-of-00007.bin",
|
370 |
+
"model.layers.29.self_attn.o_proj.scale": "pytorch_model-00005-of-00007.bin",
|
371 |
+
"model.layers.29.self_attn.o_proj.weight": "pytorch_model-00005-of-00007.bin",
|
372 |
+
"model.layers.29.self_attn.q_proj.scale": "pytorch_model-00005-of-00007.bin",
|
373 |
+
"model.layers.29.self_attn.q_proj.weight": "pytorch_model-00005-of-00007.bin",
|
374 |
+
"model.layers.29.self_attn.v_proj.scale": "pytorch_model-00005-of-00007.bin",
|
375 |
+
"model.layers.29.self_attn.v_proj.weight": "pytorch_model-00005-of-00007.bin",
|
376 |
+
"model.layers.3.input_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
377 |
+
"model.layers.3.mlp.down_proj.scale": "pytorch_model-00001-of-00007.bin",
|
378 |
+
"model.layers.3.mlp.down_proj.weight": "pytorch_model-00001-of-00007.bin",
|
379 |
+
"model.layers.3.mlp.gate_proj.scale": "pytorch_model-00001-of-00007.bin",
|
380 |
+
"model.layers.3.mlp.gate_proj.weight": "pytorch_model-00001-of-00007.bin",
|
381 |
+
"model.layers.3.mlp.up_proj.scale": "pytorch_model-00001-of-00007.bin",
|
382 |
+
"model.layers.3.mlp.up_proj.weight": "pytorch_model-00001-of-00007.bin",
|
383 |
+
"model.layers.3.post_attention_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
384 |
+
"model.layers.3.self_attn.k_proj.scale": "pytorch_model-00001-of-00007.bin",
|
385 |
+
"model.layers.3.self_attn.k_proj.weight": "pytorch_model-00001-of-00007.bin",
|
386 |
+
"model.layers.3.self_attn.o_proj.scale": "pytorch_model-00001-of-00007.bin",
|
387 |
+
"model.layers.3.self_attn.o_proj.weight": "pytorch_model-00001-of-00007.bin",
|
388 |
+
"model.layers.3.self_attn.q_proj.scale": "pytorch_model-00001-of-00007.bin",
|
389 |
+
"model.layers.3.self_attn.q_proj.weight": "pytorch_model-00001-of-00007.bin",
|
390 |
+
"model.layers.3.self_attn.v_proj.scale": "pytorch_model-00001-of-00007.bin",
|
391 |
+
"model.layers.3.self_attn.v_proj.weight": "pytorch_model-00001-of-00007.bin",
|
392 |
+
"model.layers.30.input_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
393 |
+
"model.layers.30.mlp.down_proj.scale": "pytorch_model-00006-of-00007.bin",
|
394 |
+
"model.layers.30.mlp.down_proj.weight": "pytorch_model-00006-of-00007.bin",
|
395 |
+
"model.layers.30.mlp.gate_proj.scale": "pytorch_model-00006-of-00007.bin",
|
396 |
+
"model.layers.30.mlp.gate_proj.weight": "pytorch_model-00006-of-00007.bin",
|
397 |
+
"model.layers.30.mlp.up_proj.scale": "pytorch_model-00006-of-00007.bin",
|
398 |
+
"model.layers.30.mlp.up_proj.weight": "pytorch_model-00006-of-00007.bin",
|
399 |
+
"model.layers.30.post_attention_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
400 |
+
"model.layers.30.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
401 |
+
"model.layers.30.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
402 |
+
"model.layers.30.self_attn.o_proj.scale": "pytorch_model-00006-of-00007.bin",
|
403 |
+
"model.layers.30.self_attn.o_proj.weight": "pytorch_model-00006-of-00007.bin",
|
404 |
+
"model.layers.30.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
405 |
+
"model.layers.30.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
406 |
+
"model.layers.30.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
407 |
+
"model.layers.30.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
408 |
+
"model.layers.31.input_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
409 |
+
"model.layers.31.mlp.down_proj.scale": "pytorch_model-00006-of-00007.bin",
|
410 |
+
"model.layers.31.mlp.down_proj.weight": "pytorch_model-00006-of-00007.bin",
|
411 |
+
"model.layers.31.mlp.gate_proj.scale": "pytorch_model-00006-of-00007.bin",
|
412 |
+
"model.layers.31.mlp.gate_proj.weight": "pytorch_model-00006-of-00007.bin",
|
413 |
+
"model.layers.31.mlp.up_proj.scale": "pytorch_model-00006-of-00007.bin",
|
414 |
+
"model.layers.31.mlp.up_proj.weight": "pytorch_model-00006-of-00007.bin",
|
415 |
+
"model.layers.31.post_attention_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
416 |
+
"model.layers.31.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
417 |
+
"model.layers.31.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
418 |
+
"model.layers.31.self_attn.o_proj.scale": "pytorch_model-00006-of-00007.bin",
|
419 |
+
"model.layers.31.self_attn.o_proj.weight": "pytorch_model-00006-of-00007.bin",
|
420 |
+
"model.layers.31.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
421 |
+
"model.layers.31.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
422 |
+
"model.layers.31.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
423 |
+
"model.layers.31.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
424 |
+
"model.layers.32.input_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
425 |
+
"model.layers.32.mlp.down_proj.scale": "pytorch_model-00006-of-00007.bin",
|
426 |
+
"model.layers.32.mlp.down_proj.weight": "pytorch_model-00006-of-00007.bin",
|
427 |
+
"model.layers.32.mlp.gate_proj.scale": "pytorch_model-00006-of-00007.bin",
|
428 |
+
"model.layers.32.mlp.gate_proj.weight": "pytorch_model-00006-of-00007.bin",
|
429 |
+
"model.layers.32.mlp.up_proj.scale": "pytorch_model-00006-of-00007.bin",
|
430 |
+
"model.layers.32.mlp.up_proj.weight": "pytorch_model-00006-of-00007.bin",
|
431 |
+
"model.layers.32.post_attention_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
432 |
+
"model.layers.32.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
433 |
+
"model.layers.32.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
434 |
+
"model.layers.32.self_attn.o_proj.scale": "pytorch_model-00006-of-00007.bin",
|
435 |
+
"model.layers.32.self_attn.o_proj.weight": "pytorch_model-00006-of-00007.bin",
|
436 |
+
"model.layers.32.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
437 |
+
"model.layers.32.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
438 |
+
"model.layers.32.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
439 |
+
"model.layers.32.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
440 |
+
"model.layers.33.input_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
441 |
+
"model.layers.33.mlp.down_proj.scale": "pytorch_model-00006-of-00007.bin",
|
442 |
+
"model.layers.33.mlp.down_proj.weight": "pytorch_model-00006-of-00007.bin",
|
443 |
+
"model.layers.33.mlp.gate_proj.scale": "pytorch_model-00006-of-00007.bin",
|
444 |
+
"model.layers.33.mlp.gate_proj.weight": "pytorch_model-00006-of-00007.bin",
|
445 |
+
"model.layers.33.mlp.up_proj.scale": "pytorch_model-00006-of-00007.bin",
|
446 |
+
"model.layers.33.mlp.up_proj.weight": "pytorch_model-00006-of-00007.bin",
|
447 |
+
"model.layers.33.post_attention_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
448 |
+
"model.layers.33.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
449 |
+
"model.layers.33.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
450 |
+
"model.layers.33.self_attn.o_proj.scale": "pytorch_model-00006-of-00007.bin",
|
451 |
+
"model.layers.33.self_attn.o_proj.weight": "pytorch_model-00006-of-00007.bin",
|
452 |
+
"model.layers.33.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
453 |
+
"model.layers.33.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
454 |
+
"model.layers.33.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
455 |
+
"model.layers.33.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
456 |
+
"model.layers.34.input_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
457 |
+
"model.layers.34.mlp.down_proj.scale": "pytorch_model-00006-of-00007.bin",
|
458 |
+
"model.layers.34.mlp.down_proj.weight": "pytorch_model-00006-of-00007.bin",
|
459 |
+
"model.layers.34.mlp.gate_proj.scale": "pytorch_model-00006-of-00007.bin",
|
460 |
+
"model.layers.34.mlp.gate_proj.weight": "pytorch_model-00006-of-00007.bin",
|
461 |
+
"model.layers.34.mlp.up_proj.scale": "pytorch_model-00006-of-00007.bin",
|
462 |
+
"model.layers.34.mlp.up_proj.weight": "pytorch_model-00006-of-00007.bin",
|
463 |
+
"model.layers.34.post_attention_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
464 |
+
"model.layers.34.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
465 |
+
"model.layers.34.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
466 |
+
"model.layers.34.self_attn.o_proj.scale": "pytorch_model-00006-of-00007.bin",
|
467 |
+
"model.layers.34.self_attn.o_proj.weight": "pytorch_model-00006-of-00007.bin",
|
468 |
+
"model.layers.34.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
469 |
+
"model.layers.34.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
470 |
+
"model.layers.34.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
471 |
+
"model.layers.34.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
472 |
+
"model.layers.35.input_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
473 |
+
"model.layers.35.mlp.down_proj.scale": "pytorch_model-00006-of-00007.bin",
|
474 |
+
"model.layers.35.mlp.down_proj.weight": "pytorch_model-00006-of-00007.bin",
|
475 |
+
"model.layers.35.mlp.gate_proj.scale": "pytorch_model-00006-of-00007.bin",
|
476 |
+
"model.layers.35.mlp.gate_proj.weight": "pytorch_model-00006-of-00007.bin",
|
477 |
+
"model.layers.35.mlp.up_proj.scale": "pytorch_model-00006-of-00007.bin",
|
478 |
+
"model.layers.35.mlp.up_proj.weight": "pytorch_model-00006-of-00007.bin",
|
479 |
+
"model.layers.35.post_attention_layernorm.weight": "pytorch_model-00006-of-00007.bin",
|
480 |
+
"model.layers.35.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
481 |
+
"model.layers.35.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
482 |
+
"model.layers.35.self_attn.o_proj.scale": "pytorch_model-00006-of-00007.bin",
|
483 |
+
"model.layers.35.self_attn.o_proj.weight": "pytorch_model-00006-of-00007.bin",
|
484 |
+
"model.layers.35.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
485 |
+
"model.layers.35.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
486 |
+
"model.layers.35.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
487 |
+
"model.layers.35.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
488 |
+
"model.layers.36.input_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
489 |
+
"model.layers.36.mlp.down_proj.scale": "pytorch_model-00007-of-00007.bin",
|
490 |
+
"model.layers.36.mlp.down_proj.weight": "pytorch_model-00007-of-00007.bin",
|
491 |
+
"model.layers.36.mlp.gate_proj.scale": "pytorch_model-00007-of-00007.bin",
|
492 |
+
"model.layers.36.mlp.gate_proj.weight": "pytorch_model-00007-of-00007.bin",
|
493 |
+
"model.layers.36.mlp.up_proj.scale": "pytorch_model-00007-of-00007.bin",
|
494 |
+
"model.layers.36.mlp.up_proj.weight": "pytorch_model-00007-of-00007.bin",
|
495 |
+
"model.layers.36.post_attention_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
496 |
+
"model.layers.36.self_attn.k_proj.scale": "pytorch_model-00006-of-00007.bin",
|
497 |
+
"model.layers.36.self_attn.k_proj.weight": "pytorch_model-00006-of-00007.bin",
|
498 |
+
"model.layers.36.self_attn.o_proj.scale": "pytorch_model-00007-of-00007.bin",
|
499 |
+
"model.layers.36.self_attn.o_proj.weight": "pytorch_model-00007-of-00007.bin",
|
500 |
+
"model.layers.36.self_attn.q_proj.scale": "pytorch_model-00006-of-00007.bin",
|
501 |
+
"model.layers.36.self_attn.q_proj.weight": "pytorch_model-00006-of-00007.bin",
|
502 |
+
"model.layers.36.self_attn.v_proj.scale": "pytorch_model-00006-of-00007.bin",
|
503 |
+
"model.layers.36.self_attn.v_proj.weight": "pytorch_model-00006-of-00007.bin",
|
504 |
+
"model.layers.37.input_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
505 |
+
"model.layers.37.mlp.down_proj.scale": "pytorch_model-00007-of-00007.bin",
|
506 |
+
"model.layers.37.mlp.down_proj.weight": "pytorch_model-00007-of-00007.bin",
|
507 |
+
"model.layers.37.mlp.gate_proj.scale": "pytorch_model-00007-of-00007.bin",
|
508 |
+
"model.layers.37.mlp.gate_proj.weight": "pytorch_model-00007-of-00007.bin",
|
509 |
+
"model.layers.37.mlp.up_proj.scale": "pytorch_model-00007-of-00007.bin",
|
510 |
+
"model.layers.37.mlp.up_proj.weight": "pytorch_model-00007-of-00007.bin",
|
511 |
+
"model.layers.37.post_attention_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
512 |
+
"model.layers.37.self_attn.k_proj.scale": "pytorch_model-00007-of-00007.bin",
|
513 |
+
"model.layers.37.self_attn.k_proj.weight": "pytorch_model-00007-of-00007.bin",
|
514 |
+
"model.layers.37.self_attn.o_proj.scale": "pytorch_model-00007-of-00007.bin",
|
515 |
+
"model.layers.37.self_attn.o_proj.weight": "pytorch_model-00007-of-00007.bin",
|
516 |
+
"model.layers.37.self_attn.q_proj.scale": "pytorch_model-00007-of-00007.bin",
|
517 |
+
"model.layers.37.self_attn.q_proj.weight": "pytorch_model-00007-of-00007.bin",
|
518 |
+
"model.layers.37.self_attn.v_proj.scale": "pytorch_model-00007-of-00007.bin",
|
519 |
+
"model.layers.37.self_attn.v_proj.weight": "pytorch_model-00007-of-00007.bin",
|
520 |
+
"model.layers.38.input_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
521 |
+
"model.layers.38.mlp.down_proj.scale": "pytorch_model-00007-of-00007.bin",
|
522 |
+
"model.layers.38.mlp.down_proj.weight": "pytorch_model-00007-of-00007.bin",
|
523 |
+
"model.layers.38.mlp.gate_proj.scale": "pytorch_model-00007-of-00007.bin",
|
524 |
+
"model.layers.38.mlp.gate_proj.weight": "pytorch_model-00007-of-00007.bin",
|
525 |
+
"model.layers.38.mlp.up_proj.scale": "pytorch_model-00007-of-00007.bin",
|
526 |
+
"model.layers.38.mlp.up_proj.weight": "pytorch_model-00007-of-00007.bin",
|
527 |
+
"model.layers.38.post_attention_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
528 |
+
"model.layers.38.self_attn.k_proj.scale": "pytorch_model-00007-of-00007.bin",
|
529 |
+
"model.layers.38.self_attn.k_proj.weight": "pytorch_model-00007-of-00007.bin",
|
530 |
+
"model.layers.38.self_attn.o_proj.scale": "pytorch_model-00007-of-00007.bin",
|
531 |
+
"model.layers.38.self_attn.o_proj.weight": "pytorch_model-00007-of-00007.bin",
|
532 |
+
"model.layers.38.self_attn.q_proj.scale": "pytorch_model-00007-of-00007.bin",
|
533 |
+
"model.layers.38.self_attn.q_proj.weight": "pytorch_model-00007-of-00007.bin",
|
534 |
+
"model.layers.38.self_attn.v_proj.scale": "pytorch_model-00007-of-00007.bin",
|
535 |
+
"model.layers.38.self_attn.v_proj.weight": "pytorch_model-00007-of-00007.bin",
|
536 |
+
"model.layers.39.input_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
537 |
+
"model.layers.39.mlp.down_proj.scale": "pytorch_model-00007-of-00007.bin",
|
538 |
+
"model.layers.39.mlp.down_proj.weight": "pytorch_model-00007-of-00007.bin",
|
539 |
+
"model.layers.39.mlp.gate_proj.scale": "pytorch_model-00007-of-00007.bin",
|
540 |
+
"model.layers.39.mlp.gate_proj.weight": "pytorch_model-00007-of-00007.bin",
|
541 |
+
"model.layers.39.mlp.up_proj.scale": "pytorch_model-00007-of-00007.bin",
|
542 |
+
"model.layers.39.mlp.up_proj.weight": "pytorch_model-00007-of-00007.bin",
|
543 |
+
"model.layers.39.post_attention_layernorm.weight": "pytorch_model-00007-of-00007.bin",
|
544 |
+
"model.layers.39.self_attn.k_proj.scale": "pytorch_model-00007-of-00007.bin",
|
545 |
+
"model.layers.39.self_attn.k_proj.weight": "pytorch_model-00007-of-00007.bin",
|
546 |
+
"model.layers.39.self_attn.o_proj.scale": "pytorch_model-00007-of-00007.bin",
|
547 |
+
"model.layers.39.self_attn.o_proj.weight": "pytorch_model-00007-of-00007.bin",
|
548 |
+
"model.layers.39.self_attn.q_proj.scale": "pytorch_model-00007-of-00007.bin",
|
549 |
+
"model.layers.39.self_attn.q_proj.weight": "pytorch_model-00007-of-00007.bin",
|
550 |
+
"model.layers.39.self_attn.v_proj.scale": "pytorch_model-00007-of-00007.bin",
|
551 |
+
"model.layers.39.self_attn.v_proj.weight": "pytorch_model-00007-of-00007.bin",
|
552 |
+
"model.layers.4.input_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
553 |
+
"model.layers.4.mlp.down_proj.scale": "pytorch_model-00001-of-00007.bin",
|
554 |
+
"model.layers.4.mlp.down_proj.weight": "pytorch_model-00001-of-00007.bin",
|
555 |
+
"model.layers.4.mlp.gate_proj.scale": "pytorch_model-00001-of-00007.bin",
|
556 |
+
"model.layers.4.mlp.gate_proj.weight": "pytorch_model-00001-of-00007.bin",
|
557 |
+
"model.layers.4.mlp.up_proj.scale": "pytorch_model-00001-of-00007.bin",
|
558 |
+
"model.layers.4.mlp.up_proj.weight": "pytorch_model-00001-of-00007.bin",
|
559 |
+
"model.layers.4.post_attention_layernorm.weight": "pytorch_model-00001-of-00007.bin",
|
560 |
+
"model.layers.4.self_attn.k_proj.scale": "pytorch_model-00001-of-00007.bin",
|
561 |
+
"model.layers.4.self_attn.k_proj.weight": "pytorch_model-00001-of-00007.bin",
|
562 |
+
"model.layers.4.self_attn.o_proj.scale": "pytorch_model-00001-of-00007.bin",
|
563 |
+
"model.layers.4.self_attn.o_proj.weight": "pytorch_model-00001-of-00007.bin",
|
564 |
+
"model.layers.4.self_attn.q_proj.scale": "pytorch_model-00001-of-00007.bin",
|
565 |
+
"model.layers.4.self_attn.q_proj.weight": "pytorch_model-00001-of-00007.bin",
|
566 |
+
"model.layers.4.self_attn.v_proj.scale": "pytorch_model-00001-of-00007.bin",
|
567 |
+
"model.layers.4.self_attn.v_proj.weight": "pytorch_model-00001-of-00007.bin",
|
568 |
+
"model.layers.5.input_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
569 |
+
"model.layers.5.mlp.down_proj.scale": "pytorch_model-00002-of-00007.bin",
|
570 |
+
"model.layers.5.mlp.down_proj.weight": "pytorch_model-00002-of-00007.bin",
|
571 |
+
"model.layers.5.mlp.gate_proj.scale": "pytorch_model-00002-of-00007.bin",
|
572 |
+
"model.layers.5.mlp.gate_proj.weight": "pytorch_model-00002-of-00007.bin",
|
573 |
+
"model.layers.5.mlp.up_proj.scale": "pytorch_model-00002-of-00007.bin",
|
574 |
+
"model.layers.5.mlp.up_proj.weight": "pytorch_model-00002-of-00007.bin",
|
575 |
+
"model.layers.5.post_attention_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
576 |
+
"model.layers.5.self_attn.k_proj.scale": "pytorch_model-00001-of-00007.bin",
|
577 |
+
"model.layers.5.self_attn.k_proj.weight": "pytorch_model-00001-of-00007.bin",
|
578 |
+
"model.layers.5.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
579 |
+
"model.layers.5.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
580 |
+
"model.layers.5.self_attn.q_proj.scale": "pytorch_model-00001-of-00007.bin",
|
581 |
+
"model.layers.5.self_attn.q_proj.weight": "pytorch_model-00001-of-00007.bin",
|
582 |
+
"model.layers.5.self_attn.v_proj.scale": "pytorch_model-00001-of-00007.bin",
|
583 |
+
"model.layers.5.self_attn.v_proj.weight": "pytorch_model-00001-of-00007.bin",
|
584 |
+
"model.layers.6.input_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
585 |
+
"model.layers.6.mlp.down_proj.scale": "pytorch_model-00002-of-00007.bin",
|
586 |
+
"model.layers.6.mlp.down_proj.weight": "pytorch_model-00002-of-00007.bin",
|
587 |
+
"model.layers.6.mlp.gate_proj.scale": "pytorch_model-00002-of-00007.bin",
|
588 |
+
"model.layers.6.mlp.gate_proj.weight": "pytorch_model-00002-of-00007.bin",
|
589 |
+
"model.layers.6.mlp.up_proj.scale": "pytorch_model-00002-of-00007.bin",
|
590 |
+
"model.layers.6.mlp.up_proj.weight": "pytorch_model-00002-of-00007.bin",
|
591 |
+
"model.layers.6.post_attention_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
592 |
+
"model.layers.6.self_attn.k_proj.scale": "pytorch_model-00002-of-00007.bin",
|
593 |
+
"model.layers.6.self_attn.k_proj.weight": "pytorch_model-00002-of-00007.bin",
|
594 |
+
"model.layers.6.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
595 |
+
"model.layers.6.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
596 |
+
"model.layers.6.self_attn.q_proj.scale": "pytorch_model-00002-of-00007.bin",
|
597 |
+
"model.layers.6.self_attn.q_proj.weight": "pytorch_model-00002-of-00007.bin",
|
598 |
+
"model.layers.6.self_attn.v_proj.scale": "pytorch_model-00002-of-00007.bin",
|
599 |
+
"model.layers.6.self_attn.v_proj.weight": "pytorch_model-00002-of-00007.bin",
|
600 |
+
"model.layers.7.input_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
601 |
+
"model.layers.7.mlp.down_proj.scale": "pytorch_model-00002-of-00007.bin",
|
602 |
+
"model.layers.7.mlp.down_proj.weight": "pytorch_model-00002-of-00007.bin",
|
603 |
+
"model.layers.7.mlp.gate_proj.scale": "pytorch_model-00002-of-00007.bin",
|
604 |
+
"model.layers.7.mlp.gate_proj.weight": "pytorch_model-00002-of-00007.bin",
|
605 |
+
"model.layers.7.mlp.up_proj.scale": "pytorch_model-00002-of-00007.bin",
|
606 |
+
"model.layers.7.mlp.up_proj.weight": "pytorch_model-00002-of-00007.bin",
|
607 |
+
"model.layers.7.post_attention_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
608 |
+
"model.layers.7.self_attn.k_proj.scale": "pytorch_model-00002-of-00007.bin",
|
609 |
+
"model.layers.7.self_attn.k_proj.weight": "pytorch_model-00002-of-00007.bin",
|
610 |
+
"model.layers.7.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
611 |
+
"model.layers.7.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
612 |
+
"model.layers.7.self_attn.q_proj.scale": "pytorch_model-00002-of-00007.bin",
|
613 |
+
"model.layers.7.self_attn.q_proj.weight": "pytorch_model-00002-of-00007.bin",
|
614 |
+
"model.layers.7.self_attn.v_proj.scale": "pytorch_model-00002-of-00007.bin",
|
615 |
+
"model.layers.7.self_attn.v_proj.weight": "pytorch_model-00002-of-00007.bin",
|
616 |
+
"model.layers.8.input_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
617 |
+
"model.layers.8.mlp.down_proj.scale": "pytorch_model-00002-of-00007.bin",
|
618 |
+
"model.layers.8.mlp.down_proj.weight": "pytorch_model-00002-of-00007.bin",
|
619 |
+
"model.layers.8.mlp.gate_proj.scale": "pytorch_model-00002-of-00007.bin",
|
620 |
+
"model.layers.8.mlp.gate_proj.weight": "pytorch_model-00002-of-00007.bin",
|
621 |
+
"model.layers.8.mlp.up_proj.scale": "pytorch_model-00002-of-00007.bin",
|
622 |
+
"model.layers.8.mlp.up_proj.weight": "pytorch_model-00002-of-00007.bin",
|
623 |
+
"model.layers.8.post_attention_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
624 |
+
"model.layers.8.self_attn.k_proj.scale": "pytorch_model-00002-of-00007.bin",
|
625 |
+
"model.layers.8.self_attn.k_proj.weight": "pytorch_model-00002-of-00007.bin",
|
626 |
+
"model.layers.8.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
627 |
+
"model.layers.8.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
628 |
+
"model.layers.8.self_attn.q_proj.scale": "pytorch_model-00002-of-00007.bin",
|
629 |
+
"model.layers.8.self_attn.q_proj.weight": "pytorch_model-00002-of-00007.bin",
|
630 |
+
"model.layers.8.self_attn.v_proj.scale": "pytorch_model-00002-of-00007.bin",
|
631 |
+
"model.layers.8.self_attn.v_proj.weight": "pytorch_model-00002-of-00007.bin",
|
632 |
+
"model.layers.9.input_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
633 |
+
"model.layers.9.mlp.down_proj.scale": "pytorch_model-00002-of-00007.bin",
|
634 |
+
"model.layers.9.mlp.down_proj.weight": "pytorch_model-00002-of-00007.bin",
|
635 |
+
"model.layers.9.mlp.gate_proj.scale": "pytorch_model-00002-of-00007.bin",
|
636 |
+
"model.layers.9.mlp.gate_proj.weight": "pytorch_model-00002-of-00007.bin",
|
637 |
+
"model.layers.9.mlp.up_proj.scale": "pytorch_model-00002-of-00007.bin",
|
638 |
+
"model.layers.9.mlp.up_proj.weight": "pytorch_model-00002-of-00007.bin",
|
639 |
+
"model.layers.9.post_attention_layernorm.weight": "pytorch_model-00002-of-00007.bin",
|
640 |
+
"model.layers.9.self_attn.k_proj.scale": "pytorch_model-00002-of-00007.bin",
|
641 |
+
"model.layers.9.self_attn.k_proj.weight": "pytorch_model-00002-of-00007.bin",
|
642 |
+
"model.layers.9.self_attn.o_proj.scale": "pytorch_model-00002-of-00007.bin",
|
643 |
+
"model.layers.9.self_attn.o_proj.weight": "pytorch_model-00002-of-00007.bin",
|
644 |
+
"model.layers.9.self_attn.q_proj.scale": "pytorch_model-00002-of-00007.bin",
|
645 |
+
"model.layers.9.self_attn.q_proj.weight": "pytorch_model-00002-of-00007.bin",
|
646 |
+
"model.layers.9.self_attn.v_proj.scale": "pytorch_model-00002-of-00007.bin",
|
647 |
+
"model.layers.9.self_attn.v_proj.weight": "pytorch_model-00002-of-00007.bin",
|
648 |
+
"model.norm.weight": "pytorch_model-00007-of-00007.bin"
|
649 |
+
}
|
650 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"unk_token": {
|
24 |
+
"content": "<unk>",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
}
|
30 |
+
}
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"add_prefix_space": true,
|
5 |
+
"added_tokens_decoder": {
|
6 |
+
"0": {
|
7 |
+
"content": "<unk>",
|
8 |
+
"lstrip": false,
|
9 |
+
"normalized": false,
|
10 |
+
"rstrip": false,
|
11 |
+
"single_word": false,
|
12 |
+
"special": true
|
13 |
+
},
|
14 |
+
"1": {
|
15 |
+
"content": "<s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false,
|
20 |
+
"special": true
|
21 |
+
},
|
22 |
+
"2": {
|
23 |
+
"content": "</s>",
|
24 |
+
"lstrip": false,
|
25 |
+
"normalized": false,
|
26 |
+
"rstrip": false,
|
27 |
+
"single_word": false,
|
28 |
+
"special": true
|
29 |
+
},
|
30 |
+
"32000": {
|
31 |
+
"content": "[PAD]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false,
|
36 |
+
"special": true
|
37 |
+
},
|
38 |
+
"32001": {
|
39 |
+
"content": "<|im_start|>",
|
40 |
+
"lstrip": false,
|
41 |
+
"normalized": true,
|
42 |
+
"rstrip": false,
|
43 |
+
"single_word": false,
|
44 |
+
"special": false
|
45 |
+
},
|
46 |
+
"32002": {
|
47 |
+
"content": "<|im_end|>",
|
48 |
+
"lstrip": false,
|
49 |
+
"normalized": true,
|
50 |
+
"rstrip": false,
|
51 |
+
"single_word": false,
|
52 |
+
"special": false
|
53 |
+
}
|
54 |
+
},
|
55 |
+
"bos_token": "<s>",
|
56 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
57 |
+
"clean_up_tokenization_spaces": false,
|
58 |
+
"eos_token": "</s>",
|
59 |
+
"legacy": false,
|
60 |
+
"model_max_length": 4096,
|
61 |
+
"pad_token": "[PAD]",
|
62 |
+
"padding_side": "right",
|
63 |
+
"sp_model_kwargs": {},
|
64 |
+
"spaces_between_special_tokens": false,
|
65 |
+
"tokenizer_class": "LlamaTokenizer",
|
66 |
+
"unk_token": "<unk>",
|
67 |
+
"use_default_system_prompt": true
|
68 |
+
}
|