Upload folder using huggingface_hub
Browse files- README.md +20 -14
- added_tokens.json +11 -10
- chat_template.jinja +8 -1
- config.json +34 -26
- generation_config.json +4 -4
- model.safetensors +2 -2
- special_tokens_map.json +2 -2
- tokenizer.json +2 -2
- tokenizer.model +3 -0
- tokenizer_config.json +53 -32
README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
Code for creating the tiny model:
|
| 2 |
|
| 3 |
```python
|
|
@@ -6,30 +8,34 @@ import torch
|
|
| 6 |
torch.set_default_dtype(torch.float32)
|
| 7 |
|
| 8 |
import os
|
|
|
|
| 9 |
|
| 10 |
-
from
|
|
|
|
| 11 |
|
| 12 |
# === Settings ===
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
| 16 |
set_seed(0)
|
| 17 |
|
| 18 |
# === Step 1: Define tiny model config ===
|
|
|
|
| 19 |
config = AutoConfig.from_pretrained(model_id)
|
| 20 |
|
| 21 |
-
|
| 22 |
-
config.
|
| 23 |
-
config.
|
| 24 |
-
config.
|
| 25 |
-
config.
|
| 26 |
-
config.
|
| 27 |
-
config.initializer_range = 0.1 # originally 0.02; without this change, phi-4-mini model outputs collapse with larger inputs
|
| 28 |
|
| 29 |
-
# Keep
|
| 30 |
if config.rope_scaling:
|
| 31 |
-
config.rope_scaling["short_factor"] = config.rope_scaling["short_factor"][::
|
| 32 |
-
config.rope_scaling["long_factor"] = config.rope_scaling["long_factor"][::
|
| 33 |
|
| 34 |
# === Step 2: Create model from config ===
|
| 35 |
model = AutoModelForCausalLM.from_config(config)
|
|
@@ -45,4 +51,4 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
| 45 |
os.makedirs(output_dir, exist_ok=True)
|
| 46 |
model.save_pretrained(output_dir)
|
| 47 |
tokenizer.save_pretrained(output_dir)
|
| 48 |
-
```
|
|
|
|
| 1 |
+
Tiny random model with Phi3 architecture based on microsoft/Phi-3.5-mini-instruct, including longrope config
|
| 2 |
+
|
| 3 |
Code for creating the tiny model:
|
| 4 |
|
| 5 |
```python
|
|
|
|
| 8 |
torch.set_default_dtype(torch.float32)
|
| 9 |
|
| 10 |
import os
|
| 11 |
+
from pathlib import Path
|
| 12 |
|
| 13 |
+
from optimum.intel import OVModelForCausalLM
|
| 14 |
+
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, set_seed, Phi3ForCausalLM
|
| 15 |
|
| 16 |
# === Settings ===
|
| 17 |
+
|
| 18 |
+
model_id = "microsoft/Phi-3.5-mini-instruct"
|
| 19 |
+
output_dir = "phi-3.5-mini-tiny-random"
|
| 20 |
+
ov_output_dir = output_dir + "-ov"
|
| 21 |
|
| 22 |
set_seed(0)
|
| 23 |
|
| 24 |
# === Step 1: Define tiny model config ===
|
| 25 |
+
|
| 26 |
config = AutoConfig.from_pretrained(model_id)
|
| 27 |
|
| 28 |
+
config.num_hidden_layers = 4
|
| 29 |
+
config.num_attention_heads = 4
|
| 30 |
+
config.num_key_value_heads = 2
|
| 31 |
+
config.hidden_size = 96
|
| 32 |
+
config.intermediate_size = 256
|
| 33 |
+
config.initializer_range = 0.1
|
|
|
|
| 34 |
|
| 35 |
+
# Keep fewer RoPE factors. Adjust config.hidden_size when adjusting this.
|
| 36 |
if config.rope_scaling:
|
| 37 |
+
config.rope_scaling["short_factor"] = config.rope_scaling["short_factor"][::4]
|
| 38 |
+
config.rope_scaling["long_factor"] = config.rope_scaling["long_factor"][::4]
|
| 39 |
|
| 40 |
# === Step 2: Create model from config ===
|
| 41 |
model = AutoModelForCausalLM.from_config(config)
|
|
|
|
| 51 |
os.makedirs(output_dir, exist_ok=True)
|
| 52 |
model.save_pretrained(output_dir)
|
| 53 |
tokenizer.save_pretrained(output_dir)
|
| 54 |
+
```
|
added_tokens.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"
|
| 4 |
-
"<|
|
| 5 |
-
"<|
|
| 6 |
-
"<|
|
| 7 |
-
"<|
|
| 8 |
-
"<|
|
| 9 |
-
"<|
|
| 10 |
-
"<|
|
| 11 |
-
"<|
|
|
|
|
| 12 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"<|assistant|>": 32001,
|
| 3 |
+
"<|endoftext|>": 32000,
|
| 4 |
+
"<|end|>": 32007,
|
| 5 |
+
"<|placeholder1|>": 32002,
|
| 6 |
+
"<|placeholder2|>": 32003,
|
| 7 |
+
"<|placeholder3|>": 32004,
|
| 8 |
+
"<|placeholder4|>": 32005,
|
| 9 |
+
"<|placeholder5|>": 32008,
|
| 10 |
+
"<|placeholder6|>": 32009,
|
| 11 |
+
"<|system|>": 32006,
|
| 12 |
+
"<|user|>": 32010
|
| 13 |
}
|
chat_template.jinja
CHANGED
|
@@ -1 +1,8 @@
|
|
| 1 |
-
{% for message in messages %}{% if message['role'] == 'system' and
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{% for message in messages %}{% if message['role'] == 'system' and message['content'] %}{{'<|system|>
|
| 2 |
+
' + message['content'] + '<|end|>
|
| 3 |
+
'}}{% elif message['role'] == 'user' %}{{'<|user|>
|
| 4 |
+
' + message['content'] + '<|end|>
|
| 5 |
+
'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>
|
| 6 |
+
' + message['content'] + '<|end|>
|
| 7 |
+
'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>
|
| 8 |
+
' }}{% else %}{{ eos_token }}{% endif %}
|
config.json
CHANGED
|
@@ -1,59 +1,67 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"Phi3ForCausalLM"
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"auto_map": {
|
| 8 |
-
"AutoConfig": "configuration_phi3.Phi3Config",
|
| 9 |
-
"AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
|
| 10 |
-
"AutoTokenizer": "Xenova/gpt-4o"
|
| 11 |
},
|
| 12 |
-
"bos_token_id":
|
| 13 |
"embd_pdrop": 0.0,
|
| 14 |
-
"eos_token_id":
|
| 15 |
-
"full_attn_mod": 1,
|
| 16 |
"hidden_act": "silu",
|
| 17 |
-
"hidden_size":
|
| 18 |
"initializer_range": 0.1,
|
| 19 |
"intermediate_size": 256,
|
| 20 |
-
"interpolate_factor": 1,
|
| 21 |
-
"lm_head_bias": false,
|
| 22 |
"max_position_embeddings": 131072,
|
| 23 |
-
"mlp_bias": false,
|
| 24 |
"model_type": "phi3",
|
| 25 |
"num_attention_heads": 4,
|
| 26 |
"num_hidden_layers": 4,
|
| 27 |
"num_key_value_heads": 2,
|
| 28 |
"original_max_position_embeddings": 4096,
|
| 29 |
-
"pad_token_id":
|
| 30 |
-
"partial_rotary_factor": 0
|
| 31 |
"resid_pdrop": 0.0,
|
| 32 |
"rms_norm_eps": 1e-05,
|
| 33 |
"rope_scaling": {
|
| 34 |
"long_factor": [
|
| 35 |
-
1,
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
32.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
],
|
| 42 |
"short_factor": [
|
| 43 |
1.0,
|
| 44 |
-
1.
|
| 45 |
-
1.
|
| 46 |
-
1.
|
| 47 |
-
1.
|
| 48 |
-
1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
],
|
| 50 |
"type": "longrope"
|
| 51 |
},
|
| 52 |
"rope_theta": 10000.0,
|
| 53 |
"sliding_window": 262144,
|
| 54 |
-
"tie_word_embeddings":
|
| 55 |
"torch_dtype": "bfloat16",
|
| 56 |
-
"transformers_version": "4.
|
| 57 |
"use_cache": true,
|
| 58 |
-
"vocab_size":
|
| 59 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "microsoft/Phi-3.5-mini-instruct",
|
| 3 |
"architectures": [
|
| 4 |
"Phi3ForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"auto_map": {
|
| 9 |
+
"AutoConfig": "microsoft/Phi-3.5-mini-instruct--configuration_phi3.Phi3Config",
|
| 10 |
+
"AutoModelForCausalLM": "microsoft/Phi-3.5-mini-instruct--modeling_phi3.Phi3ForCausalLM"
|
|
|
|
| 11 |
},
|
| 12 |
+
"bos_token_id": 1,
|
| 13 |
"embd_pdrop": 0.0,
|
| 14 |
+
"eos_token_id": 32000,
|
|
|
|
| 15 |
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 96,
|
| 17 |
"initializer_range": 0.1,
|
| 18 |
"intermediate_size": 256,
|
|
|
|
|
|
|
| 19 |
"max_position_embeddings": 131072,
|
|
|
|
| 20 |
"model_type": "phi3",
|
| 21 |
"num_attention_heads": 4,
|
| 22 |
"num_hidden_layers": 4,
|
| 23 |
"num_key_value_heads": 2,
|
| 24 |
"original_max_position_embeddings": 4096,
|
| 25 |
+
"pad_token_id": 32000,
|
| 26 |
+
"partial_rotary_factor": 1.0,
|
| 27 |
"resid_pdrop": 0.0,
|
| 28 |
"rms_norm_eps": 1e-05,
|
| 29 |
"rope_scaling": {
|
| 30 |
"long_factor": [
|
| 31 |
+
1.0800000429153442,
|
| 32 |
+
1.5899999141693115,
|
| 33 |
+
3.2300000190734863,
|
| 34 |
+
7.700000286102295,
|
| 35 |
+
24.46000099182129,
|
| 36 |
+
32.590003967285156,
|
| 37 |
+
50.340003967285156,
|
| 38 |
+
58.21000289916992,
|
| 39 |
+
62.71000289916992,
|
| 40 |
+
63.93000411987305,
|
| 41 |
+
64.06999969482422,
|
| 42 |
+
64.4800033569336
|
| 43 |
],
|
| 44 |
"short_factor": [
|
| 45 |
1.0,
|
| 46 |
+
1.0499999523162842,
|
| 47 |
+
1.0499999523162842,
|
| 48 |
+
1.1599998474121094,
|
| 49 |
+
1.339999794960022,
|
| 50 |
+
1.8499997854232788,
|
| 51 |
+
1.9899996519088745,
|
| 52 |
+
2.0199997425079346,
|
| 53 |
+
2.0299997329711914,
|
| 54 |
+
2.0299997329711914,
|
| 55 |
+
2.0799996852874756,
|
| 56 |
+
2.5899994373321533
|
| 57 |
],
|
| 58 |
"type": "longrope"
|
| 59 |
},
|
| 60 |
"rope_theta": 10000.0,
|
| 61 |
"sliding_window": 262144,
|
| 62 |
+
"tie_word_embeddings": false,
|
| 63 |
"torch_dtype": "bfloat16",
|
| 64 |
+
"transformers_version": "4.49.0",
|
| 65 |
"use_cache": true,
|
| 66 |
+
"vocab_size": 32064
|
| 67 |
}
|
generation_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"bos_token_id":
|
| 4 |
-
"eos_token_id":
|
| 5 |
-
"pad_token_id":
|
| 6 |
-
"transformers_version": "4.
|
| 7 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 32000,
|
| 5 |
+
"pad_token_id": 32000,
|
| 6 |
+
"transformers_version": "4.49.0"
|
| 7 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74cead14dfeca6601724692aa0bd751abe8708cde35894a3d814cc67f83bf98e
|
| 3 |
+
size 13128248
|
special_tokens_map.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"bos_token": {
|
| 3 |
-
"content": "
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": false,
|
| 6 |
"rstrip": false,
|
|
@@ -21,7 +21,7 @@
|
|
| 21 |
"single_word": false
|
| 22 |
},
|
| 23 |
"unk_token": {
|
| 24 |
-
"content": "
|
| 25 |
"lstrip": false,
|
| 26 |
"normalized": false,
|
| 27 |
"rstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": false,
|
| 6 |
"rstrip": false,
|
|
|
|
| 21 |
"single_word": false
|
| 22 |
},
|
| 23 |
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
"lstrip": false,
|
| 26 |
"normalized": false,
|
| 27 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3cb815b904d82b82b25dcd90edd00e71a5ee5443472ad611bcb84f1339300647
|
| 3 |
+
size 3620657
|
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
CHANGED
|
@@ -1,25 +1,41 @@
|
|
| 1 |
{
|
| 2 |
"add_bos_token": false,
|
| 3 |
"add_eos_token": false,
|
| 4 |
-
"add_prefix_space":
|
| 5 |
"added_tokens_decoder": {
|
| 6 |
-
"
|
| 7 |
-
"content": "
|
| 8 |
"lstrip": false,
|
| 9 |
"normalized": false,
|
| 10 |
"rstrip": false,
|
| 11 |
"single_word": false,
|
| 12 |
"special": true
|
| 13 |
},
|
| 14 |
-
"
|
| 15 |
-
"content": "
|
| 16 |
"lstrip": false,
|
| 17 |
"normalized": false,
|
| 18 |
"rstrip": false,
|
| 19 |
"single_word": false,
|
| 20 |
"special": true
|
| 21 |
},
|
| 22 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
"content": "<|assistant|>",
|
| 24 |
"lstrip": false,
|
| 25 |
"normalized": false,
|
|
@@ -27,72 +43,72 @@
|
|
| 27 |
"single_word": false,
|
| 28 |
"special": true
|
| 29 |
},
|
| 30 |
-
"
|
| 31 |
-
"content": "<|
|
| 32 |
"lstrip": false,
|
| 33 |
"normalized": false,
|
| 34 |
"rstrip": true,
|
| 35 |
"single_word": false,
|
| 36 |
"special": true
|
| 37 |
},
|
| 38 |
-
"
|
| 39 |
-
"content": "<|
|
| 40 |
"lstrip": false,
|
| 41 |
"normalized": false,
|
| 42 |
"rstrip": true,
|
| 43 |
"single_word": false,
|
| 44 |
"special": true
|
| 45 |
},
|
| 46 |
-
"
|
| 47 |
-
"content": "<|
|
| 48 |
"lstrip": false,
|
| 49 |
"normalized": false,
|
| 50 |
"rstrip": true,
|
| 51 |
"single_word": false,
|
| 52 |
"special": true
|
| 53 |
},
|
| 54 |
-
"
|
| 55 |
-
"content": "<|
|
| 56 |
"lstrip": false,
|
| 57 |
"normalized": false,
|
| 58 |
"rstrip": true,
|
| 59 |
"single_word": false,
|
| 60 |
-
"special":
|
| 61 |
},
|
| 62 |
-
"
|
| 63 |
-
"content": "
|
| 64 |
"lstrip": false,
|
| 65 |
"normalized": false,
|
| 66 |
"rstrip": true,
|
| 67 |
"single_word": false,
|
| 68 |
-
"special":
|
| 69 |
},
|
| 70 |
-
"
|
| 71 |
-
"content": "<|
|
| 72 |
"lstrip": false,
|
| 73 |
"normalized": false,
|
| 74 |
"rstrip": true,
|
| 75 |
"single_word": false,
|
| 76 |
-
"special":
|
| 77 |
},
|
| 78 |
-
"
|
| 79 |
-
"content": "
|
| 80 |
"lstrip": false,
|
| 81 |
"normalized": false,
|
| 82 |
"rstrip": true,
|
| 83 |
"single_word": false,
|
| 84 |
-
"special":
|
| 85 |
},
|
| 86 |
-
"
|
| 87 |
-
"content": "<|
|
| 88 |
"lstrip": false,
|
| 89 |
"normalized": false,
|
| 90 |
"rstrip": true,
|
| 91 |
"single_word": false,
|
| 92 |
-
"special":
|
| 93 |
},
|
| 94 |
-
"
|
| 95 |
-
"content": "<|
|
| 96 |
"lstrip": false,
|
| 97 |
"normalized": false,
|
| 98 |
"rstrip": true,
|
|
@@ -100,12 +116,17 @@
|
|
| 100 |
"special": true
|
| 101 |
}
|
| 102 |
},
|
| 103 |
-
"bos_token": "
|
|
|
|
| 104 |
"clean_up_tokenization_spaces": false,
|
| 105 |
"eos_token": "<|endoftext|>",
|
| 106 |
"extra_special_tokens": {},
|
|
|
|
| 107 |
"model_max_length": 131072,
|
| 108 |
"pad_token": "<|endoftext|>",
|
| 109 |
-
"
|
| 110 |
-
"
|
|
|
|
|
|
|
|
|
|
| 111 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"add_bos_token": false,
|
| 3 |
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": null,
|
| 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": true,
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"special": false
|
| 29 |
+
},
|
| 30 |
+
"32000": {
|
| 31 |
+
"content": "<|endoftext|>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false,
|
| 36 |
+
"special": true
|
| 37 |
+
},
|
| 38 |
+
"32001": {
|
| 39 |
"content": "<|assistant|>",
|
| 40 |
"lstrip": false,
|
| 41 |
"normalized": false,
|
|
|
|
| 43 |
"single_word": false,
|
| 44 |
"special": true
|
| 45 |
},
|
| 46 |
+
"32002": {
|
| 47 |
+
"content": "<|placeholder1|>",
|
| 48 |
"lstrip": false,
|
| 49 |
"normalized": false,
|
| 50 |
"rstrip": true,
|
| 51 |
"single_word": false,
|
| 52 |
"special": true
|
| 53 |
},
|
| 54 |
+
"32003": {
|
| 55 |
+
"content": "<|placeholder2|>",
|
| 56 |
"lstrip": false,
|
| 57 |
"normalized": false,
|
| 58 |
"rstrip": true,
|
| 59 |
"single_word": false,
|
| 60 |
"special": true
|
| 61 |
},
|
| 62 |
+
"32004": {
|
| 63 |
+
"content": "<|placeholder3|>",
|
| 64 |
"lstrip": false,
|
| 65 |
"normalized": false,
|
| 66 |
"rstrip": true,
|
| 67 |
"single_word": false,
|
| 68 |
"special": true
|
| 69 |
},
|
| 70 |
+
"32005": {
|
| 71 |
+
"content": "<|placeholder4|>",
|
| 72 |
"lstrip": false,
|
| 73 |
"normalized": false,
|
| 74 |
"rstrip": true,
|
| 75 |
"single_word": false,
|
| 76 |
+
"special": true
|
| 77 |
},
|
| 78 |
+
"32006": {
|
| 79 |
+
"content": "<|system|>",
|
| 80 |
"lstrip": false,
|
| 81 |
"normalized": false,
|
| 82 |
"rstrip": true,
|
| 83 |
"single_word": false,
|
| 84 |
+
"special": true
|
| 85 |
},
|
| 86 |
+
"32007": {
|
| 87 |
+
"content": "<|end|>",
|
| 88 |
"lstrip": false,
|
| 89 |
"normalized": false,
|
| 90 |
"rstrip": true,
|
| 91 |
"single_word": false,
|
| 92 |
+
"special": true
|
| 93 |
},
|
| 94 |
+
"32008": {
|
| 95 |
+
"content": "<|placeholder5|>",
|
| 96 |
"lstrip": false,
|
| 97 |
"normalized": false,
|
| 98 |
"rstrip": true,
|
| 99 |
"single_word": false,
|
| 100 |
+
"special": true
|
| 101 |
},
|
| 102 |
+
"32009": {
|
| 103 |
+
"content": "<|placeholder6|>",
|
| 104 |
"lstrip": false,
|
| 105 |
"normalized": false,
|
| 106 |
"rstrip": true,
|
| 107 |
"single_word": false,
|
| 108 |
+
"special": true
|
| 109 |
},
|
| 110 |
+
"32010": {
|
| 111 |
+
"content": "<|user|>",
|
| 112 |
"lstrip": false,
|
| 113 |
"normalized": false,
|
| 114 |
"rstrip": true,
|
|
|
|
| 116 |
"special": true
|
| 117 |
}
|
| 118 |
},
|
| 119 |
+
"bos_token": "<s>",
|
| 120 |
+
"chat_template": "{% for message in messages %}{% if message['role'] == 'system' and message['content'] %}{{'<|system|>\n' + message['content'] + '<|end|>\n'}}{% elif message['role'] == 'user' %}{{'<|user|>\n' + message['content'] + '<|end|>\n'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>\n' + message['content'] + '<|end|>\n'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>\n' }}{% else %}{{ eos_token }}{% endif %}",
|
| 121 |
"clean_up_tokenization_spaces": false,
|
| 122 |
"eos_token": "<|endoftext|>",
|
| 123 |
"extra_special_tokens": {},
|
| 124 |
+
"legacy": false,
|
| 125 |
"model_max_length": 131072,
|
| 126 |
"pad_token": "<|endoftext|>",
|
| 127 |
+
"padding_side": "left",
|
| 128 |
+
"sp_model_kwargs": {},
|
| 129 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 130 |
+
"unk_token": "<unk>",
|
| 131 |
+
"use_default_system_prompt": false
|
| 132 |
}
|