Upload folder using huggingface_hub
Browse files- README.md +248 -0
- chat_template.jinja +138 -0
- config.json +48 -0
- configuration_longcat_flash.py +216 -0
- generation_config.json +7 -0
- model.safetensors +3 -0
- modeling_longcat_flash.py +648 -0
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1810 -0
README.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
inference: true
|
| 5 |
+
widget:
|
| 6 |
+
- text: Hello!
|
| 7 |
+
example_title: Hello world
|
| 8 |
+
group: Python
|
| 9 |
+
base_model:
|
| 10 |
+
- meituan-longcat/LongCat-Flash-Chat
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
This tiny model is for debugging. It is randomly initialized with the config adapted from [meituan-longcat/LongCat-Flash-Chat](https://huggingface.co/meituan-longcat/LongCat-Flash-Chat).
|
| 14 |
+
|
| 15 |
+
### Example usage:
|
| 16 |
+
|
| 17 |
+
- vLLM
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
vllm serve yujiepan/longcat-flash-tiny-random \
|
| 21 |
+
--trust-remote-code \
|
| 22 |
+
--enable-expert-parallel \
|
| 23 |
+
--tensor-parallel-size 1 \
|
| 24 |
+
--speculative_config '{"model": "yujiepan/longcat-flash-tiny-random", "num_speculative_tokens": 1, "method":"longcat_flash_mtp"}'
|
| 25 |
+
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
- SGLang
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
python3 -m sglang.launch_server \
|
| 32 |
+
--model yujiepan/longcat-flash-tiny-random \
|
| 33 |
+
--trust-remote-code \
|
| 34 |
+
--attention-backend flashinfer \
|
| 35 |
+
--enable-ep-moe \
|
| 36 |
+
--tp 1 \
|
| 37 |
+
--speculative-draft-model-path yujiepan/longcat-flash-tiny-random \
|
| 38 |
+
--speculative-algorithm NEXTN \
|
| 39 |
+
--speculative-num-draft-tokens 2 \
|
| 40 |
+
--speculative-num-steps 1 \
|
| 41 |
+
--speculative-eagle-topk 1
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
- Transformers
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
import torch
|
| 48 |
+
import transformers
|
| 49 |
+
|
| 50 |
+
model_id = "yujiepan/longcat-flash-tiny-random"
|
| 51 |
+
pipe = transformers.pipelines.pipeline(
|
| 52 |
+
'text-generation',
|
| 53 |
+
model=model_id,
|
| 54 |
+
trust_remote_code=True,
|
| 55 |
+
device_map='cuda',
|
| 56 |
+
torch_dtype=torch.bfloat16,
|
| 57 |
+
)
|
| 58 |
+
past_key_values = transformers.DynamicCache(config=None) # set config to None
|
| 59 |
+
r = pipe('Hello, world!', past_key_values=past_key_values, max_new_tokens=32)
|
| 60 |
+
print(r)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### Codes to create this repo:
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
import json
|
| 67 |
+
from copy import deepcopy
|
| 68 |
+
from pathlib import Path
|
| 69 |
+
|
| 70 |
+
import torch
|
| 71 |
+
import torch.nn as nn
|
| 72 |
+
from huggingface_hub import file_exists, hf_hub_download
|
| 73 |
+
from transformers import (
|
| 74 |
+
AutoConfig,
|
| 75 |
+
AutoModelForCausalLM,
|
| 76 |
+
AutoProcessor,
|
| 77 |
+
AutoTokenizer,
|
| 78 |
+
GenerationConfig,
|
| 79 |
+
set_seed,
|
| 80 |
+
)
|
| 81 |
+
from transformers.models.glm4_moe.modeling_glm4_moe import Glm4MoeRMSNorm
|
| 82 |
+
source_model_id = "meituan-longcat/LongCat-Flash-Chat"
|
| 83 |
+
save_folder = "/tmp/yujiepan/longcat-flash-tiny-random"
|
| 84 |
+
|
| 85 |
+
Path(save_folder).mkdir(parents=True, exist_ok=True)
|
| 86 |
+
tokenizer = AutoTokenizer.from_pretrained(source_model_id, trust_remote_code=True)
|
| 87 |
+
tokenizer.save_pretrained(save_folder)
|
| 88 |
+
|
| 89 |
+
with open(hf_hub_download(source_model_id, filename='config.json', repo_type='model'), 'r', encoding='utf-8') as f:
|
| 90 |
+
config_json = json.load(f)
|
| 91 |
+
for k, v in config_json['auto_map'].items():
|
| 92 |
+
config_json['auto_map'][k] = f'{source_model_id}--{v}'
|
| 93 |
+
config_json.update({
|
| 94 |
+
'num_layers': 2,
|
| 95 |
+
'hidden_size': 8,
|
| 96 |
+
'ffn_hidden_size': 64,
|
| 97 |
+
'expert_ffn_hidden_size': 64,
|
| 98 |
+
'num_attention_heads': 4,
|
| 99 |
+
'kv_lora_rank': 384,
|
| 100 |
+
'n_routed_experts': 32,
|
| 101 |
+
'q_lora_rank': 32,
|
| 102 |
+
'qk_nope_head_dim': 64,
|
| 103 |
+
'qk_rope_head_dim': 192, # vllm mla kernel supports 576 only, FA supports head dim <= 256
|
| 104 |
+
'v_head_dim': 64,
|
| 105 |
+
'moe_topk': 12,
|
| 106 |
+
'zero_expert_num': 16,
|
| 107 |
+
})
|
| 108 |
+
# del config_json['quantization_config']
|
| 109 |
+
with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
|
| 110 |
+
json.dump(config_json, f, indent=2)
|
| 111 |
+
|
| 112 |
+
config = AutoConfig.from_pretrained(
|
| 113 |
+
save_folder,
|
| 114 |
+
trust_remote_code=True,
|
| 115 |
+
)
|
| 116 |
+
print(config)
|
| 117 |
+
torch.set_default_dtype(torch.bfloat16)
|
| 118 |
+
model = AutoModelForCausalLM.from_config(config, trust_remote_code=True)
|
| 119 |
+
if file_exists(filename="generation_config.json", repo_id=source_model_id, repo_type='model'):
|
| 120 |
+
model.generation_config = GenerationConfig.from_pretrained(
|
| 121 |
+
source_model_id, trust_remote_code=True,
|
| 122 |
+
)
|
| 123 |
+
model = model.cpu()
|
| 124 |
+
# MTP
|
| 125 |
+
model.model.mtp = nn.ModuleDict({
|
| 126 |
+
"layers": nn.ModuleList([nn.ModuleDict(dict(
|
| 127 |
+
eh_proj=nn.Linear(config.hidden_size * 2, config.hidden_size, bias=False),
|
| 128 |
+
enorm=nn.ModuleDict({"m": nn.RMSNorm(config.hidden_size)}),
|
| 129 |
+
hnorm=nn.ModuleDict({"m": nn.RMSNorm(config.hidden_size)}),
|
| 130 |
+
input_layernorm=nn.RMSNorm(config.hidden_size),
|
| 131 |
+
post_attention_layernorm=nn.RMSNorm(config.hidden_size),
|
| 132 |
+
self_attn=deepcopy(model.model.layers[0].self_attn[0]),
|
| 133 |
+
transformer_layer=nn.ModuleDict({"mlp": deepcopy(model.model.layers[0].mlps[0])}),
|
| 134 |
+
))]),
|
| 135 |
+
"norm": nn.RMSNorm(config.hidden_size),
|
| 136 |
+
})
|
| 137 |
+
for i in range(config.num_layers):
|
| 138 |
+
model.model.layers[i].mlp.router = model.model.layers[i].mlp.router.float()
|
| 139 |
+
# model.model.layers[i].mlp.router.e_score_correction_bias = torch.zeros((config.n_routed_experts + config.zero_expert_num)).float()
|
| 140 |
+
set_seed(42)
|
| 141 |
+
with torch.no_grad():
|
| 142 |
+
for name, p in sorted(model.named_parameters()):
|
| 143 |
+
torch.nn.init.normal_(p, 0, 0.1)
|
| 144 |
+
print(name, p.shape, p.dtype)
|
| 145 |
+
model.model.mtp.embed_tokens = deepcopy(model.model.embed_tokens)
|
| 146 |
+
|
| 147 |
+
model.save_pretrained(save_folder)
|
| 148 |
+
torch.set_default_dtype(torch.float32)
|
| 149 |
+
|
| 150 |
+
for n, m in model.named_modules():
|
| 151 |
+
if 'LongcatFlashMLA' in str(type(m)):
|
| 152 |
+
print(n, m.layer_idx)
|
| 153 |
+
|
| 154 |
+
with open(f"{save_folder}/config.json", "r", encoding='utf-8') as f:
|
| 155 |
+
config_json = json.load(f)
|
| 156 |
+
config_json['auto_map'] = {k: v.split('--')[-1] for k, v in config_json['auto_map'].items()}
|
| 157 |
+
with open(f"{save_folder}/config.json", "w", encoding='utf-8') as f:
|
| 158 |
+
json.dump(config_json, f, indent=2)
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
### Printing the model:
|
| 162 |
+
|
| 163 |
+
```text
|
| 164 |
+
LongcatFlashForCausalLM(
|
| 165 |
+
(model): LongcatFlashModel(
|
| 166 |
+
(embed_tokens): Embedding(131072, 8)
|
| 167 |
+
(layers): ModuleList(
|
| 168 |
+
(0-1): 2 x LongcatFlashDecoderLayer(
|
| 169 |
+
(mlp): LongcatFlashMoE(
|
| 170 |
+
(experts): ModuleList(
|
| 171 |
+
(0-31): 32 x LongcatFlashMLP(
|
| 172 |
+
(gate_proj): Linear(in_features=8, out_features=64, bias=False)
|
| 173 |
+
(up_proj): Linear(in_features=8, out_features=64, bias=False)
|
| 174 |
+
(down_proj): Linear(in_features=64, out_features=8, bias=False)
|
| 175 |
+
(act_fn): SiLU()
|
| 176 |
+
)
|
| 177 |
+
)
|
| 178 |
+
(router): LongcatFlashTopkRouter(
|
| 179 |
+
(classifier): Linear(in_features=8, out_features=48, bias=False)
|
| 180 |
+
)
|
| 181 |
+
)
|
| 182 |
+
(self_attn): ModuleList(
|
| 183 |
+
(0-1): 2 x LongcatFlashMLA(
|
| 184 |
+
(q_a_proj): Linear(in_features=8, out_features=32, bias=False)
|
| 185 |
+
(q_a_layernorm): LongcatFlashRMSNorm((32,), eps=1e-06)
|
| 186 |
+
(q_b_proj): Linear(in_features=32, out_features=1024, bias=False)
|
| 187 |
+
(kv_a_proj_with_mqa): Linear(in_features=8, out_features=576, bias=False)
|
| 188 |
+
(kv_a_layernorm): LongcatFlashRMSNorm((384,), eps=1e-06)
|
| 189 |
+
(kv_b_proj): Linear(in_features=384, out_features=512, bias=False)
|
| 190 |
+
(o_proj): Linear(in_features=256, out_features=8, bias=False)
|
| 191 |
+
)
|
| 192 |
+
)
|
| 193 |
+
(mlps): ModuleList(
|
| 194 |
+
(0-1): 2 x LongcatFlashMLP(
|
| 195 |
+
(gate_proj): Linear(in_features=8, out_features=64, bias=False)
|
| 196 |
+
(up_proj): Linear(in_features=8, out_features=64, bias=False)
|
| 197 |
+
(down_proj): Linear(in_features=64, out_features=8, bias=False)
|
| 198 |
+
(act_fn): SiLU()
|
| 199 |
+
)
|
| 200 |
+
)
|
| 201 |
+
(input_layernorm): ModuleList(
|
| 202 |
+
(0-1): 2 x LongcatFlashRMSNorm((8,), eps=1e-05)
|
| 203 |
+
)
|
| 204 |
+
(post_attention_layernorm): ModuleList(
|
| 205 |
+
(0-1): 2 x LongcatFlashRMSNorm((8,), eps=1e-05)
|
| 206 |
+
)
|
| 207 |
+
)
|
| 208 |
+
)
|
| 209 |
+
(norm): LongcatFlashRMSNorm((8,), eps=1e-05)
|
| 210 |
+
(rotary_emb): LongcatFlashRotaryEmbedding()
|
| 211 |
+
(mtp): ModuleDict(
|
| 212 |
+
(layers): ModuleList(
|
| 213 |
+
(0): ModuleDict(
|
| 214 |
+
(eh_proj): Linear(in_features=16, out_features=8, bias=False)
|
| 215 |
+
(enorm): ModuleDict(
|
| 216 |
+
(m): RMSNorm((8,), eps=None, elementwise_affine=True)
|
| 217 |
+
)
|
| 218 |
+
(hnorm): ModuleDict(
|
| 219 |
+
(m): RMSNorm((8,), eps=None, elementwise_affine=True)
|
| 220 |
+
)
|
| 221 |
+
(input_layernorm): RMSNorm((8,), eps=None, elementwise_affine=True)
|
| 222 |
+
(post_attention_layernorm): RMSNorm((8,), eps=None, elementwise_affine=True)
|
| 223 |
+
(self_attn): LongcatFlashMLA(
|
| 224 |
+
(q_a_proj): Linear(in_features=8, out_features=32, bias=False)
|
| 225 |
+
(q_a_layernorm): LongcatFlashRMSNorm((32,), eps=1e-06)
|
| 226 |
+
(q_b_proj): Linear(in_features=32, out_features=1024, bias=False)
|
| 227 |
+
(kv_a_proj_with_mqa): Linear(in_features=8, out_features=576, bias=False)
|
| 228 |
+
(kv_a_layernorm): LongcatFlashRMSNorm((384,), eps=1e-06)
|
| 229 |
+
(kv_b_proj): Linear(in_features=384, out_features=512, bias=False)
|
| 230 |
+
(o_proj): Linear(in_features=256, out_features=8, bias=False)
|
| 231 |
+
)
|
| 232 |
+
(transformer_layer): ModuleDict(
|
| 233 |
+
(mlp): LongcatFlashMLP(
|
| 234 |
+
(gate_proj): Linear(in_features=8, out_features=64, bias=False)
|
| 235 |
+
(up_proj): Linear(in_features=8, out_features=64, bias=False)
|
| 236 |
+
(down_proj): Linear(in_features=64, out_features=8, bias=False)
|
| 237 |
+
(act_fn): SiLU()
|
| 238 |
+
)
|
| 239 |
+
)
|
| 240 |
+
)
|
| 241 |
+
)
|
| 242 |
+
(norm): RMSNorm((8,), eps=None, elementwise_affine=True)
|
| 243 |
+
(embed_tokens): Embedding(131072, 8)
|
| 244 |
+
)
|
| 245 |
+
)
|
| 246 |
+
(lm_head): Linear(in_features=8, out_features=131072, bias=False)
|
| 247 |
+
)
|
| 248 |
+
```
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set tool_choice = tool_choice | default('auto') %}
|
| 2 |
+
{%- set ns = namespace(rounds = 0, tool_types = [], last_query_index = -1) %}
|
| 3 |
+
|
| 4 |
+
{%- if tools and tool_choice != 'none' %}
|
| 5 |
+
{{- "# Tools
|
| 6 |
+
" }}
|
| 7 |
+
{{- "You have access to the following tools:
|
| 8 |
+
|
| 9 |
+
" }}
|
| 10 |
+
{%- for tool in tools %}
|
| 11 |
+
{%- if tool.type in ['code_interpreter', 'function'] %}
|
| 12 |
+
{%- if tool.type not in ns.tool_types %}
|
| 13 |
+
{%- set ns.tool_types = ns.tool_types + [tool.type] %}
|
| 14 |
+
{{- "## Tool namespace: " ~ tool.type ~ "
|
| 15 |
+
|
| 16 |
+
" }}
|
| 17 |
+
{%- endif %}
|
| 18 |
+
{%- if tool.type == 'code_interpreter' %}
|
| 19 |
+
{%- set tool = {"type":"code_interpreter","function":{"name":"code_interpreter_preview","description":"The code will be executed in a stateful Jupyter notebook sandbox environment, only supports local computation, data processing, and file operations.
|
| 20 |
+
Code sandbox environment (network isolated) Any external network requests or online API calls are prohibited.
|
| 21 |
+
If online functionality is needed, please use other permitted tools.
|
| 22 |
+
Code will respond with the output of the execution or time out after 60.0 seconds. ","parameters":{"type":"object","properties":{"language":{"type":"string","description":"The programming language of the code to be executed. Available values: python (Default), java, go, js, ts, c, c++."},"code":{"type":"string","description":"Python code to be executed must not include the following:
|
| 23 |
+
- Importing network libraries such as requests, httplib, etc.
|
| 24 |
+
- Any form of HTTP requests.
|
| 25 |
+
- External API calls.
|
| 26 |
+
- Network port operations. Example: ```python
|
| 27 |
+
import pandas as pd
|
| 28 |
+
pd.DataFrame({'A':[1,2]})
|
| 29 |
+
```"},"timeout":{"type":"number","description":"The maximum execution time of the code, in seconds. Default is 60.0."}}},"required":["code"]}} %}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{{- "### Tool name: " + tool.function.name + "
|
| 32 |
+
|
| 33 |
+
" }}
|
| 34 |
+
{{- "Description: " + tool.function.description + "
|
| 35 |
+
|
| 36 |
+
" }}
|
| 37 |
+
{{- "InputSchema:
|
| 38 |
+
" + tool.function.parameters | tojson(indent=2) + "
|
| 39 |
+
|
| 40 |
+
" }}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- endfor %}
|
| 43 |
+
{{- '**Note**: For each function call, return a json object with function name and arguments within <longcat_tool_call></longcat_tool_call> XML tags as follows:
|
| 44 |
+
<longcat_tool_call>
|
| 45 |
+
{"name": <function-name>, "arguments": <args-dict>}
|
| 46 |
+
</longcat_tool_call>
|
| 47 |
+
' }}
|
| 48 |
+
{{- 'When multiple functions need to be called simultaneously, each function call should be wrapped in its own <longcat_tool_call> tag and placed consecutively. For example:
|
| 49 |
+
<longcat_tool_call>
|
| 50 |
+
{"name": <function-name>, "arguments": <args-dict>}
|
| 51 |
+
</longcat_tool_call><longcat_tool_call>
|
| 52 |
+
{"name": <function-name>, "arguments": <args-dict>}
|
| 53 |
+
</longcat_tool_call>
|
| 54 |
+
|
| 55 |
+
' }}
|
| 56 |
+
{{- "# Messages
|
| 57 |
+
" }}
|
| 58 |
+
|
| 59 |
+
{%- for idx in range(messages|length - 1) %}
|
| 60 |
+
{%- set msg = messages[idx] %}
|
| 61 |
+
{%- if msg.role == 'assistant' and not msg.tool_calls %}
|
| 62 |
+
{%- set ns.last_query_index = idx %}
|
| 63 |
+
{%- endif %}
|
| 64 |
+
{%- endfor%}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
|
| 67 |
+
{%- for msg in messages %}
|
| 68 |
+
{%- if msg.role == "system" %}
|
| 69 |
+
{{- "SYSTEM:" + msg.content }}
|
| 70 |
+
{%- elif msg.role == "user" %}
|
| 71 |
+
{%- if loop.first %}
|
| 72 |
+
{{- "[Round " ~ (ns.rounds) ~ "] USER:" }}
|
| 73 |
+
{%- else %}
|
| 74 |
+
{{- " [Round " ~ (ns.rounds) ~ "] USER:"}}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{%- set ns.rounds = ns.rounds + 1 %}
|
| 77 |
+
{%- if msg["files"] %}
|
| 78 |
+
{{- '<longcat_files>
|
| 79 |
+
' ~ msg.files | tojson(indent=2) ~ '
|
| 80 |
+
</longcat_files>' }}
|
| 81 |
+
{%- endif %}
|
| 82 |
+
{{- msg.content }}
|
| 83 |
+
{%- elif msg.role == "assistant" %}
|
| 84 |
+
{{- " ASSISTANT:" }}
|
| 85 |
+
{%- if enable_thinking == true and msg.reasoning_content and ns.tool_types != [] and loop.index0 > ns.last_query_index %}
|
| 86 |
+
{{- "
|
| 87 |
+
<longcat_think>
|
| 88 |
+
" ~ msg.reasoning_content ~ "
|
| 89 |
+
</longcat_think>
|
| 90 |
+
" }}
|
| 91 |
+
{%- endif %}
|
| 92 |
+
{%- if msg.content%}
|
| 93 |
+
{{- msg.content }}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
{%- if msg.tool_calls %}
|
| 96 |
+
{%- for tool_call in msg.tool_calls -%}
|
| 97 |
+
{{- "<longcat_tool_call>
|
| 98 |
+
" -}}
|
| 99 |
+
{%- if tool_call.function.arguments is string -%}
|
| 100 |
+
{"name": "{{ tool_call.function.name}}", "arguments": {{tool_call.function.arguments}}}
|
| 101 |
+
{%- else -%}
|
| 102 |
+
{"name": "{{ tool_call.function.name}}", "arguments": {{tool_call.function.arguments | tojson}}}
|
| 103 |
+
{%- endif -%}
|
| 104 |
+
{{- "
|
| 105 |
+
</longcat_tool_call>" }}
|
| 106 |
+
{%- endfor %}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{{- "</longcat_s>" -}}
|
| 109 |
+
{%- elif msg.role == "tool" %}
|
| 110 |
+
{{- " TOOL:" -}}
|
| 111 |
+
{%- if msg.name -%}
|
| 112 |
+
{"name": {{msg.name | tojson}}, "content": {{msg.content | tojson}}}
|
| 113 |
+
{%- else -%}
|
| 114 |
+
{"content": {{msg.content | tojson}}}
|
| 115 |
+
{%- endif -%}
|
| 116 |
+
{%- endif %}
|
| 117 |
+
{%- endfor %}
|
| 118 |
+
{%- if add_generation_prompt %}
|
| 119 |
+
{%- if enable_thinking == true %}
|
| 120 |
+
{{- " /think_on" }}
|
| 121 |
+
{%- if thinking_budget %}
|
| 122 |
+
{%- if thinking_budget < 1024 %}
|
| 123 |
+
{%- set thinking_budget = 1024 %}
|
| 124 |
+
{%- endif%}
|
| 125 |
+
{{- "
|
| 126 |
+
thinking_budget: < " ~ thinking_budget ~ "."}}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- " ASSISTANT:<longcat_think>
|
| 129 |
+
"}}
|
| 130 |
+
{%- elif enable_thinking == false %}
|
| 131 |
+
{{- " /think_off ASSISTANT:<longcat_think>
|
| 132 |
+
|
| 133 |
+
</longcat_think>
|
| 134 |
+
" }}
|
| 135 |
+
{%- else %}
|
| 136 |
+
{{- " ASSISTANT:" }}
|
| 137 |
+
{%- endif %}
|
| 138 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LongcatFlashForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"attention_method": "MLA",
|
| 8 |
+
"auto_map": {
|
| 9 |
+
"AutoConfig": "configuration_longcat_flash.LongcatFlashConfig",
|
| 10 |
+
"AutoModel": "modeling_longcat_flash.LongcatFlashModel",
|
| 11 |
+
"AutoModelForCausalLM": "modeling_longcat_flash.LongcatFlashForCausalLM"
|
| 12 |
+
},
|
| 13 |
+
"bos_token_id": 1,
|
| 14 |
+
"eos_token_id": 2,
|
| 15 |
+
"expert_ffn_hidden_size": 64,
|
| 16 |
+
"ffn_hidden_size": 64,
|
| 17 |
+
"head_dim": 192,
|
| 18 |
+
"hidden_act": "silu",
|
| 19 |
+
"hidden_size": 8,
|
| 20 |
+
"initializer_range": 0.006,
|
| 21 |
+
"kv_lora_rank": 384,
|
| 22 |
+
"max_position_embeddings": 131072,
|
| 23 |
+
"mla_scale_kv_lora": true,
|
| 24 |
+
"mla_scale_q_lora": true,
|
| 25 |
+
"model_type": "longcat_flash",
|
| 26 |
+
"moe_topk": 12,
|
| 27 |
+
"n_routed_experts": 32,
|
| 28 |
+
"norm_topk_prob": false,
|
| 29 |
+
"num_attention_heads": 4,
|
| 30 |
+
"num_key_value_heads": 4,
|
| 31 |
+
"num_layers": 2,
|
| 32 |
+
"q_lora_rank": 32,
|
| 33 |
+
"qk_head_dim": 256,
|
| 34 |
+
"qk_nope_head_dim": 64,
|
| 35 |
+
"qk_rope_head_dim": 192,
|
| 36 |
+
"rms_norm_eps": 1e-05,
|
| 37 |
+
"rope_theta": 10000000.0,
|
| 38 |
+
"routed_scaling_factor": 6.0,
|
| 39 |
+
"router_bias": false,
|
| 40 |
+
"tie_word_embeddings": false,
|
| 41 |
+
"torch_dtype": "bfloat16",
|
| 42 |
+
"transformers_version": "4.56.0.dev0",
|
| 43 |
+
"use_cache": true,
|
| 44 |
+
"v_head_dim": 64,
|
| 45 |
+
"vocab_size": 131072,
|
| 46 |
+
"zero_expert_num": 16,
|
| 47 |
+
"zero_expert_type": "identity"
|
| 48 |
+
}
|
configuration_longcat_flash.py
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
"""LongcatFlash model configuration"""
|
| 3 |
+
|
| 4 |
+
from transformers.configuration_utils import PretrainedConfig
|
| 5 |
+
from transformers.modeling_rope_utils import rope_config_validation
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
LONGCAT_PRETRAINED_CONFIG_ARCHIVE_MAP = {}
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class LongcatFlashConfig(PretrainedConfig):
|
| 12 |
+
r"""
|
| 13 |
+
This is the configuration class to store the configuration of a [`LongcatFlashModel`]. It is used to instantiate an LongcatFlash
|
| 14 |
+
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
|
| 15 |
+
defaults will yield a similar configuration to that of the LongcatFlash.
|
| 16 |
+
Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
|
| 17 |
+
documentation from [`PretrainedConfig`] for more information.
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
Args:
|
| 21 |
+
vocab_size (`int`, *optional*, defaults to 131072):
|
| 22 |
+
Vocabulary size of the Deep model. Defines the number of different tokens that can be represented by the
|
| 23 |
+
`inputs_ids` passed when calling [`LongcatFlashModel`]
|
| 24 |
+
hidden_size (`int`, *optional*, defaults to 7168):
|
| 25 |
+
Dimension of the hidden representations.
|
| 26 |
+
ffn_hidden_size (`int`, *optional*, defaults to 18432):
|
| 27 |
+
Dimension of the MLP representations.
|
| 28 |
+
expert_ffn_hidden_size (`int`, *optional*, defaults to 2048):
|
| 29 |
+
Dimension of the MoE representations.
|
| 30 |
+
num_layers (`int`, *optional*, defaults to 61):
|
| 31 |
+
Number of hidden layers in the Transformer decoder.
|
| 32 |
+
num_attention_heads (`int`, *optional*, defaults to 128):
|
| 33 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
| 34 |
+
num_key_value_heads (`int`, *optional*, defaults to 128):
|
| 35 |
+
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
|
| 36 |
+
`num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
|
| 37 |
+
`num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
|
| 38 |
+
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
|
| 39 |
+
by meanpooling all the original heads within that group. For more details checkout [this
|
| 40 |
+
paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to
|
| 41 |
+
`num_attention_heads`.
|
| 42 |
+
n_routed_experts (`int`, *optional*, defaults to 256):
|
| 43 |
+
Number of routed experts.
|
| 44 |
+
routed_scaling_factor (`float`, *optional*, defaults to 2.5):
|
| 45 |
+
Scaling factor or routed experts.
|
| 46 |
+
kv_lora_rank (`int`, *optional*, defaults to 512):
|
| 47 |
+
Rank of the LoRA matrices for key and value projections.
|
| 48 |
+
q_lora_rank (`int`, *optional*, defaults to 1536):
|
| 49 |
+
Rank of the LoRA matrices for query projections.
|
| 50 |
+
qk_rope_head_dim (`int`, *optional*, defaults to 64):
|
| 51 |
+
Dimension of the query/key heads that use rotary position embeddings.
|
| 52 |
+
v_head_dim (`int`, *optional*, defaults to 128):
|
| 53 |
+
Dimension of the value heads.
|
| 54 |
+
qk_nope_head_dim (`int`, *optional*, defaults to 128):
|
| 55 |
+
Dimension of the query/key heads that don't use rotary position embeddings.
|
| 56 |
+
norm_topk_prob (`bool`, *optional*, defaults to `True`):
|
| 57 |
+
Whether to normalize the weights of the routed experts.
|
| 58 |
+
hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
|
| 59 |
+
The non-linear activation function (function or string) in the decoder.
|
| 60 |
+
max_position_embeddings (`int`, *optional*, defaults to 4096):
|
| 61 |
+
The maximum sequence length that this model might ever be used with.
|
| 62 |
+
rms_norm_eps (`float`, *optional*, defaults to 1e-06):
|
| 63 |
+
The epsilon used by the rms normalization layers.
|
| 64 |
+
use_cache (`bool`, *optional*, defaults to `True`):
|
| 65 |
+
Whether or not the model should return the last key/values attentions (not used by all models). Only
|
| 66 |
+
relevant if `config.is_decoder=True`.
|
| 67 |
+
pad_token_id (`int`, *optional*):
|
| 68 |
+
Padding token id.
|
| 69 |
+
bos_token_id (`int`, *optional*, defaults to 0):
|
| 70 |
+
Beginning of stream token id.
|
| 71 |
+
eos_token_id (`int`, *optional*, defaults to 1):
|
| 72 |
+
End of stream token id.
|
| 73 |
+
tie_word_embeddings (`bool`, *optional*, defaults to `False`):
|
| 74 |
+
Whether to tie weight embeddings
|
| 75 |
+
rope_theta (`float`, *optional*, defaults to 10000.0):
|
| 76 |
+
The base period of the RoPE embeddings.
|
| 77 |
+
attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
|
| 78 |
+
Whether to use a bias in the query, key, value and output projection layers during self-attention.
|
| 79 |
+
attention_dropout (`float`, *optional*, defaults to 0.0):
|
| 80 |
+
The dropout ratio for the attention probabilities.
|
| 81 |
+
attention_method (`str`, *optional*, defaults to `"MLA"`):
|
| 82 |
+
The attention method to use.
|
| 83 |
+
initializer_range (`float`, *optional*, defaults to 0.006):
|
| 84 |
+
The initializer range for the model.
|
| 85 |
+
router_bias (`bool`, *optional*, defaults to `False`):
|
| 86 |
+
Whether to use a bias in the router.
|
| 87 |
+
zero_expert_num (`int`, *optional*, defaults to `None`):
|
| 88 |
+
The number of zero experts to use.
|
| 89 |
+
zero_expert_type (`str`, *optional*, defaults to `None`):
|
| 90 |
+
The type of zero expert to use.
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
>>> from transformers import LongcatFlashModel, LongcatFlashConfig
|
| 94 |
+
|
| 95 |
+
>>> # Initializing a LongcatFlash style configuration
|
| 96 |
+
>>> configuration = LongcatFlashConfig()
|
| 97 |
+
|
| 98 |
+
>>> # Accessing the model configuration
|
| 99 |
+
>>> configuration = model.config
|
| 100 |
+
```"""
|
| 101 |
+
|
| 102 |
+
model_type = "longcat_flash"
|
| 103 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
| 104 |
+
base_model_tp_plan = {
|
| 105 |
+
"layers.*.self_attn.k_proj": "colwise",
|
| 106 |
+
"layers.*.self_attn.v_proj": "colwise",
|
| 107 |
+
"layers.*.self_attn.o_proj": "rowwise",
|
| 108 |
+
"layers.*.mlp.experts.*.gate_proj": "local_colwise",
|
| 109 |
+
"layers.*.mlp.experts.*.up_proj": "local_colwise",
|
| 110 |
+
"layers.*.mlp.experts.*.down_proj": "local_rowwise",
|
| 111 |
+
"layers.*.mlps.*.gate_proj": "local_colwise",
|
| 112 |
+
"layers.*.mlps.*.up_proj": "local_colwise",
|
| 113 |
+
"layers.*.mlps.*.down_proj": "local_rowwise",
|
| 114 |
+
}
|
| 115 |
+
base_model_pp_plan = {
|
| 116 |
+
"embed_tokens": (["input_ids"], ["inputs_embeds"]),
|
| 117 |
+
"layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
|
| 118 |
+
"norm": (["hidden_states"], ["hidden_states"]),
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
def __init__(
|
| 122 |
+
self,
|
| 123 |
+
vocab_size=131072,
|
| 124 |
+
hidden_size=7168,
|
| 125 |
+
ffn_hidden_size=18432,
|
| 126 |
+
expert_ffn_hidden_size=2048,
|
| 127 |
+
num_layers=61,
|
| 128 |
+
num_attention_heads=128,
|
| 129 |
+
num_key_value_heads=None,
|
| 130 |
+
n_routed_experts=256,
|
| 131 |
+
routed_scaling_factor=1,
|
| 132 |
+
kv_lora_rank=512,
|
| 133 |
+
q_lora_rank=1536,
|
| 134 |
+
qk_rope_head_dim=64,
|
| 135 |
+
v_head_dim=128,
|
| 136 |
+
qk_nope_head_dim=128,
|
| 137 |
+
mla_scale_q_lora=True,
|
| 138 |
+
mla_scale_kv_lora=True,
|
| 139 |
+
moe_topk=8,
|
| 140 |
+
norm_topk_prob=False,
|
| 141 |
+
hidden_act="silu",
|
| 142 |
+
max_position_embeddings=4096,
|
| 143 |
+
rms_norm_eps=1e-6,
|
| 144 |
+
use_cache=True,
|
| 145 |
+
pad_token_id=None,
|
| 146 |
+
bos_token_id=0,
|
| 147 |
+
eos_token_id=1,
|
| 148 |
+
tie_word_embeddings=False,
|
| 149 |
+
rope_theta=10000.0,
|
| 150 |
+
attention_bias=False,
|
| 151 |
+
attention_dropout=0.0,
|
| 152 |
+
attention_method='MLA',
|
| 153 |
+
initializer_range=0.006,
|
| 154 |
+
router_bias=False,
|
| 155 |
+
zero_expert_num=None,
|
| 156 |
+
zero_expert_type=None,
|
| 157 |
+
**kwargs,
|
| 158 |
+
):
|
| 159 |
+
self.vocab_size = vocab_size
|
| 160 |
+
self.max_position_embeddings = max_position_embeddings
|
| 161 |
+
self.hidden_size = hidden_size
|
| 162 |
+
self.ffn_hidden_size = ffn_hidden_size
|
| 163 |
+
self.expert_ffn_hidden_size = expert_ffn_hidden_size
|
| 164 |
+
self.num_layers = num_layers
|
| 165 |
+
self.num_attention_heads = num_attention_heads
|
| 166 |
+
self.n_routed_experts = n_routed_experts
|
| 167 |
+
self.routed_scaling_factor = routed_scaling_factor
|
| 168 |
+
self.kv_lora_rank = kv_lora_rank
|
| 169 |
+
self.q_lora_rank = q_lora_rank
|
| 170 |
+
self.qk_rope_head_dim = qk_rope_head_dim
|
| 171 |
+
self.v_head_dim = v_head_dim
|
| 172 |
+
self.qk_nope_head_dim = qk_nope_head_dim
|
| 173 |
+
self.qk_head_dim = qk_nope_head_dim + qk_rope_head_dim
|
| 174 |
+
self.moe_topk = moe_topk
|
| 175 |
+
self.norm_topk_prob = norm_topk_prob
|
| 176 |
+
self.mla_scale_q_lora = mla_scale_q_lora
|
| 177 |
+
self.mla_scale_kv_lora = mla_scale_kv_lora
|
| 178 |
+
self.attention_method = attention_method
|
| 179 |
+
self.initializer_range = initializer_range
|
| 180 |
+
self.router_bias = router_bias
|
| 181 |
+
self.zero_expert_num = zero_expert_num
|
| 182 |
+
self.zero_expert_type = zero_expert_type
|
| 183 |
+
|
| 184 |
+
if self.attention_method == "MLA":
|
| 185 |
+
self.head_dim = qk_rope_head_dim
|
| 186 |
+
else:
|
| 187 |
+
ValueError('attention_method should be one of ["MLA"]')
|
| 188 |
+
|
| 189 |
+
|
| 190 |
+
if num_key_value_heads is None:
|
| 191 |
+
num_key_value_heads = num_attention_heads
|
| 192 |
+
|
| 193 |
+
self.num_key_value_heads = num_key_value_heads
|
| 194 |
+
self.hidden_act = hidden_act
|
| 195 |
+
self.rms_norm_eps = rms_norm_eps
|
| 196 |
+
self.use_cache = use_cache
|
| 197 |
+
self.rope_theta = rope_theta
|
| 198 |
+
self.attention_bias = attention_bias
|
| 199 |
+
self.attention_dropout = attention_dropout
|
| 200 |
+
|
| 201 |
+
rope_config_validation(self)
|
| 202 |
+
|
| 203 |
+
super().__init__(
|
| 204 |
+
pad_token_id=pad_token_id,
|
| 205 |
+
bos_token_id=bos_token_id,
|
| 206 |
+
eos_token_id=eos_token_id,
|
| 207 |
+
tie_word_embeddings=tie_word_embeddings,
|
| 208 |
+
**kwargs,
|
| 209 |
+
)
|
| 210 |
+
|
| 211 |
+
@property
|
| 212 |
+
def num_hidden_layers(self):
|
| 213 |
+
return self.num_layers
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
__all__ = ["LongcatFlashConfig"]
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 3,
|
| 6 |
+
"transformers_version": "4.56.0.dev0"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1e9fd6ed1a3c9d1ed020a2849fdb150758373362ea6ae772ecc0fbd3f16286b
|
| 3 |
+
size 8904024
|
modeling_longcat_flash.py
ADDED
|
@@ -0,0 +1,648 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
# Copyright (c) 2025 Meituan
|
| 3 |
+
# This code is licensed under the MIT License, for details, see the ./LICENSE file.
|
| 4 |
+
|
| 5 |
+
from typing import Callable, Optional, Union
|
| 6 |
+
|
| 7 |
+
import torch
|
| 8 |
+
import torch.nn.functional as F
|
| 9 |
+
from torch import nn
|
| 10 |
+
|
| 11 |
+
from transformers.activations import ACT2FN
|
| 12 |
+
from transformers.cache_utils import Cache, DynamicCache
|
| 13 |
+
from transformers.generation import GenerationMixin
|
| 14 |
+
from transformers.integrations import use_kernel_forward_from_hub
|
| 15 |
+
from transformers.masking_utils import create_causal_mask
|
| 16 |
+
from transformers.modeling_flash_attention_utils import FlashAttentionKwargs
|
| 17 |
+
from transformers.modeling_layers import GradientCheckpointingLayer
|
| 18 |
+
from transformers.modeling_outputs import BaseModelOutputWithPast, CausalLMOutputWithPast
|
| 19 |
+
from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
|
| 20 |
+
from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
|
| 21 |
+
from transformers.processing_utils import Unpack
|
| 22 |
+
from transformers.utils import TransformersKwargs, auto_docstring, can_return_tuple
|
| 23 |
+
from transformers.utils.generic import check_model_inputs
|
| 24 |
+
from .configuration_longcat_flash import LongcatFlashConfig
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
@use_kernel_forward_from_hub("RMSNorm")
|
| 28 |
+
class LongcatFlashRMSNorm(nn.Module):
|
| 29 |
+
def __init__(self, hidden_size, eps=1e-6):
|
| 30 |
+
"""
|
| 31 |
+
LongcatFlashRMSNorm is equivalent to T5LayerNorm
|
| 32 |
+
"""
|
| 33 |
+
super().__init__()
|
| 34 |
+
self.weight = nn.Parameter(torch.ones(hidden_size))
|
| 35 |
+
self.variance_epsilon = eps
|
| 36 |
+
|
| 37 |
+
def forward(self, hidden_states):
|
| 38 |
+
input_dtype = hidden_states.dtype
|
| 39 |
+
hidden_states = hidden_states.to(torch.float32)
|
| 40 |
+
variance = hidden_states.pow(2).mean(-1, keepdim=True)
|
| 41 |
+
hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
|
| 42 |
+
return self.weight * hidden_states.to(input_dtype)
|
| 43 |
+
|
| 44 |
+
def extra_repr(self):
|
| 45 |
+
return f"{tuple(self.weight.shape)}, eps={self.variance_epsilon}"
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
class LongcatFlashRotaryEmbedding(nn.Module):
|
| 49 |
+
def __init__(self, config: LongcatFlashConfig, device=None):
|
| 50 |
+
super().__init__()
|
| 51 |
+
# BC: "rope_type" was originally "type"
|
| 52 |
+
if hasattr(config, "rope_scaling") and isinstance(config.rope_scaling, dict):
|
| 53 |
+
self.rope_type = config.rope_scaling.get("rope_type", config.rope_scaling.get("type"))
|
| 54 |
+
else:
|
| 55 |
+
self.rope_type = "default"
|
| 56 |
+
self.max_seq_len_cached = config.max_position_embeddings
|
| 57 |
+
self.original_max_seq_len = config.max_position_embeddings
|
| 58 |
+
|
| 59 |
+
self.config = config
|
| 60 |
+
self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
|
| 61 |
+
|
| 62 |
+
inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
|
| 63 |
+
self.register_buffer("inv_freq", inv_freq, persistent=False)
|
| 64 |
+
self.original_inv_freq = self.inv_freq
|
| 65 |
+
|
| 66 |
+
@torch.no_grad()
|
| 67 |
+
@dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
|
| 68 |
+
def forward(self, x, position_ids):
|
| 69 |
+
inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
|
| 70 |
+
position_ids_expanded = position_ids[:, None, :].float()
|
| 71 |
+
|
| 72 |
+
device_type = x.device.type if isinstance(x.device.type, str) and x.device.type != "mps" else "cpu"
|
| 73 |
+
with torch.autocast(device_type=device_type, enabled=False): # Force float32
|
| 74 |
+
freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
|
| 75 |
+
emb = torch.cat((freqs, freqs), dim=-1)
|
| 76 |
+
cos = emb.cos() * self.attention_scaling
|
| 77 |
+
sin = emb.sin() * self.attention_scaling
|
| 78 |
+
|
| 79 |
+
return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
class LongcatFlashMLP(nn.Module):
|
| 83 |
+
def __init__(self, config, hidden_size=None, intermediate_size=None):
|
| 84 |
+
super().__init__()
|
| 85 |
+
self.config = config
|
| 86 |
+
self.hidden_size = config.hidden_size if hidden_size is None else hidden_size
|
| 87 |
+
self.intermediate_size = config.ffn_hidden_size if intermediate_size is None else intermediate_size
|
| 88 |
+
|
| 89 |
+
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
|
| 90 |
+
self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
|
| 91 |
+
self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
|
| 92 |
+
self.act_fn = ACT2FN[config.hidden_act]
|
| 93 |
+
|
| 94 |
+
def forward(self, x):
|
| 95 |
+
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
|
| 96 |
+
return down_proj
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
class LongcatFlashTopkRouter(nn.Module):
|
| 100 |
+
def __init__(self, config):
|
| 101 |
+
super().__init__()
|
| 102 |
+
self.config = config
|
| 103 |
+
self.top_k = config.moe_topk
|
| 104 |
+
self.n_routed_experts = (
|
| 105 |
+
config.n_routed_experts
|
| 106 |
+
if config.zero_expert_num is None
|
| 107 |
+
else config.n_routed_experts + config.zero_expert_num
|
| 108 |
+
)
|
| 109 |
+
self.routed_scaling_factor = config.routed_scaling_factor
|
| 110 |
+
self.norm_topk_prob = config.norm_topk_prob
|
| 111 |
+
self.router_bias = config.router_bias
|
| 112 |
+
|
| 113 |
+
self.classifier = nn.Linear(config.hidden_size, self.n_routed_experts, bias=self.router_bias)
|
| 114 |
+
self.register_buffer("e_score_correction_bias", torch.zeros((self.n_routed_experts)))
|
| 115 |
+
|
| 116 |
+
@torch.no_grad()
|
| 117 |
+
def get_topk_indices(self, scores):
|
| 118 |
+
scores_for_choice = scores.view(-1, self.n_routed_experts) + self.e_score_correction_bias.unsqueeze(0)
|
| 119 |
+
topk_indices = torch.topk(scores_for_choice, k=self.top_k, dim=-1, sorted=False)[1]
|
| 120 |
+
return topk_indices
|
| 121 |
+
|
| 122 |
+
def forward(self, hidden_states):
|
| 123 |
+
hidden_states = hidden_states.view(-1, self.config.hidden_size)
|
| 124 |
+
router_logits = F.linear(hidden_states.type(torch.float32), self.classifier.weight.type(torch.float32))
|
| 125 |
+
scores = router_logits.softmax(dim=-1)
|
| 126 |
+
topk_indices = self.get_topk_indices(scores)
|
| 127 |
+
topk_weights = scores.gather(1, topk_indices)
|
| 128 |
+
if self.norm_topk_prob:
|
| 129 |
+
denominator = topk_weights.sum(dim=-1, keepdim=True) + 1e-20
|
| 130 |
+
topk_weights /= denominator
|
| 131 |
+
topk_weights = topk_weights * self.routed_scaling_factor
|
| 132 |
+
return topk_indices, topk_weights
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
class LongcatFlashMoE(nn.Module):
|
| 136 |
+
"""
|
| 137 |
+
moe module.
|
| 138 |
+
"""
|
| 139 |
+
|
| 140 |
+
def __init__(self, config):
|
| 141 |
+
super().__init__()
|
| 142 |
+
self.config = config
|
| 143 |
+
self.experts = nn.ModuleList(
|
| 144 |
+
[
|
| 145 |
+
LongcatFlashMLP(config, intermediate_size=config.expert_ffn_hidden_size)
|
| 146 |
+
for _ in range(config.n_routed_experts)
|
| 147 |
+
]
|
| 148 |
+
)
|
| 149 |
+
self.router = LongcatFlashTopkRouter(config)
|
| 150 |
+
self.zero_expert_num = config.zero_expert_num
|
| 151 |
+
self.zero_expert_type = config.zero_expert_type
|
| 152 |
+
|
| 153 |
+
def moe(self, hidden_states: torch.Tensor, topk_indices: torch.Tensor, topk_weights: torch.Tensor):
|
| 154 |
+
final_hidden_states = torch.zeros_like(hidden_states, dtype=topk_weights.dtype)
|
| 155 |
+
total_experts = len(self.experts) if self.zero_expert_num is None else len(self.experts) + self.zero_expert_num
|
| 156 |
+
|
| 157 |
+
expert_mask = torch.nn.functional.one_hot(topk_indices, num_classes=total_experts)
|
| 158 |
+
expert_mask = expert_mask.permute(2, 0, 1)
|
| 159 |
+
|
| 160 |
+
for expert_idx in range(total_experts):
|
| 161 |
+
expert = self.experts[expert_idx] if expert_idx < len(self.experts) else None
|
| 162 |
+
mask = expert_mask[expert_idx]
|
| 163 |
+
token_indices, weight_indices = torch.where(mask)
|
| 164 |
+
|
| 165 |
+
if token_indices.numel() > 0:
|
| 166 |
+
expert_weights = topk_weights[token_indices, weight_indices]
|
| 167 |
+
expert_input = hidden_states[token_indices]
|
| 168 |
+
|
| 169 |
+
if self.zero_expert_num is None or expert_idx < len(self.experts):
|
| 170 |
+
expert_output = expert(expert_input)
|
| 171 |
+
elif self.zero_expert_type == "identity":
|
| 172 |
+
expert_output = expert_input
|
| 173 |
+
else:
|
| 174 |
+
raise ValueError("Unknown condition")
|
| 175 |
+
|
| 176 |
+
weighted_output = expert_output * expert_weights.unsqueeze(-1)
|
| 177 |
+
final_hidden_states.index_add_(0, token_indices, weighted_output)
|
| 178 |
+
|
| 179 |
+
return final_hidden_states.type(hidden_states.dtype)
|
| 180 |
+
|
| 181 |
+
def forward(self, hidden_states):
|
| 182 |
+
orig_shape = hidden_states.shape
|
| 183 |
+
topk_indices, topk_weights = self.router(hidden_states)
|
| 184 |
+
hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
|
| 185 |
+
hidden_states = self.moe(hidden_states, topk_indices, topk_weights).view(*orig_shape)
|
| 186 |
+
return hidden_states
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
def rotate_half(x):
|
| 190 |
+
"""Rotates half the hidden dims of the input."""
|
| 191 |
+
x1 = x[..., : x.shape[-1] // 2]
|
| 192 |
+
x2 = x[..., x.shape[-1] // 2 :]
|
| 193 |
+
return torch.cat((-x2, x1), dim=-1)
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
|
| 197 |
+
"""
|
| 198 |
+
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
|
| 199 |
+
num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
|
| 200 |
+
"""
|
| 201 |
+
batch, num_key_value_heads, slen, head_dim = hidden_states.shape
|
| 202 |
+
if n_rep == 1:
|
| 203 |
+
return hidden_states
|
| 204 |
+
hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
|
| 205 |
+
return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
def eager_attention_forward(
|
| 209 |
+
module: nn.Module,
|
| 210 |
+
query: torch.Tensor,
|
| 211 |
+
key: torch.Tensor,
|
| 212 |
+
value: torch.Tensor,
|
| 213 |
+
attention_mask: Optional[torch.Tensor],
|
| 214 |
+
scaling: float,
|
| 215 |
+
dropout: float = 0.0,
|
| 216 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 217 |
+
):
|
| 218 |
+
key_states = repeat_kv(key, module.num_key_value_groups)
|
| 219 |
+
value_states = repeat_kv(value, module.num_key_value_groups)
|
| 220 |
+
|
| 221 |
+
attn_weights = torch.matmul(query, key_states.transpose(2, 3)) * scaling
|
| 222 |
+
if attention_mask is not None:
|
| 223 |
+
causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
|
| 224 |
+
attn_weights = attn_weights + causal_mask
|
| 225 |
+
|
| 226 |
+
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query.dtype)
|
| 227 |
+
attn_weights = nn.functional.dropout(attn_weights, p=dropout, training=module.training)
|
| 228 |
+
attn_output = torch.matmul(attn_weights, value_states)
|
| 229 |
+
attn_output = attn_output.transpose(1, 2).contiguous()
|
| 230 |
+
|
| 231 |
+
return attn_output, attn_weights
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1, use_mla=False):
|
| 235 |
+
"""Applies Rotary Position Embedding to the query and key tensors.
|
| 236 |
+
|
| 237 |
+
Args:
|
| 238 |
+
q (`torch.Tensor`): The query tensor.
|
| 239 |
+
k (`torch.Tensor`): The key tensor.
|
| 240 |
+
cos (`torch.Tensor`): The cosine part of the rotary embedding.
|
| 241 |
+
sin (`torch.Tensor`): The sine part of the rotary embedding.
|
| 242 |
+
position_ids (`torch.Tensor`, *optional*):
|
| 243 |
+
Deprecated and unused.
|
| 244 |
+
unsqueeze_dim (`int`, *optional*, defaults to 1):
|
| 245 |
+
The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
|
| 246 |
+
sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
|
| 247 |
+
that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
|
| 248 |
+
k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
|
| 249 |
+
cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
|
| 250 |
+
the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
|
| 251 |
+
Returns:
|
| 252 |
+
`tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
|
| 253 |
+
"""
|
| 254 |
+
cos = cos.unsqueeze(unsqueeze_dim)
|
| 255 |
+
sin = sin.unsqueeze(unsqueeze_dim)
|
| 256 |
+
|
| 257 |
+
if use_mla:
|
| 258 |
+
b, h, s, d = q.shape
|
| 259 |
+
q = q.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
|
| 260 |
+
|
| 261 |
+
b, h, s, d = k.shape
|
| 262 |
+
k = k.view(b, h, s, d // 2, 2).transpose(4, 3).reshape(b, h, s, d)
|
| 263 |
+
|
| 264 |
+
q_embed = (q * cos) + (rotate_half(q) * sin)
|
| 265 |
+
k_embed = (k * cos) + (rotate_half(k) * sin)
|
| 266 |
+
return q_embed, k_embed
|
| 267 |
+
|
| 268 |
+
|
| 269 |
+
class LongcatFlashMLA(nn.Module):
|
| 270 |
+
"""Modified from Deepseek MLA"""
|
| 271 |
+
|
| 272 |
+
def __init__(self, config: LongcatFlashConfig, layer_idx: int):
|
| 273 |
+
super().__init__()
|
| 274 |
+
self.config = config
|
| 275 |
+
self.layer_idx = layer_idx
|
| 276 |
+
self.num_key_value_groups = config.num_attention_heads // config.num_key_value_heads
|
| 277 |
+
self.attention_dropout = config.attention_dropout
|
| 278 |
+
self.num_heads = config.num_attention_heads
|
| 279 |
+
self.rope_theta = config.rope_theta
|
| 280 |
+
self.q_lora_rank = config.q_lora_rank
|
| 281 |
+
self.qk_rope_head_dim = config.qk_rope_head_dim
|
| 282 |
+
self.kv_lora_rank = config.kv_lora_rank
|
| 283 |
+
self.v_head_dim = config.v_head_dim
|
| 284 |
+
self.qk_nope_head_dim = config.qk_nope_head_dim
|
| 285 |
+
self.qk_head_dim = config.qk_head_dim
|
| 286 |
+
|
| 287 |
+
self.is_causal = True
|
| 288 |
+
if self.q_lora_rank is None:
|
| 289 |
+
self.q_proj = nn.Linear(config.hidden_size, self.num_heads * self.qk_head_dim, bias=False)
|
| 290 |
+
else:
|
| 291 |
+
self.q_a_proj = nn.Linear(config.hidden_size, config.q_lora_rank, bias=config.attention_bias)
|
| 292 |
+
self.q_a_layernorm = LongcatFlashRMSNorm(config.q_lora_rank)
|
| 293 |
+
self.q_b_proj = nn.Linear(config.q_lora_rank, self.num_heads * self.qk_head_dim, bias=False)
|
| 294 |
+
|
| 295 |
+
self.kv_a_proj_with_mqa = nn.Linear(
|
| 296 |
+
config.hidden_size,
|
| 297 |
+
self.kv_lora_rank + self.qk_rope_head_dim,
|
| 298 |
+
bias=config.attention_bias,
|
| 299 |
+
)
|
| 300 |
+
self.kv_a_layernorm = LongcatFlashRMSNorm(self.kv_lora_rank)
|
| 301 |
+
self.kv_b_proj = nn.Linear(
|
| 302 |
+
self.kv_lora_rank,
|
| 303 |
+
self.num_heads * (self.qk_nope_head_dim + self.v_head_dim),
|
| 304 |
+
bias=False,
|
| 305 |
+
)
|
| 306 |
+
|
| 307 |
+
self.o_proj = nn.Linear(
|
| 308 |
+
self.num_heads * self.v_head_dim,
|
| 309 |
+
config.hidden_size,
|
| 310 |
+
bias=config.attention_bias,
|
| 311 |
+
)
|
| 312 |
+
|
| 313 |
+
if config.mla_scale_q_lora:
|
| 314 |
+
self.mla_scale_q_lora = (config.hidden_size / self.q_lora_rank) ** 0.5
|
| 315 |
+
if config.mla_scale_kv_lora:
|
| 316 |
+
self.mla_scale_kv_lora = (config.hidden_size / self.kv_lora_rank) ** 0.5
|
| 317 |
+
self.scaling = self.qk_head_dim ** (-0.5)
|
| 318 |
+
|
| 319 |
+
def forward(
|
| 320 |
+
self,
|
| 321 |
+
hidden_states: torch.Tensor,
|
| 322 |
+
position_embeddings: tuple[torch.Tensor, torch.Tensor],
|
| 323 |
+
attention_mask: Optional[torch.Tensor],
|
| 324 |
+
past_key_value: Optional[Cache] = None,
|
| 325 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 326 |
+
**kwargs: Unpack[FlashAttentionKwargs],
|
| 327 |
+
) -> tuple[torch.Tensor, Optional[torch.Tensor], Optional[tuple[torch.Tensor]]]:
|
| 328 |
+
batch_size, seq_length = hidden_states.shape[:-1]
|
| 329 |
+
query_shape = (batch_size, seq_length, -1, self.qk_head_dim)
|
| 330 |
+
key_shape = (batch_size, seq_length, -1, self.qk_nope_head_dim + self.v_head_dim)
|
| 331 |
+
|
| 332 |
+
q_states = self.q_b_proj(self.q_a_layernorm(self.q_a_proj(hidden_states))).view(query_shape).transpose(1, 2)
|
| 333 |
+
q_pass, q_rot = torch.split(q_states, [self.qk_nope_head_dim, self.qk_rope_head_dim], dim=-1)
|
| 334 |
+
|
| 335 |
+
# apply q_lora scaling
|
| 336 |
+
if self.mla_scale_q_lora is not None:
|
| 337 |
+
q_pass = q_pass * self.mla_scale_q_lora
|
| 338 |
+
q_rot = q_rot * self.mla_scale_q_lora
|
| 339 |
+
|
| 340 |
+
compressed_kv = self.kv_a_proj_with_mqa(hidden_states)
|
| 341 |
+
k_pass, k_rot = torch.split(compressed_kv, [self.kv_lora_rank, self.qk_rope_head_dim], dim=-1)
|
| 342 |
+
k_pass = self.kv_a_layernorm(k_pass)
|
| 343 |
+
|
| 344 |
+
# apply kv_lora scaling
|
| 345 |
+
if self.mla_scale_kv_lora is not None:
|
| 346 |
+
k_pass = k_pass * self.mla_scale_kv_lora
|
| 347 |
+
|
| 348 |
+
k_pass = self.kv_b_proj(k_pass).view(key_shape).transpose(1, 2)
|
| 349 |
+
k_pass, value_states = torch.split(k_pass, [self.qk_nope_head_dim, self.v_head_dim], dim=-1)
|
| 350 |
+
|
| 351 |
+
k_rot = k_rot.view(batch_size, 1, seq_length, self.qk_rope_head_dim)
|
| 352 |
+
|
| 353 |
+
cos, sin = position_embeddings
|
| 354 |
+
q_rot, k_rot = apply_rotary_pos_emb(q_rot, k_rot, cos, sin, use_mla=True)
|
| 355 |
+
k_rot = k_rot.expand(*k_pass.shape[:-1], -1)
|
| 356 |
+
|
| 357 |
+
query_states = torch.cat((q_pass, q_rot), dim=-1)
|
| 358 |
+
key_states = torch.cat((k_pass, k_rot), dim=-1)
|
| 359 |
+
|
| 360 |
+
if past_key_value is not None:
|
| 361 |
+
cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
|
| 362 |
+
key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
|
| 363 |
+
|
| 364 |
+
if self.config._attn_implementation == "flash_attention_2" and self.qk_head_dim != self.v_head_dim:
|
| 365 |
+
value_states = F.pad(value_states, [0, self.qk_head_dim - self.v_head_dim])
|
| 366 |
+
|
| 367 |
+
attention_interface: Callable = eager_attention_forward
|
| 368 |
+
if self.config._attn_implementation != "eager":
|
| 369 |
+
attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
|
| 370 |
+
|
| 371 |
+
attn_output, attn_weights = attention_interface(
|
| 372 |
+
self,
|
| 373 |
+
query_states,
|
| 374 |
+
key_states,
|
| 375 |
+
value_states,
|
| 376 |
+
attention_mask,
|
| 377 |
+
dropout=0.0 if not self.training else self.attention_dropout,
|
| 378 |
+
scaling=self.scaling,
|
| 379 |
+
**kwargs,
|
| 380 |
+
)
|
| 381 |
+
|
| 382 |
+
if self.config._attn_implementation == "flash_attention_2" and self.qk_head_dim != self.v_head_dim:
|
| 383 |
+
attn_output = attn_output[:, :, :, : self.v_head_dim]
|
| 384 |
+
|
| 385 |
+
attn_output = attn_output.reshape(batch_size, seq_length, -1).contiguous()
|
| 386 |
+
attn_output = self.o_proj(attn_output)
|
| 387 |
+
return attn_output, attn_weights
|
| 388 |
+
|
| 389 |
+
|
| 390 |
+
def create_attention_block(class_name, *args, **kwargs):
|
| 391 |
+
attention_mapping = {"MLA": LongcatFlashMLA}
|
| 392 |
+
|
| 393 |
+
chosen_class = attention_mapping.get(class_name)
|
| 394 |
+
if not chosen_class:
|
| 395 |
+
raise ValueError(f"No class found for name: {class_name}")
|
| 396 |
+
|
| 397 |
+
return chosen_class(*args, **kwargs)
|
| 398 |
+
|
| 399 |
+
|
| 400 |
+
class LongcatFlashDecoderLayer(GradientCheckpointingLayer):
|
| 401 |
+
def __init__(self, config: LongcatFlashConfig, layer_idx: int):
|
| 402 |
+
super().__init__()
|
| 403 |
+
self.layer_idx = layer_idx
|
| 404 |
+
self.hidden_size = config.hidden_size
|
| 405 |
+
self.mlp = LongcatFlashMoE(config)
|
| 406 |
+
|
| 407 |
+
self_attn = []
|
| 408 |
+
mlps = []
|
| 409 |
+
input_layernorm = []
|
| 410 |
+
post_attention_layernorm = []
|
| 411 |
+
for i in range(2):
|
| 412 |
+
self_attn.append(
|
| 413 |
+
create_attention_block(config.attention_method, config=config, layer_idx=layer_idx * 2 + i)
|
| 414 |
+
)
|
| 415 |
+
mlps.append(LongcatFlashMLP(config))
|
| 416 |
+
input_layernorm.append(LongcatFlashRMSNorm(config.hidden_size, eps=config.rms_norm_eps))
|
| 417 |
+
post_attention_layernorm.append(LongcatFlashRMSNorm(config.hidden_size, eps=config.rms_norm_eps))
|
| 418 |
+
|
| 419 |
+
self.self_attn = nn.ModuleList(self_attn)
|
| 420 |
+
self.mlps = nn.ModuleList(mlps)
|
| 421 |
+
self.input_layernorm = nn.ModuleList(input_layernorm)
|
| 422 |
+
self.post_attention_layernorm = nn.ModuleList(post_attention_layernorm)
|
| 423 |
+
|
| 424 |
+
def forward(
|
| 425 |
+
self,
|
| 426 |
+
hidden_states: torch.Tensor,
|
| 427 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 428 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 429 |
+
past_key_value: Optional[Cache] = None,
|
| 430 |
+
use_cache: Optional[bool] = False,
|
| 431 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 432 |
+
position_embeddings: Optional[tuple[torch.Tensor, torch.Tensor]] = None,
|
| 433 |
+
**kwargs: Unpack[FlashAttentionKwargs],
|
| 434 |
+
) -> tuple[torch.FloatTensor, Optional[tuple[torch.FloatTensor, torch.FloatTensor]]]:
|
| 435 |
+
for i in range(2):
|
| 436 |
+
residual = hidden_states
|
| 437 |
+
|
| 438 |
+
hidden_states = self.input_layernorm[i](hidden_states)
|
| 439 |
+
|
| 440 |
+
hidden_states, _ = self.self_attn[i](
|
| 441 |
+
hidden_states=hidden_states,
|
| 442 |
+
attention_mask=attention_mask,
|
| 443 |
+
position_ids=position_ids,
|
| 444 |
+
past_key_value=past_key_value,
|
| 445 |
+
use_cache=use_cache,
|
| 446 |
+
cache_position=cache_position,
|
| 447 |
+
position_embeddings=position_embeddings,
|
| 448 |
+
**kwargs,
|
| 449 |
+
)
|
| 450 |
+
hidden_states = residual + hidden_states
|
| 451 |
+
|
| 452 |
+
residual = hidden_states
|
| 453 |
+
hidden_states = self.post_attention_layernorm[i](hidden_states)
|
| 454 |
+
|
| 455 |
+
if i == 0:
|
| 456 |
+
shortcut_mlp_output = self.mlp(hidden_states) # shortcut output (MoE output)
|
| 457 |
+
|
| 458 |
+
hidden_states = self.mlps[i](hidden_states)
|
| 459 |
+
hidden_states = residual + hidden_states
|
| 460 |
+
if i == 1:
|
| 461 |
+
hidden_states = hidden_states + shortcut_mlp_output
|
| 462 |
+
|
| 463 |
+
return hidden_states
|
| 464 |
+
|
| 465 |
+
|
| 466 |
+
@auto_docstring
|
| 467 |
+
class LongcatFlashPreTrainedModel(PreTrainedModel):
|
| 468 |
+
config: LongcatFlashConfig
|
| 469 |
+
base_model_prefix = "model"
|
| 470 |
+
supports_gradient_checkpointing = True
|
| 471 |
+
_no_split_modules = ["LongcatFlashDecoderLayer"]
|
| 472 |
+
_skip_keys_device_placement = ["past_key_values"]
|
| 473 |
+
_supports_flash_attn = True
|
| 474 |
+
_supports_sdpa = True
|
| 475 |
+
_supports_flex_attn = True
|
| 476 |
+
_can_compile_fullgraph = True
|
| 477 |
+
_supports_attention_backend = True
|
| 478 |
+
_can_record_outputs = {
|
| 479 |
+
"hidden_states": LongcatFlashDecoderLayer,
|
| 480 |
+
"attentions": LongcatFlashMLA,
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
|
| 484 |
+
@auto_docstring
|
| 485 |
+
class LongcatFlashModel(LongcatFlashPreTrainedModel):
|
| 486 |
+
_keys_to_ignore_on_load_unexpected = [r"model\.mtp.*"]
|
| 487 |
+
|
| 488 |
+
def __init__(self, config: LongcatFlashConfig):
|
| 489 |
+
super().__init__(config)
|
| 490 |
+
self.padding_idx = config.pad_token_id
|
| 491 |
+
self.vocab_size = config.vocab_size
|
| 492 |
+
|
| 493 |
+
self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
|
| 494 |
+
self.layers = nn.ModuleList(
|
| 495 |
+
[LongcatFlashDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
|
| 496 |
+
)
|
| 497 |
+
self.norm = LongcatFlashRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
|
| 498 |
+
self.rotary_emb = LongcatFlashRotaryEmbedding(config=config)
|
| 499 |
+
self.gradient_checkpointing = False
|
| 500 |
+
|
| 501 |
+
# Initialize weights and apply final processing
|
| 502 |
+
self.post_init()
|
| 503 |
+
|
| 504 |
+
@check_model_inputs
|
| 505 |
+
@auto_docstring
|
| 506 |
+
def forward(
|
| 507 |
+
self,
|
| 508 |
+
input_ids: Optional[torch.LongTensor] = None,
|
| 509 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 510 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 511 |
+
past_key_values: Optional[Cache] = None,
|
| 512 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 513 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 514 |
+
use_cache: Optional[bool] = None,
|
| 515 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 516 |
+
) -> BaseModelOutputWithPast:
|
| 517 |
+
if (input_ids is None) ^ (inputs_embeds is not None):
|
| 518 |
+
raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
|
| 519 |
+
|
| 520 |
+
if inputs_embeds is None:
|
| 521 |
+
inputs_embeds: torch.Tensor = self.embed_tokens(input_ids)
|
| 522 |
+
|
| 523 |
+
if use_cache and past_key_values is None:
|
| 524 |
+
past_key_values = DynamicCache()
|
| 525 |
+
|
| 526 |
+
if cache_position is None:
|
| 527 |
+
past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
|
| 528 |
+
cache_position: torch.Tensor = torch.arange(
|
| 529 |
+
past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
|
| 530 |
+
)
|
| 531 |
+
|
| 532 |
+
if position_ids is None:
|
| 533 |
+
position_ids = cache_position.unsqueeze(0)
|
| 534 |
+
|
| 535 |
+
causal_mask = create_causal_mask(
|
| 536 |
+
config=self.config,
|
| 537 |
+
input_embeds=inputs_embeds,
|
| 538 |
+
attention_mask=attention_mask,
|
| 539 |
+
cache_position=cache_position,
|
| 540 |
+
past_key_values=past_key_values,
|
| 541 |
+
position_ids=position_ids,
|
| 542 |
+
)
|
| 543 |
+
|
| 544 |
+
hidden_states = inputs_embeds
|
| 545 |
+
position_embeddings = self.rotary_emb(hidden_states, position_ids)
|
| 546 |
+
|
| 547 |
+
for decoder_layer in self.layers[: self.config.num_hidden_layers]:
|
| 548 |
+
hidden_states = decoder_layer(
|
| 549 |
+
hidden_states,
|
| 550 |
+
attention_mask=causal_mask,
|
| 551 |
+
position_ids=position_ids,
|
| 552 |
+
past_key_value=past_key_values,
|
| 553 |
+
cache_position=cache_position,
|
| 554 |
+
position_embeddings=position_embeddings,
|
| 555 |
+
**kwargs,
|
| 556 |
+
)
|
| 557 |
+
|
| 558 |
+
hidden_states = self.norm(hidden_states)
|
| 559 |
+
return BaseModelOutputWithPast(
|
| 560 |
+
last_hidden_state=hidden_states,
|
| 561 |
+
past_key_values=past_key_values,
|
| 562 |
+
)
|
| 563 |
+
|
| 564 |
+
|
| 565 |
+
@auto_docstring
|
| 566 |
+
class LongcatFlashForCausalLM(LongcatFlashPreTrainedModel, GenerationMixin):
|
| 567 |
+
_tied_weights_keys = ["lm_head.weight"]
|
| 568 |
+
_tp_plan = {"lm_head": "colwise_rep"}
|
| 569 |
+
_pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
|
| 570 |
+
_keys_to_ignore_on_load_unexpected = [r"model\.mtp.*"]
|
| 571 |
+
|
| 572 |
+
def __init__(self, config):
|
| 573 |
+
super().__init__(config)
|
| 574 |
+
self.model = LongcatFlashModel(config)
|
| 575 |
+
self.vocab_size = config.vocab_size
|
| 576 |
+
self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
|
| 577 |
+
|
| 578 |
+
# Initialize weights and apply final processing
|
| 579 |
+
self.post_init()
|
| 580 |
+
|
| 581 |
+
def set_decoder(self, decoder):
|
| 582 |
+
self.model = decoder
|
| 583 |
+
|
| 584 |
+
def get_decoder(self):
|
| 585 |
+
return self.model
|
| 586 |
+
|
| 587 |
+
@can_return_tuple
|
| 588 |
+
@auto_docstring
|
| 589 |
+
def forward(
|
| 590 |
+
self,
|
| 591 |
+
input_ids: Optional[torch.LongTensor] = None,
|
| 592 |
+
attention_mask: Optional[torch.Tensor] = None,
|
| 593 |
+
position_ids: Optional[torch.LongTensor] = None,
|
| 594 |
+
past_key_values: Optional[Cache] = None,
|
| 595 |
+
inputs_embeds: Optional[torch.FloatTensor] = None,
|
| 596 |
+
labels: Optional[torch.LongTensor] = None,
|
| 597 |
+
use_cache: Optional[bool] = None,
|
| 598 |
+
cache_position: Optional[torch.LongTensor] = None,
|
| 599 |
+
logits_to_keep: Union[int, torch.Tensor] = 0,
|
| 600 |
+
**kwargs: Unpack[TransformersKwargs],
|
| 601 |
+
) -> CausalLMOutputWithPast:
|
| 602 |
+
r"""
|
| 603 |
+
Example:
|
| 604 |
+
|
| 605 |
+
```python
|
| 606 |
+
>>> from transformers import AutoTokenizer, LongcatFlashForCausalLM
|
| 607 |
+
|
| 608 |
+
>>> model = LongcatFlashForCausalLM.from_pretrained("meta-longcat_flash/LongcatFlash-2-7b-hf")
|
| 609 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("meta-longcat_flash/LongcatFlash-2-7b-hf")
|
| 610 |
+
|
| 611 |
+
>>> prompt = "Hey, are you conscious? Can you talk to me?"
|
| 612 |
+
>>> inputs = tokenizer(prompt, return_tensors="pt")
|
| 613 |
+
|
| 614 |
+
>>> # Generate
|
| 615 |
+
>>> generate_ids = model.generate(inputs.input_ids, max_length=30)
|
| 616 |
+
>>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
| 617 |
+
"Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
|
| 618 |
+
```"""
|
| 619 |
+
outputs: BaseModelOutputWithPast = self.model(
|
| 620 |
+
input_ids=input_ids,
|
| 621 |
+
attention_mask=attention_mask,
|
| 622 |
+
position_ids=position_ids,
|
| 623 |
+
past_key_values=past_key_values,
|
| 624 |
+
inputs_embeds=inputs_embeds,
|
| 625 |
+
use_cache=use_cache,
|
| 626 |
+
cache_position=cache_position,
|
| 627 |
+
**kwargs,
|
| 628 |
+
)
|
| 629 |
+
|
| 630 |
+
hidden_states = outputs.last_hidden_state
|
| 631 |
+
# Only compute necessary logits, and do not upcast them to float if we are not computing the loss
|
| 632 |
+
slice_indices = slice(-logits_to_keep, None) if isinstance(logits_to_keep, int) else logits_to_keep
|
| 633 |
+
logits = self.lm_head(hidden_states[:, slice_indices, :])
|
| 634 |
+
|
| 635 |
+
loss = None
|
| 636 |
+
if labels is not None:
|
| 637 |
+
loss = self.loss_function(logits=logits, labels=labels, vocab_size=self.config.vocab_size, **kwargs)
|
| 638 |
+
|
| 639 |
+
return CausalLMOutputWithPast(
|
| 640 |
+
loss=loss,
|
| 641 |
+
logits=logits,
|
| 642 |
+
past_key_values=outputs.past_key_values,
|
| 643 |
+
hidden_states=outputs.hidden_states,
|
| 644 |
+
attentions=outputs.attentions,
|
| 645 |
+
)
|
| 646 |
+
|
| 647 |
+
|
| 648 |
+
__all__ = ["LongcatFlashPreTrainedModel", "LongcatFlashModel", "LongcatFlashForCausalLM"]
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<longcat_s>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "</longcat_s>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<longcat_pad>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<longcat_unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,1810 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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at_unk>",
|
| 8 |
+
"lstrip": false,
|
| 9 |
+
"normalized": false,
|
| 10 |
+
"rstrip": false,
|
| 11 |
+
"single_word": false,
|
| 12 |
+
"special": true
|
| 13 |
+
},
|
| 14 |
+
"1": {
|
| 15 |
+
"content": "<longcat_s>",
|
| 16 |
+
"lstrip": false,
|
| 17 |
+
"normalized": false,
|
| 18 |
+
"rstrip": false,
|
| 19 |
+
"single_word": false,
|
| 20 |
+
"special": true
|
| 21 |
+
},
|
| 22 |
+
"2": {
|
| 23 |
+
"content": "</longcat_s>",
|
| 24 |
+
"lstrip": false,
|
| 25 |
+
"normalized": false,
|
| 26 |
+
"rstrip": false,
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"special": true
|
| 29 |
+
},
|
| 30 |
+
"3": {
|
| 31 |
+
"content": "<longcat_pad>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false,
|
| 36 |
+
"special": true
|
| 37 |
+
},
|
| 38 |
+
"4": {
|
| 39 |
+
"content": "<shift_unk>",
|
| 40 |
+
"lstrip": false,
|
| 41 |
+
"normalized": false,
|
| 42 |
+
"rstrip": false,
|
| 43 |
+
"single_word": false,
|
| 44 |
+
"special": true
|
| 45 |
+
},
|
| 46 |
+
"5": {
|
| 47 |
+
"content": "<shift_s>",
|
| 48 |
+
"lstrip": false,
|
| 49 |
+
"normalized": false,
|
| 50 |
+
"rstrip": false,
|
| 51 |
+
"single_word": false,
|
| 52 |
+
"special": true
|
| 53 |
+
},
|
| 54 |
+
"6": {
|
| 55 |
+
"content": "</shift_s>",
|
| 56 |
+
"lstrip": false,
|
| 57 |
+
"normalized": false,
|
| 58 |
+
"rstrip": false,
|
| 59 |
+
"single_word": false,
|
| 60 |
+
"special": true
|
| 61 |
+
},
|
| 62 |
+
"7": {
|
| 63 |
+
"content": "<shift_pad>",
|
| 64 |
+
"lstrip": false,
|
| 65 |
+
"normalized": false,
|
| 66 |
+
"rstrip": false,
|
| 67 |
+
"single_word": false,
|
| 68 |
+
"special": true
|
| 69 |
+
},
|
| 70 |
+
"8": {
|
| 71 |
+
"content": "<mask_0>",
|
| 72 |
+
"lstrip": false,
|
| 73 |
+
"normalized": false,
|
| 74 |
+
"rstrip": false,
|
| 75 |
+
"single_word": false,
|
| 76 |
+
"special": true
|
| 77 |
+
},
|
| 78 |
+
"9": {
|
| 79 |
+
"content": "<reponame>",
|
| 80 |
+
"lstrip": false,
|
| 81 |
+
"normalized": false,
|
| 82 |
+
"rstrip": false,
|
| 83 |
+
"single_word": false,
|
| 84 |
+
"special": true
|
| 85 |
+
},
|
| 86 |
+
"10": {
|
| 87 |
+
"content": "<filename>",
|
| 88 |
+
"lstrip": false,
|
| 89 |
+
"normalized": false,
|
| 90 |
+
"rstrip": false,
|
| 91 |
+
"single_word": false,
|
| 92 |
+
"special": true
|
| 93 |
+
},
|
| 94 |
+
"11": {
|
| 95 |
+
"content": "<gh_stars>",
|
| 96 |
+
"lstrip": false,
|
| 97 |
+
"normalized": false,
|
| 98 |
+
"rstrip": false,
|
| 99 |
+
"single_word": false,
|
| 100 |
+
"special": true
|
| 101 |
+
},
|
| 102 |
+
"12": {
|
| 103 |
+
"content": "<issue_start>",
|
| 104 |
+
"lstrip": false,
|
| 105 |
+
"normalized": false,
|
| 106 |
+
"rstrip": false,
|
| 107 |
+
"single_word": false,
|
| 108 |
+
"special": true
|
| 109 |
+
},
|
| 110 |
+
"13": {
|
| 111 |
+
"content": "<issue_comment>",
|
| 112 |
+
"lstrip": false,
|
| 113 |
+
"normalized": false,
|
| 114 |
+
"rstrip": false,
|
| 115 |
+
"single_word": false,
|
| 116 |
+
"special": true
|
| 117 |
+
},
|
| 118 |
+
"14": {
|
| 119 |
+
"content": "<issue_closed>",
|
| 120 |
+
"lstrip": false,
|
| 121 |
+
"normalized": false,
|
| 122 |
+
"rstrip": false,
|
| 123 |
+
"single_word": false,
|
| 124 |
+
"special": true
|
| 125 |
+
},
|
| 126 |
+
"15": {
|
| 127 |
+
"content": "<jupyter_start>",
|
| 128 |
+
"lstrip": false,
|
| 129 |
+
"normalized": false,
|
| 130 |
+
"rstrip": false,
|
| 131 |
+
"single_word": false,
|
| 132 |
+
"special": true
|
| 133 |
+
},
|
| 134 |
+
"16": {
|
| 135 |
+
"content": "<jupyter_text>",
|
| 136 |
+
"lstrip": false,
|
| 137 |
+
"normalized": false,
|
| 138 |
+
"rstrip": false,
|
| 139 |
+
"single_word": false,
|
| 140 |
+
"special": true
|
| 141 |
+
},
|
| 142 |
+
"17": {
|
| 143 |
+
"content": "<jupyter_code>",
|
| 144 |
+
"lstrip": false,
|
| 145 |
+
"normalized": false,
|
| 146 |
+
"rstrip": false,
|
| 147 |
+
"single_word": false,
|
| 148 |
+
"special": true
|
| 149 |
+
},
|
| 150 |
+
"18": {
|
| 151 |
+
"content": "<jupyter_output>",
|
| 152 |
+
"lstrip": false,
|
| 153 |
+
"normalized": false,
|
| 154 |
+
"rstrip": false,
|
| 155 |
+
"single_word": false,
|
| 156 |
+
"special": true
|
| 157 |
+
},
|
| 158 |
+
"19": {
|
| 159 |
+
"content": "<empty_output>",
|
| 160 |
+
"lstrip": false,
|
| 161 |
+
"normalized": false,
|
| 162 |
+
"rstrip": false,
|
| 163 |
+
"single_word": false,
|
| 164 |
+
"special": true
|
| 165 |
+
},
|
| 166 |
+
"20": {
|
| 167 |
+
"content": "<commit_before>",
|
| 168 |
+
"lstrip": false,
|
| 169 |
+
"normalized": false,
|
| 170 |
+
"rstrip": false,
|
| 171 |
+
"single_word": false,
|
| 172 |
+
"special": true
|
| 173 |
+
},
|
| 174 |
+
"21": {
|
| 175 |
+
"content": "<commit_msg>",
|
| 176 |
+
"lstrip": false,
|
| 177 |
+
"normalized": false,
|
| 178 |
+
"rstrip": false,
|
| 179 |
+
"single_word": false,
|
| 180 |
+
"special": true
|
| 181 |
+
},
|
| 182 |
+
"22": {
|
| 183 |
+
"content": "<commit_after>",
|
| 184 |
+
"lstrip": false,
|
| 185 |
+
"normalized": false,
|
| 186 |
+
"rstrip": false,
|
| 187 |
+
"single_word": false,
|
| 188 |
+
"special": true
|
| 189 |
+
},
|
| 190 |
+
"23": {
|
| 191 |
+
"content": "<program_lang>",
|
| 192 |
+
"lstrip": false,
|
| 193 |
+
"normalized": false,
|
| 194 |
+
"rstrip": false,
|
| 195 |
+
"single_word": false,
|
| 196 |
+
"special": true
|
| 197 |
+
},
|
| 198 |
+
"24": {
|
| 199 |
+
"content": "<|image_placeholder|>",
|
| 200 |
+
"lstrip": false,
|
| 201 |
+
"normalized": false,
|
| 202 |
+
"rstrip": false,
|
| 203 |
+
"single_word": false,
|
| 204 |
+
"special": true
|
| 205 |
+
},
|
| 206 |
+
"25": {
|
| 207 |
+
"content": "<|url_placeholder|>",
|
| 208 |
+
"lstrip": false,
|
| 209 |
+
"normalized": false,
|
| 210 |
+
"rstrip": false,
|
| 211 |
+
"single_word": false,
|
| 212 |
+
"special": true
|
| 213 |
+
},
|
| 214 |
+
"26": {
|
| 215 |
+
"content": "<|hyperlink_placeholder|>",
|
| 216 |
+
"lstrip": false,
|
| 217 |
+
"normalized": false,
|
| 218 |
+
"rstrip": false,
|
| 219 |
+
"single_word": false,
|
| 220 |
+
"special": true
|
| 221 |
+
},
|
| 222 |
+
"27": {
|
| 223 |
+
"content": "<|table_placeholder|>",
|
| 224 |
+
"lstrip": false,
|
| 225 |
+
"normalized": false,
|
| 226 |
+
"rstrip": false,
|
| 227 |
+
"single_word": false,
|
| 228 |
+
"special": true
|
| 229 |
+
},
|
| 230 |
+
"28": {
|
| 231 |
+
"content": "<|equation_placeholder|>",
|
| 232 |
+
"lstrip": false,
|
| 233 |
+
"normalized": false,
|
| 234 |
+
"rstrip": false,
|
| 235 |
+
"single_word": false,
|
| 236 |
+
"special": true
|
| 237 |
+
},
|
| 238 |
+
"29": {
|
| 239 |
+
"content": "<|code_placeholder|>",
|
| 240 |
+
"lstrip": false,
|
| 241 |
+
"normalized": false,
|
| 242 |
+
"rstrip": false,
|
| 243 |
+
"single_word": false,
|
| 244 |
+
"special": true
|
| 245 |
+
},
|
| 246 |
+
"30": {
|
| 247 |
+
"content": "<|reference_placeholder|>",
|
| 248 |
+
"lstrip": false,
|
| 249 |
+
"normalized": false,
|
| 250 |
+
"rstrip": false,
|
| 251 |
+
"single_word": false,
|
| 252 |
+
"special": true
|
| 253 |
+
},
|
| 254 |
+
"31": {
|
| 255 |
+
"content": "<|endoftext|>",
|
| 256 |
+
"lstrip": false,
|
| 257 |
+
"normalized": false,
|
| 258 |
+
"rstrip": false,
|
| 259 |
+
"single_word": false,
|
| 260 |
+
"special": true
|
| 261 |
+
},
|
| 262 |
+
"32": {
|
| 263 |
+
"content": "<fim_prefix>",
|
| 264 |
+
"lstrip": false,
|
| 265 |
+
"normalized": false,
|
| 266 |
+
"rstrip": false,
|
| 267 |
+
"single_word": false,
|
| 268 |
+
"special": true
|
| 269 |
+
},
|
| 270 |
+
"33": {
|
| 271 |
+
"content": "<fim_middle>",
|
| 272 |
+
"lstrip": false,
|
| 273 |
+
"normalized": false,
|
| 274 |
+
"rstrip": false,
|
| 275 |
+
"single_word": false,
|
| 276 |
+
"special": true
|
| 277 |
+
},
|
| 278 |
+
"34": {
|
| 279 |
+
"content": "<fim_suffix>",
|
| 280 |
+
"lstrip": false,
|
| 281 |
+
"normalized": false,
|
| 282 |
+
"rstrip": false,
|
| 283 |
+
"single_word": false,
|
| 284 |
+
"special": true
|
| 285 |
+
},
|
| 286 |
+
"35": {
|
| 287 |
+
"content": "<fim_pad>",
|
| 288 |
+
"lstrip": false,
|
| 289 |
+
"normalized": false,
|
| 290 |
+
"rstrip": false,
|
| 291 |
+
"single_word": false,
|
| 292 |
+
"special": true
|
| 293 |
+
},
|
| 294 |
+
"36": {
|
| 295 |
+
"content": "<longcat_think>",
|
| 296 |
+
"lstrip": false,
|
| 297 |
+
"normalized": false,
|
| 298 |
+
"rstrip": false,
|
| 299 |
+
"single_word": false,
|
| 300 |
+
"special": false
|
| 301 |
+
},
|
| 302 |
+
"37": {
|
| 303 |
+
"content": "</longcat_think>",
|
| 304 |
+
"lstrip": false,
|
| 305 |
+
"normalized": false,
|
| 306 |
+
"rstrip": false,
|
| 307 |
+
"single_word": false,
|
| 308 |
+
"special": false
|
| 309 |
+
},
|
| 310 |
+
"38": {
|
| 311 |
+
"content": "<longcat_answer>",
|
| 312 |
+
"lstrip": false,
|
| 313 |
+
"normalized": false,
|
| 314 |
+
"rstrip": false,
|
| 315 |
+
"single_word": false,
|
| 316 |
+
"special": false
|
| 317 |
+
},
|
| 318 |
+
"39": {
|
| 319 |
+
"content": "</longcat_answer>",
|
| 320 |
+
"lstrip": false,
|
| 321 |
+
"normalized": false,
|
| 322 |
+
"rstrip": false,
|
| 323 |
+
"single_word": false,
|
| 324 |
+
"special": false
|
| 325 |
+
},
|
| 326 |
+
"40": {
|
| 327 |
+
"content": "<longcat_files>",
|
| 328 |
+
"lstrip": false,
|
| 329 |
+
"normalized": false,
|
| 330 |
+
"rstrip": false,
|
| 331 |
+
"single_word": false,
|
| 332 |
+
"special": false
|
| 333 |
+
},
|
| 334 |
+
"41": {
|
| 335 |
+
"content": "</longcat_files>",
|
| 336 |
+
"lstrip": false,
|
| 337 |
+
"normalized": false,
|
| 338 |
+
"rstrip": false,
|
| 339 |
+
"single_word": false,
|
| 340 |
+
"special": false
|
| 341 |
+
},
|
| 342 |
+
"42": {
|
| 343 |
+
"content": "<longcat_tool_call>",
|
| 344 |
+
"lstrip": false,
|
| 345 |
+
"normalized": false,
|
| 346 |
+
"rstrip": false,
|
| 347 |
+
"single_word": false,
|
| 348 |
+
"special": false
|
| 349 |
+
},
|
| 350 |
+
"43": {
|
| 351 |
+
"content": "</longcat_tool_call>",
|
| 352 |
+
"lstrip": false,
|
| 353 |
+
"normalized": false,
|
| 354 |
+
"rstrip": false,
|
| 355 |
+
"single_word": false,
|
| 356 |
+
"special": false
|
| 357 |
+
},
|
| 358 |
+
"44": {
|
| 359 |
+
"content": "<mask_20>",
|
| 360 |
+
"lstrip": false,
|
| 361 |
+
"normalized": false,
|
| 362 |
+
"rstrip": false,
|
| 363 |
+
"single_word": false,
|
| 364 |
+
"special": true
|
| 365 |
+
},
|
| 366 |
+
"45": {
|
| 367 |
+
"content": "<mask_21>",
|
| 368 |
+
"lstrip": false,
|
| 369 |
+
"normalized": false,
|
| 370 |
+
"rstrip": false,
|
| 371 |
+
"single_word": false,
|
| 372 |
+
"special": true
|
| 373 |
+
},
|
| 374 |
+
"46": {
|
| 375 |
+
"content": "<mask_22>",
|
| 376 |
+
"lstrip": false,
|
| 377 |
+
"normalized": false,
|
| 378 |
+
"rstrip": false,
|
| 379 |
+
"single_word": false,
|
| 380 |
+
"special": true
|
| 381 |
+
},
|
| 382 |
+
"47": {
|
| 383 |
+
"content": "<mask_23>",
|
| 384 |
+
"lstrip": false,
|
| 385 |
+
"normalized": false,
|
| 386 |
+
"rstrip": false,
|
| 387 |
+
"single_word": false,
|
| 388 |
+
"special": true
|
| 389 |
+
},
|
| 390 |
+
"48": {
|
| 391 |
+
"content": "<mask_24>",
|
| 392 |
+
"lstrip": false,
|
| 393 |
+
"normalized": false,
|
| 394 |
+
"rstrip": false,
|
| 395 |
+
"single_word": false,
|
| 396 |
+
"special": true
|
| 397 |
+
},
|
| 398 |
+
"49": {
|
| 399 |
+
"content": "<mask_25>",
|
| 400 |
+
"lstrip": false,
|
| 401 |
+
"normalized": false,
|
| 402 |
+
"rstrip": false,
|
| 403 |
+
"single_word": false,
|
| 404 |
+
"special": true
|
| 405 |
+
},
|
| 406 |
+
"50": {
|
| 407 |
+
"content": "<mask_26>",
|
| 408 |
+
"lstrip": false,
|
| 409 |
+
"normalized": false,
|
| 410 |
+
"rstrip": false,
|
| 411 |
+
"single_word": false,
|
| 412 |
+
"special": true
|
| 413 |
+
},
|
| 414 |
+
"51": {
|
| 415 |
+
"content": "<mask_27>",
|
| 416 |
+
"lstrip": false,
|
| 417 |
+
"normalized": false,
|
| 418 |
+
"rstrip": false,
|
| 419 |
+
"single_word": false,
|
| 420 |
+
"special": true
|
| 421 |
+
},
|
| 422 |
+
"52": {
|
| 423 |
+
"content": "<mask_28>",
|
| 424 |
+
"lstrip": false,
|
| 425 |
+
"normalized": false,
|
| 426 |
+
"rstrip": false,
|
| 427 |
+
"single_word": false,
|
| 428 |
+
"special": true
|
| 429 |
+
},
|
| 430 |
+
"53": {
|
| 431 |
+
"content": "<mask_29>",
|
| 432 |
+
"lstrip": false,
|
| 433 |
+
"normalized": false,
|
| 434 |
+
"rstrip": false,
|
| 435 |
+
"single_word": false,
|
| 436 |
+
"special": true
|
| 437 |
+
},
|
| 438 |
+
"54": {
|
| 439 |
+
"content": "<mask_30>",
|
| 440 |
+
"lstrip": false,
|
| 441 |
+
"normalized": false,
|
| 442 |
+
"rstrip": false,
|
| 443 |
+
"single_word": false,
|
| 444 |
+
"special": true
|
| 445 |
+
},
|
| 446 |
+
"55": {
|
| 447 |
+
"content": "<mask_31>",
|
| 448 |
+
"lstrip": false,
|
| 449 |
+
"normalized": false,
|
| 450 |
+
"rstrip": false,
|
| 451 |
+
"single_word": false,
|
| 452 |
+
"special": true
|
| 453 |
+
},
|
| 454 |
+
"56": {
|
| 455 |
+
"content": "<mask_32>",
|
| 456 |
+
"lstrip": false,
|
| 457 |
+
"normalized": false,
|
| 458 |
+
"rstrip": false,
|
| 459 |
+
"single_word": false,
|
| 460 |
+
"special": true
|
| 461 |
+
},
|
| 462 |
+
"57": {
|
| 463 |
+
"content": "<mask_33>",
|
| 464 |
+
"lstrip": false,
|
| 465 |
+
"normalized": false,
|
| 466 |
+
"rstrip": false,
|
| 467 |
+
"single_word": false,
|
| 468 |
+
"special": true
|
| 469 |
+
},
|
| 470 |
+
"58": {
|
| 471 |
+
"content": "<mask_34>",
|
| 472 |
+
"lstrip": false,
|
| 473 |
+
"normalized": false,
|
| 474 |
+
"rstrip": false,
|
| 475 |
+
"single_word": false,
|
| 476 |
+
"special": true
|
| 477 |
+
},
|
| 478 |
+
"59": {
|
| 479 |
+
"content": "<mask_35>",
|
| 480 |
+
"lstrip": false,
|
| 481 |
+
"normalized": false,
|
| 482 |
+
"rstrip": false,
|
| 483 |
+
"single_word": false,
|
| 484 |
+
"special": true
|
| 485 |
+
},
|
| 486 |
+
"60": {
|
| 487 |
+
"content": "<mask_36>",
|
| 488 |
+
"lstrip": false,
|
| 489 |
+
"normalized": false,
|
| 490 |
+
"rstrip": false,
|
| 491 |
+
"single_word": false,
|
| 492 |
+
"special": true
|
| 493 |
+
},
|
| 494 |
+
"61": {
|
| 495 |
+
"content": "<mask_37>",
|
| 496 |
+
"lstrip": false,
|
| 497 |
+
"normalized": false,
|
| 498 |
+
"rstrip": false,
|
| 499 |
+
"single_word": false,
|
| 500 |
+
"special": true
|
| 501 |
+
},
|
| 502 |
+
"62": {
|
| 503 |
+
"content": "<mask_38>",
|
| 504 |
+
"lstrip": false,
|
| 505 |
+
"normalized": false,
|
| 506 |
+
"rstrip": false,
|
| 507 |
+
"single_word": false,
|
| 508 |
+
"special": true
|
| 509 |
+
},
|
| 510 |
+
"63": {
|
| 511 |
+
"content": "<mask_39>",
|
| 512 |
+
"lstrip": false,
|
| 513 |
+
"normalized": false,
|
| 514 |
+
"rstrip": false,
|
| 515 |
+
"single_word": false,
|
| 516 |
+
"special": true
|
| 517 |
+
},
|
| 518 |
+
"64": {
|
| 519 |
+
"content": "<mask_40>",
|
| 520 |
+
"lstrip": false,
|
| 521 |
+
"normalized": false,
|
| 522 |
+
"rstrip": false,
|
| 523 |
+
"single_word": false,
|
| 524 |
+
"special": true
|
| 525 |
+
},
|
| 526 |
+
"65": {
|
| 527 |
+
"content": "<mask_41>",
|
| 528 |
+
"lstrip": false,
|
| 529 |
+
"normalized": false,
|
| 530 |
+
"rstrip": false,
|
| 531 |
+
"single_word": false,
|
| 532 |
+
"special": true
|
| 533 |
+
},
|
| 534 |
+
"66": {
|
| 535 |
+
"content": "<mask_42>",
|
| 536 |
+
"lstrip": false,
|
| 537 |
+
"normalized": false,
|
| 538 |
+
"rstrip": false,
|
| 539 |
+
"single_word": false,
|
| 540 |
+
"special": true
|
| 541 |
+
},
|
| 542 |
+
"67": {
|
| 543 |
+
"content": "<mask_43>",
|
| 544 |
+
"lstrip": false,
|
| 545 |
+
"normalized": false,
|
| 546 |
+
"rstrip": false,
|
| 547 |
+
"single_word": false,
|
| 548 |
+
"special": true
|
| 549 |
+
},
|
| 550 |
+
"68": {
|
| 551 |
+
"content": "<mask_44>",
|
| 552 |
+
"lstrip": false,
|
| 553 |
+
"normalized": false,
|
| 554 |
+
"rstrip": false,
|
| 555 |
+
"single_word": false,
|
| 556 |
+
"special": true
|
| 557 |
+
},
|
| 558 |
+
"69": {
|
| 559 |
+
"content": "<mask_45>",
|
| 560 |
+
"lstrip": false,
|
| 561 |
+
"normalized": false,
|
| 562 |
+
"rstrip": false,
|
| 563 |
+
"single_word": false,
|
| 564 |
+
"special": true
|
| 565 |
+
},
|
| 566 |
+
"70": {
|
| 567 |
+
"content": "<mask_46>",
|
| 568 |
+
"lstrip": false,
|
| 569 |
+
"normalized": false,
|
| 570 |
+
"rstrip": false,
|
| 571 |
+
"single_word": false,
|
| 572 |
+
"special": true
|
| 573 |
+
},
|
| 574 |
+
"71": {
|
| 575 |
+
"content": "<mask_47>",
|
| 576 |
+
"lstrip": false,
|
| 577 |
+
"normalized": false,
|
| 578 |
+
"rstrip": false,
|
| 579 |
+
"single_word": false,
|
| 580 |
+
"special": true
|
| 581 |
+
},
|
| 582 |
+
"72": {
|
| 583 |
+
"content": "<mask_48>",
|
| 584 |
+
"lstrip": false,
|
| 585 |
+
"normalized": false,
|
| 586 |
+
"rstrip": false,
|
| 587 |
+
"single_word": false,
|
| 588 |
+
"special": true
|
| 589 |
+
},
|
| 590 |
+
"73": {
|
| 591 |
+
"content": "<mask_49>",
|
| 592 |
+
"lstrip": false,
|
| 593 |
+
"normalized": false,
|
| 594 |
+
"rstrip": false,
|
| 595 |
+
"single_word": false,
|
| 596 |
+
"special": true
|
| 597 |
+
},
|
| 598 |
+
"74": {
|
| 599 |
+
"content": "<mask_50>",
|
| 600 |
+
"lstrip": false,
|
| 601 |
+
"normalized": false,
|
| 602 |
+
"rstrip": false,
|
| 603 |
+
"single_word": false,
|
| 604 |
+
"special": true
|
| 605 |
+
},
|
| 606 |
+
"75": {
|
| 607 |
+
"content": "<mask_51>",
|
| 608 |
+
"lstrip": false,
|
| 609 |
+
"normalized": false,
|
| 610 |
+
"rstrip": false,
|
| 611 |
+
"single_word": false,
|
| 612 |
+
"special": true
|
| 613 |
+
},
|
| 614 |
+
"76": {
|
| 615 |
+
"content": "<mask_52>",
|
| 616 |
+
"lstrip": false,
|
| 617 |
+
"normalized": false,
|
| 618 |
+
"rstrip": false,
|
| 619 |
+
"single_word": false,
|
| 620 |
+
"special": true
|
| 621 |
+
},
|
| 622 |
+
"77": {
|
| 623 |
+
"content": "<mask_53>",
|
| 624 |
+
"lstrip": false,
|
| 625 |
+
"normalized": false,
|
| 626 |
+
"rstrip": false,
|
| 627 |
+
"single_word": false,
|
| 628 |
+
"special": true
|
| 629 |
+
},
|
| 630 |
+
"78": {
|
| 631 |
+
"content": "<mask_54>",
|
| 632 |
+
"lstrip": false,
|
| 633 |
+
"normalized": false,
|
| 634 |
+
"rstrip": false,
|
| 635 |
+
"single_word": false,
|
| 636 |
+
"special": true
|
| 637 |
+
},
|
| 638 |
+
"79": {
|
| 639 |
+
"content": "<mask_55>",
|
| 640 |
+
"lstrip": false,
|
| 641 |
+
"normalized": false,
|
| 642 |
+
"rstrip": false,
|
| 643 |
+
"single_word": false,
|
| 644 |
+
"special": true
|
| 645 |
+
},
|
| 646 |
+
"80": {
|
| 647 |
+
"content": "<mask_56>",
|
| 648 |
+
"lstrip": false,
|
| 649 |
+
"normalized": false,
|
| 650 |
+
"rstrip": false,
|
| 651 |
+
"single_word": false,
|
| 652 |
+
"special": true
|
| 653 |
+
},
|
| 654 |
+
"81": {
|
| 655 |
+
"content": "<mask_57>",
|
| 656 |
+
"lstrip": false,
|
| 657 |
+
"normalized": false,
|
| 658 |
+
"rstrip": false,
|
| 659 |
+
"single_word": false,
|
| 660 |
+
"special": true
|
| 661 |
+
},
|
| 662 |
+
"82": {
|
| 663 |
+
"content": "<mask_58>",
|
| 664 |
+
"lstrip": false,
|
| 665 |
+
"normalized": false,
|
| 666 |
+
"rstrip": false,
|
| 667 |
+
"single_word": false,
|
| 668 |
+
"special": true
|
| 669 |
+
},
|
| 670 |
+
"83": {
|
| 671 |
+
"content": "<mask_59>",
|
| 672 |
+
"lstrip": false,
|
| 673 |
+
"normalized": false,
|
| 674 |
+
"rstrip": false,
|
| 675 |
+
"single_word": false,
|
| 676 |
+
"special": true
|
| 677 |
+
},
|
| 678 |
+
"84": {
|
| 679 |
+
"content": "<mask_60>",
|
| 680 |
+
"lstrip": false,
|
| 681 |
+
"normalized": false,
|
| 682 |
+
"rstrip": false,
|
| 683 |
+
"single_word": false,
|
| 684 |
+
"special": true
|
| 685 |
+
},
|
| 686 |
+
"85": {
|
| 687 |
+
"content": "<mask_61>",
|
| 688 |
+
"lstrip": false,
|
| 689 |
+
"normalized": false,
|
| 690 |
+
"rstrip": false,
|
| 691 |
+
"single_word": false,
|
| 692 |
+
"special": true
|
| 693 |
+
},
|
| 694 |
+
"86": {
|
| 695 |
+
"content": "<mask_62>",
|
| 696 |
+
"lstrip": false,
|
| 697 |
+
"normalized": false,
|
| 698 |
+
"rstrip": false,
|
| 699 |
+
"single_word": false,
|
| 700 |
+
"special": true
|
| 701 |
+
},
|
| 702 |
+
"87": {
|
| 703 |
+
"content": "<mask_63>",
|
| 704 |
+
"lstrip": false,
|
| 705 |
+
"normalized": false,
|
| 706 |
+
"rstrip": false,
|
| 707 |
+
"single_word": false,
|
| 708 |
+
"special": true
|
| 709 |
+
},
|
| 710 |
+
"88": {
|
| 711 |
+
"content": "<mask_64>",
|
| 712 |
+
"lstrip": false,
|
| 713 |
+
"normalized": false,
|
| 714 |
+
"rstrip": false,
|
| 715 |
+
"single_word": false,
|
| 716 |
+
"special": true
|
| 717 |
+
},
|
| 718 |
+
"89": {
|
| 719 |
+
"content": "<mask_65>",
|
| 720 |
+
"lstrip": false,
|
| 721 |
+
"normalized": false,
|
| 722 |
+
"rstrip": false,
|
| 723 |
+
"single_word": false,
|
| 724 |
+
"special": true
|
| 725 |
+
},
|
| 726 |
+
"90": {
|
| 727 |
+
"content": "<mask_66>",
|
| 728 |
+
"lstrip": false,
|
| 729 |
+
"normalized": false,
|
| 730 |
+
"rstrip": false,
|
| 731 |
+
"single_word": false,
|
| 732 |
+
"special": true
|
| 733 |
+
},
|
| 734 |
+
"91": {
|
| 735 |
+
"content": "<mask_67>",
|
| 736 |
+
"lstrip": false,
|
| 737 |
+
"normalized": false,
|
| 738 |
+
"rstrip": false,
|
| 739 |
+
"single_word": false,
|
| 740 |
+
"special": true
|
| 741 |
+
},
|
| 742 |
+
"92": {
|
| 743 |
+
"content": "<mask_68>",
|
| 744 |
+
"lstrip": false,
|
| 745 |
+
"normalized": false,
|
| 746 |
+
"rstrip": false,
|
| 747 |
+
"single_word": false,
|
| 748 |
+
"special": true
|
| 749 |
+
},
|
| 750 |
+
"93": {
|
| 751 |
+
"content": "<mask_69>",
|
| 752 |
+
"lstrip": false,
|
| 753 |
+
"normalized": false,
|
| 754 |
+
"rstrip": false,
|
| 755 |
+
"single_word": false,
|
| 756 |
+
"special": true
|
| 757 |
+
},
|
| 758 |
+
"94": {
|
| 759 |
+
"content": "<mask_70>",
|
| 760 |
+
"lstrip": false,
|
| 761 |
+
"normalized": false,
|
| 762 |
+
"rstrip": false,
|
| 763 |
+
"single_word": false,
|
| 764 |
+
"special": true
|
| 765 |
+
},
|
| 766 |
+
"95": {
|
| 767 |
+
"content": "<mask_71>",
|
| 768 |
+
"lstrip": false,
|
| 769 |
+
"normalized": false,
|
| 770 |
+
"rstrip": false,
|
| 771 |
+
"single_word": false,
|
| 772 |
+
"special": true
|
| 773 |
+
},
|
| 774 |
+
"96": {
|
| 775 |
+
"content": "<mask_72>",
|
| 776 |
+
"lstrip": false,
|
| 777 |
+
"normalized": false,
|
| 778 |
+
"rstrip": false,
|
| 779 |
+
"single_word": false,
|
| 780 |
+
"special": true
|
| 781 |
+
},
|
| 782 |
+
"97": {
|
| 783 |
+
"content": "<mask_73>",
|
| 784 |
+
"lstrip": false,
|
| 785 |
+
"normalized": false,
|
| 786 |
+
"rstrip": false,
|
| 787 |
+
"single_word": false,
|
| 788 |
+
"special": true
|
| 789 |
+
},
|
| 790 |
+
"98": {
|
| 791 |
+
"content": "<mask_74>",
|
| 792 |
+
"lstrip": false,
|
| 793 |
+
"normalized": false,
|
| 794 |
+
"rstrip": false,
|
| 795 |
+
"single_word": false,
|
| 796 |
+
"special": true
|
| 797 |
+
},
|
| 798 |
+
"99": {
|
| 799 |
+
"content": "<mask_75>",
|
| 800 |
+
"lstrip": false,
|
| 801 |
+
"normalized": false,
|
| 802 |
+
"rstrip": false,
|
| 803 |
+
"single_word": false,
|
| 804 |
+
"special": true
|
| 805 |
+
},
|
| 806 |
+
"100": {
|
| 807 |
+
"content": "<mask_76>",
|
| 808 |
+
"lstrip": false,
|
| 809 |
+
"normalized": false,
|
| 810 |
+
"rstrip": false,
|
| 811 |
+
"single_word": false,
|
| 812 |
+
"special": true
|
| 813 |
+
},
|
| 814 |
+
"101": {
|
| 815 |
+
"content": "<mask_77>",
|
| 816 |
+
"lstrip": false,
|
| 817 |
+
"normalized": false,
|
| 818 |
+
"rstrip": false,
|
| 819 |
+
"single_word": false,
|
| 820 |
+
"special": true
|
| 821 |
+
},
|
| 822 |
+
"102": {
|
| 823 |
+
"content": "<mask_78>",
|
| 824 |
+
"lstrip": false,
|
| 825 |
+
"normalized": false,
|
| 826 |
+
"rstrip": false,
|
| 827 |
+
"single_word": false,
|
| 828 |
+
"special": true
|
| 829 |
+
},
|
| 830 |
+
"103": {
|
| 831 |
+
"content": "<mask_79>",
|
| 832 |
+
"lstrip": false,
|
| 833 |
+
"normalized": false,
|
| 834 |
+
"rstrip": false,
|
| 835 |
+
"single_word": false,
|
| 836 |
+
"special": true
|
| 837 |
+
},
|
| 838 |
+
"104": {
|
| 839 |
+
"content": "<mask_80>",
|
| 840 |
+
"lstrip": false,
|
| 841 |
+
"normalized": false,
|
| 842 |
+
"rstrip": false,
|
| 843 |
+
"single_word": false,
|
| 844 |
+
"special": true
|
| 845 |
+
},
|
| 846 |
+
"105": {
|
| 847 |
+
"content": "<mask_81>",
|
| 848 |
+
"lstrip": false,
|
| 849 |
+
"normalized": false,
|
| 850 |
+
"rstrip": false,
|
| 851 |
+
"single_word": false,
|
| 852 |
+
"special": true
|
| 853 |
+
},
|
| 854 |
+
"106": {
|
| 855 |
+
"content": "<mask_82>",
|
| 856 |
+
"lstrip": false,
|
| 857 |
+
"normalized": false,
|
| 858 |
+
"rstrip": false,
|
| 859 |
+
"single_word": false,
|
| 860 |
+
"special": true
|
| 861 |
+
},
|
| 862 |
+
"107": {
|
| 863 |
+
"content": "<mask_83>",
|
| 864 |
+
"lstrip": false,
|
| 865 |
+
"normalized": false,
|
| 866 |
+
"rstrip": false,
|
| 867 |
+
"single_word": false,
|
| 868 |
+
"special": true
|
| 869 |
+
},
|
| 870 |
+
"108": {
|
| 871 |
+
"content": "<mask_84>",
|
| 872 |
+
"lstrip": false,
|
| 873 |
+
"normalized": false,
|
| 874 |
+
"rstrip": false,
|
| 875 |
+
"single_word": false,
|
| 876 |
+
"special": true
|
| 877 |
+
},
|
| 878 |
+
"109": {
|
| 879 |
+
"content": "<mask_85>",
|
| 880 |
+
"lstrip": false,
|
| 881 |
+
"normalized": false,
|
| 882 |
+
"rstrip": false,
|
| 883 |
+
"single_word": false,
|
| 884 |
+
"special": true
|
| 885 |
+
},
|
| 886 |
+
"110": {
|
| 887 |
+
"content": "<mask_86>",
|
| 888 |
+
"lstrip": false,
|
| 889 |
+
"normalized": false,
|
| 890 |
+
"rstrip": false,
|
| 891 |
+
"single_word": false,
|
| 892 |
+
"special": true
|
| 893 |
+
},
|
| 894 |
+
"111": {
|
| 895 |
+
"content": "<mask_87>",
|
| 896 |
+
"lstrip": false,
|
| 897 |
+
"normalized": false,
|
| 898 |
+
"rstrip": false,
|
| 899 |
+
"single_word": false,
|
| 900 |
+
"special": true
|
| 901 |
+
},
|
| 902 |
+
"112": {
|
| 903 |
+
"content": "<mask_88>",
|
| 904 |
+
"lstrip": false,
|
| 905 |
+
"normalized": false,
|
| 906 |
+
"rstrip": false,
|
| 907 |
+
"single_word": false,
|
| 908 |
+
"special": true
|
| 909 |
+
},
|
| 910 |
+
"113": {
|
| 911 |
+
"content": "<mask_89>",
|
| 912 |
+
"lstrip": false,
|
| 913 |
+
"normalized": false,
|
| 914 |
+
"rstrip": false,
|
| 915 |
+
"single_word": false,
|
| 916 |
+
"special": true
|
| 917 |
+
},
|
| 918 |
+
"114": {
|
| 919 |
+
"content": "<mask_90>",
|
| 920 |
+
"lstrip": false,
|
| 921 |
+
"normalized": false,
|
| 922 |
+
"rstrip": false,
|
| 923 |
+
"single_word": false,
|
| 924 |
+
"special": true
|
| 925 |
+
},
|
| 926 |
+
"115": {
|
| 927 |
+
"content": "<mask_91>",
|
| 928 |
+
"lstrip": false,
|
| 929 |
+
"normalized": false,
|
| 930 |
+
"rstrip": false,
|
| 931 |
+
"single_word": false,
|
| 932 |
+
"special": true
|
| 933 |
+
},
|
| 934 |
+
"116": {
|
| 935 |
+
"content": "<mask_92>",
|
| 936 |
+
"lstrip": false,
|
| 937 |
+
"normalized": false,
|
| 938 |
+
"rstrip": false,
|
| 939 |
+
"single_word": false,
|
| 940 |
+
"special": true
|
| 941 |
+
},
|
| 942 |
+
"117": {
|
| 943 |
+
"content": "<mask_93>",
|
| 944 |
+
"lstrip": false,
|
| 945 |
+
"normalized": false,
|
| 946 |
+
"rstrip": false,
|
| 947 |
+
"single_word": false,
|
| 948 |
+
"special": true
|
| 949 |
+
},
|
| 950 |
+
"118": {
|
| 951 |
+
"content": "<mask_94>",
|
| 952 |
+
"lstrip": false,
|
| 953 |
+
"normalized": false,
|
| 954 |
+
"rstrip": false,
|
| 955 |
+
"single_word": false,
|
| 956 |
+
"special": true
|
| 957 |
+
},
|
| 958 |
+
"119": {
|
| 959 |
+
"content": "<mask_95>",
|
| 960 |
+
"lstrip": false,
|
| 961 |
+
"normalized": false,
|
| 962 |
+
"rstrip": false,
|
| 963 |
+
"single_word": false,
|
| 964 |
+
"special": true
|
| 965 |
+
},
|
| 966 |
+
"120": {
|
| 967 |
+
"content": "<mask_96>",
|
| 968 |
+
"lstrip": false,
|
| 969 |
+
"normalized": false,
|
| 970 |
+
"rstrip": false,
|
| 971 |
+
"single_word": false,
|
| 972 |
+
"special": true
|
| 973 |
+
},
|
| 974 |
+
"121": {
|
| 975 |
+
"content": "<mask_97>",
|
| 976 |
+
"lstrip": false,
|
| 977 |
+
"normalized": false,
|
| 978 |
+
"rstrip": false,
|
| 979 |
+
"single_word": false,
|
| 980 |
+
"special": true
|
| 981 |
+
},
|
| 982 |
+
"122": {
|
| 983 |
+
"content": "<mask_98>",
|
| 984 |
+
"lstrip": false,
|
| 985 |
+
"normalized": false,
|
| 986 |
+
"rstrip": false,
|
| 987 |
+
"single_word": false,
|
| 988 |
+
"special": true
|
| 989 |
+
},
|
| 990 |
+
"123": {
|
| 991 |
+
"content": "<mask_99>",
|
| 992 |
+
"lstrip": false,
|
| 993 |
+
"normalized": false,
|
| 994 |
+
"rstrip": false,
|
| 995 |
+
"single_word": false,
|
| 996 |
+
"special": true
|
| 997 |
+
},
|
| 998 |
+
"124": {
|
| 999 |
+
"content": "<mask_100>",
|
| 1000 |
+
"lstrip": false,
|
| 1001 |
+
"normalized": false,
|
| 1002 |
+
"rstrip": false,
|
| 1003 |
+
"single_word": false,
|
| 1004 |
+
"special": true
|
| 1005 |
+
},
|
| 1006 |
+
"125": {
|
| 1007 |
+
"content": "<mask_101>",
|
| 1008 |
+
"lstrip": false,
|
| 1009 |
+
"normalized": false,
|
| 1010 |
+
"rstrip": false,
|
| 1011 |
+
"single_word": false,
|
| 1012 |
+
"special": true
|
| 1013 |
+
},
|
| 1014 |
+
"126": {
|
| 1015 |
+
"content": "<mask_102>",
|
| 1016 |
+
"lstrip": false,
|
| 1017 |
+
"normalized": false,
|
| 1018 |
+
"rstrip": false,
|
| 1019 |
+
"single_word": false,
|
| 1020 |
+
"special": true
|
| 1021 |
+
},
|
| 1022 |
+
"127": {
|
| 1023 |
+
"content": "<mask_103>",
|
| 1024 |
+
"lstrip": false,
|
| 1025 |
+
"normalized": false,
|
| 1026 |
+
"rstrip": false,
|
| 1027 |
+
"single_word": false,
|
| 1028 |
+
"special": true
|
| 1029 |
+
},
|
| 1030 |
+
"128": {
|
| 1031 |
+
"content": "<mask_104>",
|
| 1032 |
+
"lstrip": false,
|
| 1033 |
+
"normalized": false,
|
| 1034 |
+
"rstrip": false,
|
| 1035 |
+
"single_word": false,
|
| 1036 |
+
"special": true
|
| 1037 |
+
},
|
| 1038 |
+
"129": {
|
| 1039 |
+
"content": "<mask_105>",
|
| 1040 |
+
"lstrip": false,
|
| 1041 |
+
"normalized": false,
|
| 1042 |
+
"rstrip": false,
|
| 1043 |
+
"single_word": false,
|
| 1044 |
+
"special": true
|
| 1045 |
+
},
|
| 1046 |
+
"130": {
|
| 1047 |
+
"content": "<mask_106>",
|
| 1048 |
+
"lstrip": false,
|
| 1049 |
+
"normalized": false,
|
| 1050 |
+
"rstrip": false,
|
| 1051 |
+
"single_word": false,
|
| 1052 |
+
"special": true
|
| 1053 |
+
},
|
| 1054 |
+
"131": {
|
| 1055 |
+
"content": "<mask_107>",
|
| 1056 |
+
"lstrip": false,
|
| 1057 |
+
"normalized": false,
|
| 1058 |
+
"rstrip": false,
|
| 1059 |
+
"single_word": false,
|
| 1060 |
+
"special": true
|
| 1061 |
+
},
|
| 1062 |
+
"132": {
|
| 1063 |
+
"content": "<mask_108>",
|
| 1064 |
+
"lstrip": false,
|
| 1065 |
+
"normalized": false,
|
| 1066 |
+
"rstrip": false,
|
| 1067 |
+
"single_word": false,
|
| 1068 |
+
"special": true
|
| 1069 |
+
},
|
| 1070 |
+
"133": {
|
| 1071 |
+
"content": "<mask_109>",
|
| 1072 |
+
"lstrip": false,
|
| 1073 |
+
"normalized": false,
|
| 1074 |
+
"rstrip": false,
|
| 1075 |
+
"single_word": false,
|
| 1076 |
+
"special": true
|
| 1077 |
+
},
|
| 1078 |
+
"134": {
|
| 1079 |
+
"content": "<mask_110>",
|
| 1080 |
+
"lstrip": false,
|
| 1081 |
+
"normalized": false,
|
| 1082 |
+
"rstrip": false,
|
| 1083 |
+
"single_word": false,
|
| 1084 |
+
"special": true
|
| 1085 |
+
},
|
| 1086 |
+
"135": {
|
| 1087 |
+
"content": "<mask_111>",
|
| 1088 |
+
"lstrip": false,
|
| 1089 |
+
"normalized": false,
|
| 1090 |
+
"rstrip": false,
|
| 1091 |
+
"single_word": false,
|
| 1092 |
+
"special": true
|
| 1093 |
+
},
|
| 1094 |
+
"136": {
|
| 1095 |
+
"content": "<mask_112>",
|
| 1096 |
+
"lstrip": false,
|
| 1097 |
+
"normalized": false,
|
| 1098 |
+
"rstrip": false,
|
| 1099 |
+
"single_word": false,
|
| 1100 |
+
"special": true
|
| 1101 |
+
},
|
| 1102 |
+
"137": {
|
| 1103 |
+
"content": "<mask_113>",
|
| 1104 |
+
"lstrip": false,
|
| 1105 |
+
"normalized": false,
|
| 1106 |
+
"rstrip": false,
|
| 1107 |
+
"single_word": false,
|
| 1108 |
+
"special": true
|
| 1109 |
+
},
|
| 1110 |
+
"138": {
|
| 1111 |
+
"content": "<mask_114>",
|
| 1112 |
+
"lstrip": false,
|
| 1113 |
+
"normalized": false,
|
| 1114 |
+
"rstrip": false,
|
| 1115 |
+
"single_word": false,
|
| 1116 |
+
"special": true
|
| 1117 |
+
},
|
| 1118 |
+
"139": {
|
| 1119 |
+
"content": "<mask_115>",
|
| 1120 |
+
"lstrip": false,
|
| 1121 |
+
"normalized": false,
|
| 1122 |
+
"rstrip": false,
|
| 1123 |
+
"single_word": false,
|
| 1124 |
+
"special": true
|
| 1125 |
+
},
|
| 1126 |
+
"140": {
|
| 1127 |
+
"content": "<mask_116>",
|
| 1128 |
+
"lstrip": false,
|
| 1129 |
+
"normalized": false,
|
| 1130 |
+
"rstrip": false,
|
| 1131 |
+
"single_word": false,
|
| 1132 |
+
"special": true
|
| 1133 |
+
},
|
| 1134 |
+
"141": {
|
| 1135 |
+
"content": "<mask_117>",
|
| 1136 |
+
"lstrip": false,
|
| 1137 |
+
"normalized": false,
|
| 1138 |
+
"rstrip": false,
|
| 1139 |
+
"single_word": false,
|
| 1140 |
+
"special": true
|
| 1141 |
+
},
|
| 1142 |
+
"142": {
|
| 1143 |
+
"content": "<mask_118>",
|
| 1144 |
+
"lstrip": false,
|
| 1145 |
+
"normalized": false,
|
| 1146 |
+
"rstrip": false,
|
| 1147 |
+
"single_word": false,
|
| 1148 |
+
"special": true
|
| 1149 |
+
},
|
| 1150 |
+
"143": {
|
| 1151 |
+
"content": "<mask_119>",
|
| 1152 |
+
"lstrip": false,
|
| 1153 |
+
"normalized": false,
|
| 1154 |
+
"rstrip": false,
|
| 1155 |
+
"single_word": false,
|
| 1156 |
+
"special": true
|
| 1157 |
+
},
|
| 1158 |
+
"144": {
|
| 1159 |
+
"content": "<mask_120>",
|
| 1160 |
+
"lstrip": false,
|
| 1161 |
+
"normalized": false,
|
| 1162 |
+
"rstrip": false,
|
| 1163 |
+
"single_word": false,
|
| 1164 |
+
"special": true
|
| 1165 |
+
},
|
| 1166 |
+
"145": {
|
| 1167 |
+
"content": "<mask_121>",
|
| 1168 |
+
"lstrip": false,
|
| 1169 |
+
"normalized": false,
|
| 1170 |
+
"rstrip": false,
|
| 1171 |
+
"single_word": false,
|
| 1172 |
+
"special": true
|
| 1173 |
+
},
|
| 1174 |
+
"146": {
|
| 1175 |
+
"content": "<mask_122>",
|
| 1176 |
+
"lstrip": false,
|
| 1177 |
+
"normalized": false,
|
| 1178 |
+
"rstrip": false,
|
| 1179 |
+
"single_word": false,
|
| 1180 |
+
"special": true
|
| 1181 |
+
},
|
| 1182 |
+
"147": {
|
| 1183 |
+
"content": "<mask_123>",
|
| 1184 |
+
"lstrip": false,
|
| 1185 |
+
"normalized": false,
|
| 1186 |
+
"rstrip": false,
|
| 1187 |
+
"single_word": false,
|
| 1188 |
+
"special": true
|
| 1189 |
+
},
|
| 1190 |
+
"148": {
|
| 1191 |
+
"content": "<mask_124>",
|
| 1192 |
+
"lstrip": false,
|
| 1193 |
+
"normalized": false,
|
| 1194 |
+
"rstrip": false,
|
| 1195 |
+
"single_word": false,
|
| 1196 |
+
"special": true
|
| 1197 |
+
},
|
| 1198 |
+
"149": {
|
| 1199 |
+
"content": "<mask_125>",
|
| 1200 |
+
"lstrip": false,
|
| 1201 |
+
"normalized": false,
|
| 1202 |
+
"rstrip": false,
|
| 1203 |
+
"single_word": false,
|
| 1204 |
+
"special": true
|
| 1205 |
+
},
|
| 1206 |
+
"150": {
|
| 1207 |
+
"content": "<mask_126>",
|
| 1208 |
+
"lstrip": false,
|
| 1209 |
+
"normalized": false,
|
| 1210 |
+
"rstrip": false,
|
| 1211 |
+
"single_word": false,
|
| 1212 |
+
"special": true
|
| 1213 |
+
},
|
| 1214 |
+
"151": {
|
| 1215 |
+
"content": "<mask_127>",
|
| 1216 |
+
"lstrip": false,
|
| 1217 |
+
"normalized": false,
|
| 1218 |
+
"rstrip": false,
|
| 1219 |
+
"single_word": false,
|
| 1220 |
+
"special": true
|
| 1221 |
+
},
|
| 1222 |
+
"152": {
|
| 1223 |
+
"content": "<mask_128>",
|
| 1224 |
+
"lstrip": false,
|
| 1225 |
+
"normalized": false,
|
| 1226 |
+
"rstrip": false,
|
| 1227 |
+
"single_word": false,
|
| 1228 |
+
"special": true
|
| 1229 |
+
},
|
| 1230 |
+
"153": {
|
| 1231 |
+
"content": "<mask_129>",
|
| 1232 |
+
"lstrip": false,
|
| 1233 |
+
"normalized": false,
|
| 1234 |
+
"rstrip": false,
|
| 1235 |
+
"single_word": false,
|
| 1236 |
+
"special": true
|
| 1237 |
+
},
|
| 1238 |
+
"154": {
|
| 1239 |
+
"content": "<mask_130>",
|
| 1240 |
+
"lstrip": false,
|
| 1241 |
+
"normalized": false,
|
| 1242 |
+
"rstrip": false,
|
| 1243 |
+
"single_word": false,
|
| 1244 |
+
"special": true
|
| 1245 |
+
},
|
| 1246 |
+
"155": {
|
| 1247 |
+
"content": "<mask_131>",
|
| 1248 |
+
"lstrip": false,
|
| 1249 |
+
"normalized": false,
|
| 1250 |
+
"rstrip": false,
|
| 1251 |
+
"single_word": false,
|
| 1252 |
+
"special": true
|
| 1253 |
+
},
|
| 1254 |
+
"156": {
|
| 1255 |
+
"content": "<mask_132>",
|
| 1256 |
+
"lstrip": false,
|
| 1257 |
+
"normalized": false,
|
| 1258 |
+
"rstrip": false,
|
| 1259 |
+
"single_word": false,
|
| 1260 |
+
"special": true
|
| 1261 |
+
},
|
| 1262 |
+
"157": {
|
| 1263 |
+
"content": "<mask_133>",
|
| 1264 |
+
"lstrip": false,
|
| 1265 |
+
"normalized": false,
|
| 1266 |
+
"rstrip": false,
|
| 1267 |
+
"single_word": false,
|
| 1268 |
+
"special": true
|
| 1269 |
+
},
|
| 1270 |
+
"158": {
|
| 1271 |
+
"content": "<mask_134>",
|
| 1272 |
+
"lstrip": false,
|
| 1273 |
+
"normalized": false,
|
| 1274 |
+
"rstrip": false,
|
| 1275 |
+
"single_word": false,
|
| 1276 |
+
"special": true
|
| 1277 |
+
},
|
| 1278 |
+
"159": {
|
| 1279 |
+
"content": "<mask_135>",
|
| 1280 |
+
"lstrip": false,
|
| 1281 |
+
"normalized": false,
|
| 1282 |
+
"rstrip": false,
|
| 1283 |
+
"single_word": false,
|
| 1284 |
+
"special": true
|
| 1285 |
+
},
|
| 1286 |
+
"160": {
|
| 1287 |
+
"content": "<mask_136>",
|
| 1288 |
+
"lstrip": false,
|
| 1289 |
+
"normalized": false,
|
| 1290 |
+
"rstrip": false,
|
| 1291 |
+
"single_word": false,
|
| 1292 |
+
"special": true
|
| 1293 |
+
},
|
| 1294 |
+
"161": {
|
| 1295 |
+
"content": "<mask_137>",
|
| 1296 |
+
"lstrip": false,
|
| 1297 |
+
"normalized": false,
|
| 1298 |
+
"rstrip": false,
|
| 1299 |
+
"single_word": false,
|
| 1300 |
+
"special": true
|
| 1301 |
+
},
|
| 1302 |
+
"162": {
|
| 1303 |
+
"content": "<mask_138>",
|
| 1304 |
+
"lstrip": false,
|
| 1305 |
+
"normalized": false,
|
| 1306 |
+
"rstrip": false,
|
| 1307 |
+
"single_word": false,
|
| 1308 |
+
"special": true
|
| 1309 |
+
},
|
| 1310 |
+
"163": {
|
| 1311 |
+
"content": "<mask_139>",
|
| 1312 |
+
"lstrip": false,
|
| 1313 |
+
"normalized": false,
|
| 1314 |
+
"rstrip": false,
|
| 1315 |
+
"single_word": false,
|
| 1316 |
+
"special": true
|
| 1317 |
+
},
|
| 1318 |
+
"164": {
|
| 1319 |
+
"content": "<mask_140>",
|
| 1320 |
+
"lstrip": false,
|
| 1321 |
+
"normalized": false,
|
| 1322 |
+
"rstrip": false,
|
| 1323 |
+
"single_word": false,
|
| 1324 |
+
"special": true
|
| 1325 |
+
},
|
| 1326 |
+
"165": {
|
| 1327 |
+
"content": "<mask_141>",
|
| 1328 |
+
"lstrip": false,
|
| 1329 |
+
"normalized": false,
|
| 1330 |
+
"rstrip": false,
|
| 1331 |
+
"single_word": false,
|
| 1332 |
+
"special": true
|
| 1333 |
+
},
|
| 1334 |
+
"166": {
|
| 1335 |
+
"content": "<mask_142>",
|
| 1336 |
+
"lstrip": false,
|
| 1337 |
+
"normalized": false,
|
| 1338 |
+
"rstrip": false,
|
| 1339 |
+
"single_word": false,
|
| 1340 |
+
"special": true
|
| 1341 |
+
},
|
| 1342 |
+
"167": {
|
| 1343 |
+
"content": "<mask_143>",
|
| 1344 |
+
"lstrip": false,
|
| 1345 |
+
"normalized": false,
|
| 1346 |
+
"rstrip": false,
|
| 1347 |
+
"single_word": false,
|
| 1348 |
+
"special": true
|
| 1349 |
+
},
|
| 1350 |
+
"168": {
|
| 1351 |
+
"content": "<mask_144>",
|
| 1352 |
+
"lstrip": false,
|
| 1353 |
+
"normalized": false,
|
| 1354 |
+
"rstrip": false,
|
| 1355 |
+
"single_word": false,
|
| 1356 |
+
"special": true
|
| 1357 |
+
},
|
| 1358 |
+
"169": {
|
| 1359 |
+
"content": "<mask_145>",
|
| 1360 |
+
"lstrip": false,
|
| 1361 |
+
"normalized": false,
|
| 1362 |
+
"rstrip": false,
|
| 1363 |
+
"single_word": false,
|
| 1364 |
+
"special": true
|
| 1365 |
+
},
|
| 1366 |
+
"170": {
|
| 1367 |
+
"content": "<mask_146>",
|
| 1368 |
+
"lstrip": false,
|
| 1369 |
+
"normalized": false,
|
| 1370 |
+
"rstrip": false,
|
| 1371 |
+
"single_word": false,
|
| 1372 |
+
"special": true
|
| 1373 |
+
},
|
| 1374 |
+
"171": {
|
| 1375 |
+
"content": "<mask_147>",
|
| 1376 |
+
"lstrip": false,
|
| 1377 |
+
"normalized": false,
|
| 1378 |
+
"rstrip": false,
|
| 1379 |
+
"single_word": false,
|
| 1380 |
+
"special": true
|
| 1381 |
+
},
|
| 1382 |
+
"172": {
|
| 1383 |
+
"content": "<mask_148>",
|
| 1384 |
+
"lstrip": false,
|
| 1385 |
+
"normalized": false,
|
| 1386 |
+
"rstrip": false,
|
| 1387 |
+
"single_word": false,
|
| 1388 |
+
"special": true
|
| 1389 |
+
},
|
| 1390 |
+
"173": {
|
| 1391 |
+
"content": "<mask_149>",
|
| 1392 |
+
"lstrip": false,
|
| 1393 |
+
"normalized": false,
|
| 1394 |
+
"rstrip": false,
|
| 1395 |
+
"single_word": false,
|
| 1396 |
+
"special": true
|
| 1397 |
+
},
|
| 1398 |
+
"174": {
|
| 1399 |
+
"content": "<mask_150>",
|
| 1400 |
+
"lstrip": false,
|
| 1401 |
+
"normalized": false,
|
| 1402 |
+
"rstrip": false,
|
| 1403 |
+
"single_word": false,
|
| 1404 |
+
"special": true
|
| 1405 |
+
},
|
| 1406 |
+
"175": {
|
| 1407 |
+
"content": "<mask_151>",
|
| 1408 |
+
"lstrip": false,
|
| 1409 |
+
"normalized": false,
|
| 1410 |
+
"rstrip": false,
|
| 1411 |
+
"single_word": false,
|
| 1412 |
+
"special": true
|
| 1413 |
+
},
|
| 1414 |
+
"176": {
|
| 1415 |
+
"content": "<mask_152>",
|
| 1416 |
+
"lstrip": false,
|
| 1417 |
+
"normalized": false,
|
| 1418 |
+
"rstrip": false,
|
| 1419 |
+
"single_word": false,
|
| 1420 |
+
"special": true
|
| 1421 |
+
},
|
| 1422 |
+
"177": {
|
| 1423 |
+
"content": "<mask_153>",
|
| 1424 |
+
"lstrip": false,
|
| 1425 |
+
"normalized": false,
|
| 1426 |
+
"rstrip": false,
|
| 1427 |
+
"single_word": false,
|
| 1428 |
+
"special": true
|
| 1429 |
+
},
|
| 1430 |
+
"178": {
|
| 1431 |
+
"content": "<mask_154>",
|
| 1432 |
+
"lstrip": false,
|
| 1433 |
+
"normalized": false,
|
| 1434 |
+
"rstrip": false,
|
| 1435 |
+
"single_word": false,
|
| 1436 |
+
"special": true
|
| 1437 |
+
},
|
| 1438 |
+
"179": {
|
| 1439 |
+
"content": "<mask_155>",
|
| 1440 |
+
"lstrip": false,
|
| 1441 |
+
"normalized": false,
|
| 1442 |
+
"rstrip": false,
|
| 1443 |
+
"single_word": false,
|
| 1444 |
+
"special": true
|
| 1445 |
+
},
|
| 1446 |
+
"180": {
|
| 1447 |
+
"content": "<mask_156>",
|
| 1448 |
+
"lstrip": false,
|
| 1449 |
+
"normalized": false,
|
| 1450 |
+
"rstrip": false,
|
| 1451 |
+
"single_word": false,
|
| 1452 |
+
"special": true
|
| 1453 |
+
},
|
| 1454 |
+
"181": {
|
| 1455 |
+
"content": "<mask_157>",
|
| 1456 |
+
"lstrip": false,
|
| 1457 |
+
"normalized": false,
|
| 1458 |
+
"rstrip": false,
|
| 1459 |
+
"single_word": false,
|
| 1460 |
+
"special": true
|
| 1461 |
+
},
|
| 1462 |
+
"182": {
|
| 1463 |
+
"content": "<mask_158>",
|
| 1464 |
+
"lstrip": false,
|
| 1465 |
+
"normalized": false,
|
| 1466 |
+
"rstrip": false,
|
| 1467 |
+
"single_word": false,
|
| 1468 |
+
"special": true
|
| 1469 |
+
},
|
| 1470 |
+
"183": {
|
| 1471 |
+
"content": "<mask_159>",
|
| 1472 |
+
"lstrip": false,
|
| 1473 |
+
"normalized": false,
|
| 1474 |
+
"rstrip": false,
|
| 1475 |
+
"single_word": false,
|
| 1476 |
+
"special": true
|
| 1477 |
+
},
|
| 1478 |
+
"184": {
|
| 1479 |
+
"content": "<mask_160>",
|
| 1480 |
+
"lstrip": false,
|
| 1481 |
+
"normalized": false,
|
| 1482 |
+
"rstrip": false,
|
| 1483 |
+
"single_word": false,
|
| 1484 |
+
"special": true
|
| 1485 |
+
},
|
| 1486 |
+
"185": {
|
| 1487 |
+
"content": "<mask_161>",
|
| 1488 |
+
"lstrip": false,
|
| 1489 |
+
"normalized": false,
|
| 1490 |
+
"rstrip": false,
|
| 1491 |
+
"single_word": false,
|
| 1492 |
+
"special": true
|
| 1493 |
+
},
|
| 1494 |
+
"186": {
|
| 1495 |
+
"content": "<mask_162>",
|
| 1496 |
+
"lstrip": false,
|
| 1497 |
+
"normalized": false,
|
| 1498 |
+
"rstrip": false,
|
| 1499 |
+
"single_word": false,
|
| 1500 |
+
"special": true
|
| 1501 |
+
},
|
| 1502 |
+
"187": {
|
| 1503 |
+
"content": "<mask_163>",
|
| 1504 |
+
"lstrip": false,
|
| 1505 |
+
"normalized": false,
|
| 1506 |
+
"rstrip": false,
|
| 1507 |
+
"single_word": false,
|
| 1508 |
+
"special": true
|
| 1509 |
+
},
|
| 1510 |
+
"188": {
|
| 1511 |
+
"content": "<mask_164>",
|
| 1512 |
+
"lstrip": false,
|
| 1513 |
+
"normalized": false,
|
| 1514 |
+
"rstrip": false,
|
| 1515 |
+
"single_word": false,
|
| 1516 |
+
"special": true
|
| 1517 |
+
},
|
| 1518 |
+
"189": {
|
| 1519 |
+
"content": "<mask_165>",
|
| 1520 |
+
"lstrip": false,
|
| 1521 |
+
"normalized": false,
|
| 1522 |
+
"rstrip": false,
|
| 1523 |
+
"single_word": false,
|
| 1524 |
+
"special": true
|
| 1525 |
+
},
|
| 1526 |
+
"190": {
|
| 1527 |
+
"content": "<mask_166>",
|
| 1528 |
+
"lstrip": false,
|
| 1529 |
+
"normalized": false,
|
| 1530 |
+
"rstrip": false,
|
| 1531 |
+
"single_word": false,
|
| 1532 |
+
"special": true
|
| 1533 |
+
},
|
| 1534 |
+
"191": {
|
| 1535 |
+
"content": "<mask_167>",
|
| 1536 |
+
"lstrip": false,
|
| 1537 |
+
"normalized": false,
|
| 1538 |
+
"rstrip": false,
|
| 1539 |
+
"single_word": false,
|
| 1540 |
+
"special": true
|
| 1541 |
+
},
|
| 1542 |
+
"192": {
|
| 1543 |
+
"content": "<mask_168>",
|
| 1544 |
+
"lstrip": false,
|
| 1545 |
+
"normalized": false,
|
| 1546 |
+
"rstrip": false,
|
| 1547 |
+
"single_word": false,
|
| 1548 |
+
"special": true
|
| 1549 |
+
},
|
| 1550 |
+
"193": {
|
| 1551 |
+
"content": "<mask_169>",
|
| 1552 |
+
"lstrip": false,
|
| 1553 |
+
"normalized": false,
|
| 1554 |
+
"rstrip": false,
|
| 1555 |
+
"single_word": false,
|
| 1556 |
+
"special": true
|
| 1557 |
+
},
|
| 1558 |
+
"194": {
|
| 1559 |
+
"content": "<mask_170>",
|
| 1560 |
+
"lstrip": false,
|
| 1561 |
+
"normalized": false,
|
| 1562 |
+
"rstrip": false,
|
| 1563 |
+
"single_word": false,
|
| 1564 |
+
"special": true
|
| 1565 |
+
},
|
| 1566 |
+
"195": {
|
| 1567 |
+
"content": "<mask_171>",
|
| 1568 |
+
"lstrip": false,
|
| 1569 |
+
"normalized": false,
|
| 1570 |
+
"rstrip": false,
|
| 1571 |
+
"single_word": false,
|
| 1572 |
+
"special": true
|
| 1573 |
+
},
|
| 1574 |
+
"196": {
|
| 1575 |
+
"content": "<mask_172>",
|
| 1576 |
+
"lstrip": false,
|
| 1577 |
+
"normalized": false,
|
| 1578 |
+
"rstrip": false,
|
| 1579 |
+
"single_word": false,
|
| 1580 |
+
"special": true
|
| 1581 |
+
},
|
| 1582 |
+
"197": {
|
| 1583 |
+
"content": "<mask_173>",
|
| 1584 |
+
"lstrip": false,
|
| 1585 |
+
"normalized": false,
|
| 1586 |
+
"rstrip": false,
|
| 1587 |
+
"single_word": false,
|
| 1588 |
+
"special": true
|
| 1589 |
+
},
|
| 1590 |
+
"198": {
|
| 1591 |
+
"content": "<mask_174>",
|
| 1592 |
+
"lstrip": false,
|
| 1593 |
+
"normalized": false,
|
| 1594 |
+
"rstrip": false,
|
| 1595 |
+
"single_word": false,
|
| 1596 |
+
"special": true
|
| 1597 |
+
},
|
| 1598 |
+
"199": {
|
| 1599 |
+
"content": "<mask_175>",
|
| 1600 |
+
"lstrip": false,
|
| 1601 |
+
"normalized": false,
|
| 1602 |
+
"rstrip": false,
|
| 1603 |
+
"single_word": false,
|
| 1604 |
+
"special": true
|
| 1605 |
+
},
|
| 1606 |
+
"200": {
|
| 1607 |
+
"content": "<mask_176>",
|
| 1608 |
+
"lstrip": false,
|
| 1609 |
+
"normalized": false,
|
| 1610 |
+
"rstrip": false,
|
| 1611 |
+
"single_word": false,
|
| 1612 |
+
"special": true
|
| 1613 |
+
},
|
| 1614 |
+
"201": {
|
| 1615 |
+
"content": "<mask_177>",
|
| 1616 |
+
"lstrip": false,
|
| 1617 |
+
"normalized": false,
|
| 1618 |
+
"rstrip": false,
|
| 1619 |
+
"single_word": false,
|
| 1620 |
+
"special": true
|
| 1621 |
+
},
|
| 1622 |
+
"202": {
|
| 1623 |
+
"content": "<mask_178>",
|
| 1624 |
+
"lstrip": false,
|
| 1625 |
+
"normalized": false,
|
| 1626 |
+
"rstrip": false,
|
| 1627 |
+
"single_word": false,
|
| 1628 |
+
"special": true
|
| 1629 |
+
},
|
| 1630 |
+
"203": {
|
| 1631 |
+
"content": "<mask_179>",
|
| 1632 |
+
"lstrip": false,
|
| 1633 |
+
"normalized": false,
|
| 1634 |
+
"rstrip": false,
|
| 1635 |
+
"single_word": false,
|
| 1636 |
+
"special": true
|
| 1637 |
+
},
|
| 1638 |
+
"204": {
|
| 1639 |
+
"content": "<mask_180>",
|
| 1640 |
+
"lstrip": false,
|
| 1641 |
+
"normalized": false,
|
| 1642 |
+
"rstrip": false,
|
| 1643 |
+
"single_word": false,
|
| 1644 |
+
"special": true
|
| 1645 |
+
},
|
| 1646 |
+
"205": {
|
| 1647 |
+
"content": "<mask_181>",
|
| 1648 |
+
"lstrip": false,
|
| 1649 |
+
"normalized": false,
|
| 1650 |
+
"rstrip": false,
|
| 1651 |
+
"single_word": false,
|
| 1652 |
+
"special": true
|
| 1653 |
+
},
|
| 1654 |
+
"206": {
|
| 1655 |
+
"content": "<mask_182>",
|
| 1656 |
+
"lstrip": false,
|
| 1657 |
+
"normalized": false,
|
| 1658 |
+
"rstrip": false,
|
| 1659 |
+
"single_word": false,
|
| 1660 |
+
"special": true
|
| 1661 |
+
},
|
| 1662 |
+
"207": {
|
| 1663 |
+
"content": "<mask_183>",
|
| 1664 |
+
"lstrip": false,
|
| 1665 |
+
"normalized": false,
|
| 1666 |
+
"rstrip": false,
|
| 1667 |
+
"single_word": false,
|
| 1668 |
+
"special": true
|
| 1669 |
+
},
|
| 1670 |
+
"208": {
|
| 1671 |
+
"content": "<mask_184>",
|
| 1672 |
+
"lstrip": false,
|
| 1673 |
+
"normalized": false,
|
| 1674 |
+
"rstrip": false,
|
| 1675 |
+
"single_word": false,
|
| 1676 |
+
"special": true
|
| 1677 |
+
},
|
| 1678 |
+
"209": {
|
| 1679 |
+
"content": "<mask_185>",
|
| 1680 |
+
"lstrip": false,
|
| 1681 |
+
"normalized": false,
|
| 1682 |
+
"rstrip": false,
|
| 1683 |
+
"single_word": false,
|
| 1684 |
+
"special": true
|
| 1685 |
+
},
|
| 1686 |
+
"210": {
|
| 1687 |
+
"content": "<mask_186>",
|
| 1688 |
+
"lstrip": false,
|
| 1689 |
+
"normalized": false,
|
| 1690 |
+
"rstrip": false,
|
| 1691 |
+
"single_word": false,
|
| 1692 |
+
"special": true
|
| 1693 |
+
},
|
| 1694 |
+
"211": {
|
| 1695 |
+
"content": "<mask_187>",
|
| 1696 |
+
"lstrip": false,
|
| 1697 |
+
"normalized": false,
|
| 1698 |
+
"rstrip": false,
|
| 1699 |
+
"single_word": false,
|
| 1700 |
+
"special": true
|
| 1701 |
+
},
|
| 1702 |
+
"212": {
|
| 1703 |
+
"content": "<mask_188>",
|
| 1704 |
+
"lstrip": false,
|
| 1705 |
+
"normalized": false,
|
| 1706 |
+
"rstrip": false,
|
| 1707 |
+
"single_word": false,
|
| 1708 |
+
"special": true
|
| 1709 |
+
},
|
| 1710 |
+
"213": {
|
| 1711 |
+
"content": "<mask_189>",
|
| 1712 |
+
"lstrip": false,
|
| 1713 |
+
"normalized": false,
|
| 1714 |
+
"rstrip": false,
|
| 1715 |
+
"single_word": false,
|
| 1716 |
+
"special": true
|
| 1717 |
+
},
|
| 1718 |
+
"214": {
|
| 1719 |
+
"content": "<mask_190>",
|
| 1720 |
+
"lstrip": false,
|
| 1721 |
+
"normalized": false,
|
| 1722 |
+
"rstrip": false,
|
| 1723 |
+
"single_word": false,
|
| 1724 |
+
"special": true
|
| 1725 |
+
},
|
| 1726 |
+
"215": {
|
| 1727 |
+
"content": "<mask_191>",
|
| 1728 |
+
"lstrip": false,
|
| 1729 |
+
"normalized": false,
|
| 1730 |
+
"rstrip": false,
|
| 1731 |
+
"single_word": false,
|
| 1732 |
+
"special": true
|
| 1733 |
+
},
|
| 1734 |
+
"216": {
|
| 1735 |
+
"content": "<mask_192>",
|
| 1736 |
+
"lstrip": false,
|
| 1737 |
+
"normalized": false,
|
| 1738 |
+
"rstrip": false,
|
| 1739 |
+
"single_word": false,
|
| 1740 |
+
"special": true
|
| 1741 |
+
},
|
| 1742 |
+
"217": {
|
| 1743 |
+
"content": "<mask_193>",
|
| 1744 |
+
"lstrip": false,
|
| 1745 |
+
"normalized": false,
|
| 1746 |
+
"rstrip": false,
|
| 1747 |
+
"single_word": false,
|
| 1748 |
+
"special": true
|
| 1749 |
+
},
|
| 1750 |
+
"218": {
|
| 1751 |
+
"content": "<mask_194>",
|
| 1752 |
+
"lstrip": false,
|
| 1753 |
+
"normalized": false,
|
| 1754 |
+
"rstrip": false,
|
| 1755 |
+
"single_word": false,
|
| 1756 |
+
"special": true
|
| 1757 |
+
},
|
| 1758 |
+
"219": {
|
| 1759 |
+
"content": "<mask_195>",
|
| 1760 |
+
"lstrip": false,
|
| 1761 |
+
"normalized": false,
|
| 1762 |
+
"rstrip": false,
|
| 1763 |
+
"single_word": false,
|
| 1764 |
+
"special": true
|
| 1765 |
+
},
|
| 1766 |
+
"220": {
|
| 1767 |
+
"content": "<mask_196>",
|
| 1768 |
+
"lstrip": false,
|
| 1769 |
+
"normalized": false,
|
| 1770 |
+
"rstrip": false,
|
| 1771 |
+
"single_word": false,
|
| 1772 |
+
"special": true
|
| 1773 |
+
},
|
| 1774 |
+
"221": {
|
| 1775 |
+
"content": "<mask_197>",
|
| 1776 |
+
"lstrip": false,
|
| 1777 |
+
"normalized": false,
|
| 1778 |
+
"rstrip": false,
|
| 1779 |
+
"single_word": false,
|
| 1780 |
+
"special": true
|
| 1781 |
+
},
|
| 1782 |
+
"222": {
|
| 1783 |
+
"content": "<mask_198>",
|
| 1784 |
+
"lstrip": false,
|
| 1785 |
+
"normalized": false,
|
| 1786 |
+
"rstrip": false,
|
| 1787 |
+
"single_word": false,
|
| 1788 |
+
"special": true
|
| 1789 |
+
},
|
| 1790 |
+
"223": {
|
| 1791 |
+
"content": "<mask_199>",
|
| 1792 |
+
"lstrip": false,
|
| 1793 |
+
"normalized": false,
|
| 1794 |
+
"rstrip": false,
|
| 1795 |
+
"single_word": false,
|
| 1796 |
+
"special": true
|
| 1797 |
+
}
|
| 1798 |
+
},
|
| 1799 |
+
"bos_token": "<longcat_s>",
|
| 1800 |
+
"clean_up_tokenization_spaces": false,
|
| 1801 |
+
"eos_token": "</longcat_s>",
|
| 1802 |
+
"extra_special_tokens": {},
|
| 1803 |
+
"merges_file": null,
|
| 1804 |
+
"model_max_length": 131072,
|
| 1805 |
+
"pad_token": "<longcat_pad>",
|
| 1806 |
+
"sp_model_kwargs": {},
|
| 1807 |
+
"tokenizer_class": "BloomTokenizer",
|
| 1808 |
+
"unk_token": "<longcat_unk>",
|
| 1809 |
+
"vocab_file": null
|
| 1810 |
+
}
|