div0-space commited on
Commit
416b98e
·
verified ·
1 Parent(s): 28217a6

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .DS_Store +0 -0
  2. .gitattributes +1 -0
  3. README.md +60 -0
  4. __init__.py +0 -0
  5. block_config.py +118 -0
  6. chat_template.jinja +1 -0
  7. config.json +2968 -0
  8. configuration_decilm.py +65 -0
  9. model-00001-of-00037.safetensors +3 -0
  10. model-00002-of-00037.safetensors +3 -0
  11. model-00003-of-00037.safetensors +3 -0
  12. model-00004-of-00037.safetensors +3 -0
  13. model-00005-of-00037.safetensors +3 -0
  14. model-00006-of-00037.safetensors +3 -0
  15. model-00007-of-00037.safetensors +3 -0
  16. model-00008-of-00037.safetensors +3 -0
  17. model-00009-of-00037.safetensors +3 -0
  18. model-00010-of-00037.safetensors +3 -0
  19. model-00011-of-00037.safetensors +3 -0
  20. model-00012-of-00037.safetensors +3 -0
  21. model-00013-of-00037.safetensors +3 -0
  22. model-00014-of-00037.safetensors +3 -0
  23. model-00015-of-00037.safetensors +3 -0
  24. model-00016-of-00037.safetensors +3 -0
  25. model-00017-of-00037.safetensors +3 -0
  26. model-00018-of-00037.safetensors +3 -0
  27. model-00019-of-00037.safetensors +3 -0
  28. model-00020-of-00037.safetensors +3 -0
  29. model-00021-of-00037.safetensors +3 -0
  30. model-00022-of-00037.safetensors +3 -0
  31. model-00023-of-00037.safetensors +3 -0
  32. model-00024-of-00037.safetensors +3 -0
  33. model-00025-of-00037.safetensors +3 -0
  34. model-00026-of-00037.safetensors +3 -0
  35. model-00027-of-00037.safetensors +3 -0
  36. model-00028-of-00037.safetensors +3 -0
  37. model-00029-of-00037.safetensors +3 -0
  38. model-00030-of-00037.safetensors +3 -0
  39. model-00031-of-00037.safetensors +3 -0
  40. model-00032-of-00037.safetensors +3 -0
  41. model-00033-of-00037.safetensors +3 -0
  42. model-00034-of-00037.safetensors +3 -0
  43. model-00035-of-00037.safetensors +3 -0
  44. model-00036-of-00037.safetensors +3 -0
  45. model-00037-of-00037.safetensors +3 -0
  46. model.safetensors.index.json +0 -0
  47. modeling_decilm.py +1681 -0
  48. special_tokens_map.json +16 -0
  49. tokenizer.json +3 -0
  50. tokenizer_config.json +2062 -0
.DS_Store ADDED
Binary file (6.15 kB). View file
 
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Llama-3.1-Nemotron-Ultra-253B-v1-MLX-Q5
2
+
3
+ This is a Q5 quantized version of NVIDIA's Llama-3.1-Nemotron-Ultra-253B-v1 model, converted for use with MLX on Apple Silicon.
4
+
5
+ ## Model Details
6
+
7
+ - **Original Model**: nvidia/Llama-3_1-Nemotron-Ultra-253B-v1
8
+ - **Quantization**: Q5 (5-bit)
9
+ - **Size**: 163.2GB (Q5 quantized weights)
10
+ - **Peak Memory Usage**: ~175GB when loaded
11
+ - **Architecture**: DeciLM (NAS-optimized Llama variant)
12
+ - **Framework**: MLX 0.26.2+
13
+
14
+ ## Key Features
15
+
16
+ - **Neural Architecture Search (NAS)** optimized model
17
+ - **Variable Grouped Query Attention (VGQA)**
18
+ - **FFN Fusion** for improved efficiency
19
+ - **Dummy layers** for reduced memory footprint
20
+ - Optimized for Apple Silicon M-series chips
21
+
22
+ ## Performance
23
+
24
+ Tested on Mac Studio M3 Ultra (512GB RAM):
25
+ - **Speed**: ~3.86 tokens/sec generation
26
+ - **Prompt Processing**: ~14.3 tokens/sec
27
+ - **Memory**: Peak usage ~175GB
28
+ - Works with `mlx_lm` CLI tools (not LM Studio compatible yet)
29
+
30
+ ## Usage
31
+
32
+ ### With MLX-LM:
33
+ ```python
34
+ from mlx_lm import load, generate
35
+
36
+ model, tokenizer = load("LibraxisAI/Llama-3_1-Nemotron-Ultra-253B-v1-mlx-q5")
37
+ response = generate(model, tokenizer, prompt="Your prompt here", verbose=True)
38
+ ```
39
+
40
+ ### Command Line:
41
+ ```bash
42
+ uv run mlx_lm.generate \
43
+ --model LibraxisAI/Llama-3_1-Nemotron-Ultra-253B-v1-mlx-q5 \
44
+ --prompt "Your prompt here" \
45
+ --max-tokens 1000
46
+ ```
47
+
48
+ ## Conversion Details
49
+
50
+ - Converted using MLX-LM quantization tools
51
+ - Q5 quantization with group size 64
52
+ - Preserved DeciLM architecture specifics
53
+
54
+ ## License
55
+
56
+ Same as the original model - check NVIDIA's license terms.
57
+
58
+ ## Acknowledgments
59
+
60
+ Thanks to NVIDIA for the original Nemotron model and the MLX team for the framework.
__init__.py ADDED
File without changes
block_config.py ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import dataclasses
2
+ import json
3
+ import warnings
4
+ from dataclasses import dataclass, MISSING
5
+ from functools import partial
6
+ from typing import Optional, Any
7
+
8
+
9
+ @partial(dataclass, frozen=True, kw_only=True)
10
+ class JsonComparable:
11
+ def to_json(self) -> str:
12
+ return json.dumps(dataclasses.asdict(self))
13
+
14
+ def __eq__(self, other: "JsonComparable") -> bool:
15
+ return self.to_json() == other.to_json()
16
+
17
+ def __hash__(self) -> int:
18
+ return hash(self.to_json())
19
+
20
+ def __lt__(self, other: "JsonComparable") -> bool:
21
+ return self.to_json() < other.to_json()
22
+
23
+
24
+ @partial(dataclass, frozen=True, kw_only=True)
25
+ class SubblockConfig(JsonComparable):
26
+ no_op: bool = False
27
+ replace_with_linear: bool = False
28
+ sparsify: Optional[list[str]] = None
29
+
30
+ def __post_init__(self):
31
+ assert not (self.no_op and self.replace_with_linear)
32
+
33
+ def _force_setattr(self, name: str, value: Any) -> None:
34
+ """
35
+ Set an attribute even in frozen dataclasses.
36
+ Use only inside __post_init__!
37
+ """
38
+ object.__setattr__(self, name, value)
39
+
40
+
41
+ @partial(dataclass, frozen=True, kw_only=True)
42
+ class AttentionConfig(SubblockConfig):
43
+ n_heads_in_group: Optional[int] = None
44
+ window_length: Optional[int] = None
45
+ num_sink_tokens: Optional[int] = None
46
+ use_prefill_window_in_sink_attention: bool = False
47
+ unshifted_sink: bool = False
48
+
49
+ def __post_init__(self):
50
+ super().__post_init__()
51
+ assert not (self.no_op and self.replace_with_linear)
52
+
53
+ if self.no_op or self.replace_with_linear:
54
+ for irrelevant_att in ["n_heads_in_group", "window_length", "num_sink_tokens"]:
55
+ self._force_setattr(irrelevant_att, None)
56
+ else:
57
+ assert self.n_heads_in_group is not None
58
+
59
+ if self.is_sink:
60
+ assert not (self.unshifted_sink and self.use_prefill_window_in_sink_attention), \
61
+ ("Unshifted sink uses its own kind of explicit masking, not standard window. "
62
+ "Set use_prefill_window_in_sink_attention to False.")
63
+ assert not (self.num_sink_tokens == 0 and not self.unshifted_sink), \
64
+ "Fake sink attention with 0 sink tokens is only supported with unshifted_sink=True"
65
+
66
+ @property
67
+ def prefill_sliding_window(self) -> Optional[int]:
68
+ if self.window_length is not None:
69
+ if not self.is_sink or self.use_prefill_window_in_sink_attention:
70
+ return self.window_length
71
+ return None
72
+
73
+ @property
74
+ def is_sliding(self) -> bool:
75
+ return self.prefill_sliding_window is not None
76
+
77
+ @property
78
+ def is_sink(self) -> bool:
79
+ return (
80
+ (self.window_length is not None)
81
+ and
82
+ (self.num_sink_tokens is not None)
83
+ )
84
+
85
+
86
+ @partial(dataclass, frozen=True, kw_only=True)
87
+ class FFNConfig(SubblockConfig):
88
+ ffn_mult: Optional[float] = None
89
+
90
+ def __post_init__(self):
91
+ super().__post_init__()
92
+ if self.no_op or self.replace_with_linear:
93
+ self._force_setattr("ffn_mult", None)
94
+ else:
95
+ assert self.ffn_mult is not None
96
+ self._force_setattr("ffn_mult", round(self.ffn_mult, 6))
97
+
98
+
99
+ @partial(dataclass, frozen=True, kw_only=True)
100
+ class BlockConfig(JsonComparable):
101
+ attention: AttentionConfig = MISSING
102
+ ffn: FFNConfig = MISSING
103
+
104
+ def __post_init__(self):
105
+ """
106
+ Init subblock dataclasses from dicts
107
+ """
108
+ for subblock_name in dataclasses.fields(self):
109
+ subblock_config = getattr(self, subblock_name.name)
110
+ if isinstance(subblock_config, dict):
111
+ subblock_fields = [field.name for field in dataclasses.fields(subblock_name.type)]
112
+ unsupported_fields = [field_name for field_name in subblock_config.keys()
113
+ if field_name not in subblock_fields]
114
+ if len(unsupported_fields) > 0:
115
+ warnings.warn(f"Removed unsupported fields {unsupported_fields} from {subblock_name.type.__name__}")
116
+ subblock_config = {k: v for k, v in subblock_config.items() if k not in unsupported_fields}
117
+ object.__setattr__(self, subblock_name.name,
118
+ subblock_name.type(**subblock_config)) # __setattr__ to overcome frozen=True
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {{- bos_token }}{%- if messages[0]['role'] == 'system' %}{%- set system_message = messages[0]['content']|trim %}{%- set messages = messages[1:] %}{%- else %}{%- set system_message = "detailed thinking on" %}{%- endif %}{{- "<|start_header_id|>system<|end_header_id|>\n\n" }}{{- system_message }}{{- "<|eot_id|>" }}{%- for message in messages %}{%- if message['role'] == 'assistant' and '</think>' in message['content'] %}{%- set content = message['content'].split('</think>')[-1].lstrip() %}{%- else %}{%- set content = message['content'] %}{%- endif %}{{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n' + content | trim + '<|eot_id|>' }}{%- endfor %}{%- if add_generation_prompt %}{{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{%- endif %}
config.json ADDED
@@ -0,0 +1,2968 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DeciLMForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_decilm.DeciLMConfig",
9
+ "AutoModelForCausalLM": "modeling_decilm.DeciLMForCausalLM"
10
+ },
11
+ "block_configs": [
12
+ {
13
+ "attention": {
14
+ "n_heads_in_group": 16,
15
+ "no_op": false,
16
+ "num_sink_tokens": null,
17
+ "replace_with_linear": false,
18
+ "sparsify": null,
19
+ "unshifted_sink": false,
20
+ "use_prefill_window_in_sink_attention": false,
21
+ "window_length": null
22
+ },
23
+ "ffn": {
24
+ "ffn_mult": 0.4875,
25
+ "no_op": false,
26
+ "replace_with_linear": false,
27
+ "sparsify": null
28
+ }
29
+ },
30
+ {
31
+ "attention": {
32
+ "n_heads_in_group": 16,
33
+ "no_op": false,
34
+ "num_sink_tokens": null,
35
+ "replace_with_linear": false,
36
+ "sparsify": null,
37
+ "unshifted_sink": false,
38
+ "use_prefill_window_in_sink_attention": false,
39
+ "window_length": null
40
+ },
41
+ "ffn": {
42
+ "ffn_mult": 0.975,
43
+ "no_op": false,
44
+ "replace_with_linear": false,
45
+ "sparsify": null
46
+ }
47
+ },
48
+ {
49
+ "attention": {
50
+ "n_heads_in_group": 16,
51
+ "no_op": false,
52
+ "num_sink_tokens": null,
53
+ "replace_with_linear": false,
54
+ "sparsify": null,
55
+ "unshifted_sink": false,
56
+ "use_prefill_window_in_sink_attention": false,
57
+ "window_length": null
58
+ },
59
+ "ffn": {
60
+ "ffn_mult": 1.4625,
61
+ "no_op": false,
62
+ "replace_with_linear": false,
63
+ "sparsify": null
64
+ }
65
+ },
66
+ {
67
+ "attention": {
68
+ "n_heads_in_group": 16,
69
+ "no_op": false,
70
+ "num_sink_tokens": null,
71
+ "replace_with_linear": false,
72
+ "sparsify": null,
73
+ "unshifted_sink": false,
74
+ "use_prefill_window_in_sink_attention": false,
75
+ "window_length": null
76
+ },
77
+ "ffn": {
78
+ "ffn_mult": 1.4625,
79
+ "no_op": false,
80
+ "replace_with_linear": false,
81
+ "sparsify": null
82
+ }
83
+ },
84
+ {
85
+ "attention": {
86
+ "n_heads_in_group": 16,
87
+ "no_op": false,
88
+ "num_sink_tokens": null,
89
+ "replace_with_linear": false,
90
+ "sparsify": null,
91
+ "unshifted_sink": false,
92
+ "use_prefill_window_in_sink_attention": false,
93
+ "window_length": null
94
+ },
95
+ "ffn": {
96
+ "ffn_mult": 1.4625,
97
+ "no_op": false,
98
+ "replace_with_linear": false,
99
+ "sparsify": null
100
+ }
101
+ },
102
+ {
103
+ "attention": {
104
+ "n_heads_in_group": 16,
105
+ "no_op": false,
106
+ "num_sink_tokens": null,
107
+ "replace_with_linear": false,
108
+ "sparsify": null,
109
+ "unshifted_sink": false,
110
+ "use_prefill_window_in_sink_attention": false,
111
+ "window_length": null
112
+ },
113
+ "ffn": {
114
+ "ffn_mult": 1.4625,
115
+ "no_op": false,
116
+ "replace_with_linear": false,
117
+ "sparsify": null
118
+ }
119
+ },
120
+ {
121
+ "attention": {
122
+ "n_heads_in_group": 16,
123
+ "no_op": false,
124
+ "num_sink_tokens": null,
125
+ "replace_with_linear": false,
126
+ "sparsify": null,
127
+ "unshifted_sink": false,
128
+ "use_prefill_window_in_sink_attention": false,
129
+ "window_length": null
130
+ },
131
+ "ffn": {
132
+ "ffn_mult": 1.4625,
133
+ "no_op": false,
134
+ "replace_with_linear": false,
135
+ "sparsify": null
136
+ }
137
+ },
138
+ {
139
+ "attention": {
140
+ "n_heads_in_group": 16,
141
+ "no_op": false,
142
+ "num_sink_tokens": null,
143
+ "replace_with_linear": false,
144
+ "sparsify": null,
145
+ "unshifted_sink": false,
146
+ "use_prefill_window_in_sink_attention": false,
147
+ "window_length": null
148
+ },
149
+ "ffn": {
150
+ "ffn_mult": 1.4625,
151
+ "no_op": false,
152
+ "replace_with_linear": false,
153
+ "sparsify": null
154
+ }
155
+ },
156
+ {
157
+ "attention": {
158
+ "n_heads_in_group": 16,
159
+ "no_op": false,
160
+ "num_sink_tokens": null,
161
+ "replace_with_linear": false,
162
+ "sparsify": null,
163
+ "unshifted_sink": false,
164
+ "use_prefill_window_in_sink_attention": false,
165
+ "window_length": null
166
+ },
167
+ "ffn": {
168
+ "ffn_mult": 1.95,
169
+ "no_op": false,
170
+ "replace_with_linear": false,
171
+ "sparsify": null
172
+ }
173
+ },
174
+ {
175
+ "attention": {
176
+ "n_heads_in_group": null,
177
+ "no_op": true,
178
+ "num_sink_tokens": null,
179
+ "replace_with_linear": false,
180
+ "sparsify": null,
181
+ "unshifted_sink": false,
182
+ "use_prefill_window_in_sink_attention": false,
183
+ "window_length": null
184
+ },
185
+ "ffn": {
186
+ "ffn_mult": null,
187
+ "no_op": true,
188
+ "replace_with_linear": false,
189
+ "sparsify": null
190
+ }
191
+ },
192
+ {
193
+ "attention": {
194
+ "n_heads_in_group": null,
195
+ "no_op": true,
196
+ "num_sink_tokens": null,
197
+ "replace_with_linear": false,
198
+ "sparsify": null,
199
+ "unshifted_sink": false,
200
+ "use_prefill_window_in_sink_attention": false,
201
+ "window_length": null
202
+ },
203
+ "ffn": {
204
+ "ffn_mult": null,
205
+ "no_op": true,
206
+ "replace_with_linear": false,
207
+ "sparsify": null
208
+ }
209
+ },
210
+ {
211
+ "attention": {
212
+ "n_heads_in_group": null,
213
+ "no_op": true,
214
+ "num_sink_tokens": null,
215
+ "replace_with_linear": false,
216
+ "sparsify": null,
217
+ "unshifted_sink": false,
218
+ "use_prefill_window_in_sink_attention": false,
219
+ "window_length": null
220
+ },
221
+ "ffn": {
222
+ "ffn_mult": null,
223
+ "no_op": true,
224
+ "replace_with_linear": false,
225
+ "sparsify": null
226
+ }
227
+ },
228
+ {
229
+ "attention": {
230
+ "n_heads_in_group": null,
231
+ "no_op": true,
232
+ "num_sink_tokens": null,
233
+ "replace_with_linear": false,
234
+ "sparsify": null,
235
+ "unshifted_sink": false,
236
+ "use_prefill_window_in_sink_attention": false,
237
+ "window_length": null
238
+ },
239
+ "ffn": {
240
+ "ffn_mult": null,
241
+ "no_op": true,
242
+ "replace_with_linear": false,
243
+ "sparsify": null
244
+ }
245
+ },
246
+ {
247
+ "attention": {
248
+ "n_heads_in_group": 16,
249
+ "no_op": false,
250
+ "num_sink_tokens": null,
251
+ "replace_with_linear": false,
252
+ "sparsify": null,
253
+ "unshifted_sink": false,
254
+ "use_prefill_window_in_sink_attention": false,
255
+ "window_length": null
256
+ },
257
+ "ffn": {
258
+ "ffn_mult": 1.95,
259
+ "no_op": false,
260
+ "replace_with_linear": false,
261
+ "sparsify": null
262
+ }
263
+ },
264
+ {
265
+ "attention": {
266
+ "n_heads_in_group": 16,
267
+ "no_op": false,
268
+ "num_sink_tokens": null,
269
+ "replace_with_linear": false,
270
+ "sparsify": null,
271
+ "unshifted_sink": false,
272
+ "use_prefill_window_in_sink_attention": false,
273
+ "window_length": null
274
+ },
275
+ "ffn": {
276
+ "ffn_mult": 1.95,
277
+ "no_op": false,
278
+ "replace_with_linear": false,
279
+ "sparsify": null
280
+ }
281
+ },
282
+ {
283
+ "attention": {
284
+ "n_heads_in_group": 16,
285
+ "no_op": false,
286
+ "num_sink_tokens": null,
287
+ "replace_with_linear": false,
288
+ "sparsify": null,
289
+ "unshifted_sink": false,
290
+ "use_prefill_window_in_sink_attention": false,
291
+ "window_length": null
292
+ },
293
+ "ffn": {
294
+ "ffn_mult": 1.95,
295
+ "no_op": false,
296
+ "replace_with_linear": false,
297
+ "sparsify": null
298
+ }
299
+ },
300
+ {
301
+ "attention": {
302
+ "n_heads_in_group": 16,
303
+ "no_op": false,
304
+ "num_sink_tokens": null,
305
+ "replace_with_linear": false,
306
+ "sparsify": null,
307
+ "unshifted_sink": false,
308
+ "use_prefill_window_in_sink_attention": false,
309
+ "window_length": null
310
+ },
311
+ "ffn": {
312
+ "ffn_mult": 4.875,
313
+ "no_op": false,
314
+ "replace_with_linear": false,
315
+ "sparsify": null
316
+ }
317
+ },
318
+ {
319
+ "attention": {
320
+ "n_heads_in_group": 16,
321
+ "no_op": false,
322
+ "num_sink_tokens": null,
323
+ "replace_with_linear": false,
324
+ "sparsify": null,
325
+ "unshifted_sink": false,
326
+ "use_prefill_window_in_sink_attention": false,
327
+ "window_length": null
328
+ },
329
+ "ffn": {
330
+ "ffn_mult": 4.875,
331
+ "no_op": false,
332
+ "replace_with_linear": false,
333
+ "sparsify": null
334
+ }
335
+ },
336
+ {
337
+ "attention": {
338
+ "n_heads_in_group": null,
339
+ "no_op": true,
340
+ "num_sink_tokens": null,
341
+ "replace_with_linear": false,
342
+ "sparsify": null,
343
+ "unshifted_sink": false,
344
+ "use_prefill_window_in_sink_attention": false,
345
+ "window_length": null
346
+ },
347
+ "ffn": {
348
+ "ffn_mult": null,
349
+ "no_op": true,
350
+ "replace_with_linear": false,
351
+ "sparsify": null
352
+ }
353
+ },
354
+ {
355
+ "attention": {
356
+ "n_heads_in_group": null,
357
+ "no_op": true,
358
+ "num_sink_tokens": null,
359
+ "replace_with_linear": false,
360
+ "sparsify": null,
361
+ "unshifted_sink": false,
362
+ "use_prefill_window_in_sink_attention": false,
363
+ "window_length": null
364
+ },
365
+ "ffn": {
366
+ "ffn_mult": null,
367
+ "no_op": true,
368
+ "replace_with_linear": false,
369
+ "sparsify": null
370
+ }
371
+ },
372
+ {
373
+ "attention": {
374
+ "n_heads_in_group": null,
375
+ "no_op": true,
376
+ "num_sink_tokens": null,
377
+ "replace_with_linear": false,
378
+ "sparsify": null,
379
+ "unshifted_sink": false,
380
+ "use_prefill_window_in_sink_attention": false,
381
+ "window_length": null
382
+ },
383
+ "ffn": {
384
+ "ffn_mult": null,
385
+ "no_op": true,
386
+ "replace_with_linear": false,
387
+ "sparsify": null
388
+ }
389
+ },
390
+ {
391
+ "attention": {
392
+ "n_heads_in_group": null,
393
+ "no_op": true,
394
+ "num_sink_tokens": null,
395
+ "replace_with_linear": false,
396
+ "sparsify": null,
397
+ "unshifted_sink": false,
398
+ "use_prefill_window_in_sink_attention": false,
399
+ "window_length": null
400
+ },
401
+ "ffn": {
402
+ "ffn_mult": null,
403
+ "no_op": true,
404
+ "replace_with_linear": false,
405
+ "sparsify": null
406
+ }
407
+ },
408
+ {
409
+ "attention": {
410
+ "n_heads_in_group": null,
411
+ "no_op": true,
412
+ "num_sink_tokens": null,
413
+ "replace_with_linear": false,
414
+ "sparsify": null,
415
+ "unshifted_sink": false,
416
+ "use_prefill_window_in_sink_attention": false,
417
+ "window_length": null
418
+ },
419
+ "ffn": {
420
+ "ffn_mult": null,
421
+ "no_op": true,
422
+ "replace_with_linear": false,
423
+ "sparsify": null
424
+ }
425
+ },
426
+ {
427
+ "attention": {
428
+ "n_heads_in_group": null,
429
+ "no_op": true,
430
+ "num_sink_tokens": null,
431
+ "replace_with_linear": false,
432
+ "sparsify": null,
433
+ "unshifted_sink": false,
434
+ "use_prefill_window_in_sink_attention": false,
435
+ "window_length": null
436
+ },
437
+ "ffn": {
438
+ "ffn_mult": null,
439
+ "no_op": true,
440
+ "replace_with_linear": false,
441
+ "sparsify": null
442
+ }
443
+ },
444
+ {
445
+ "attention": {
446
+ "n_heads_in_group": 16,
447
+ "no_op": false,
448
+ "num_sink_tokens": null,
449
+ "replace_with_linear": false,
450
+ "sparsify": null,
451
+ "unshifted_sink": false,
452
+ "use_prefill_window_in_sink_attention": false,
453
+ "window_length": null
454
+ },
455
+ "ffn": {
456
+ "ffn_mult": 4.875,
457
+ "no_op": false,
458
+ "replace_with_linear": false,
459
+ "sparsify": null
460
+ }
461
+ },
462
+ {
463
+ "attention": {
464
+ "n_heads_in_group": 16,
465
+ "no_op": false,
466
+ "num_sink_tokens": null,
467
+ "replace_with_linear": false,
468
+ "sparsify": null,
469
+ "unshifted_sink": false,
470
+ "use_prefill_window_in_sink_attention": false,
471
+ "window_length": null
472
+ },
473
+ "ffn": {
474
+ "ffn_mult": 4.875,
475
+ "no_op": false,
476
+ "replace_with_linear": false,
477
+ "sparsify": null
478
+ }
479
+ },
480
+ {
481
+ "attention": {
482
+ "n_heads_in_group": 16,
483
+ "no_op": false,
484
+ "num_sink_tokens": null,
485
+ "replace_with_linear": false,
486
+ "sparsify": null,
487
+ "unshifted_sink": false,
488
+ "use_prefill_window_in_sink_attention": false,
489
+ "window_length": null
490
+ },
491
+ "ffn": {
492
+ "ffn_mult": 4.875,
493
+ "no_op": false,
494
+ "replace_with_linear": false,
495
+ "sparsify": null
496
+ }
497
+ },
498
+ {
499
+ "attention": {
500
+ "n_heads_in_group": null,
501
+ "no_op": true,
502
+ "num_sink_tokens": null,
503
+ "replace_with_linear": false,
504
+ "sparsify": null,
505
+ "unshifted_sink": false,
506
+ "use_prefill_window_in_sink_attention": false,
507
+ "window_length": null
508
+ },
509
+ "ffn": {
510
+ "ffn_mult": null,
511
+ "no_op": true,
512
+ "replace_with_linear": false,
513
+ "sparsify": null
514
+ }
515
+ },
516
+ {
517
+ "attention": {
518
+ "n_heads_in_group": null,
519
+ "no_op": true,
520
+ "num_sink_tokens": null,
521
+ "replace_with_linear": false,
522
+ "sparsify": null,
523
+ "unshifted_sink": false,
524
+ "use_prefill_window_in_sink_attention": false,
525
+ "window_length": null
526
+ },
527
+ "ffn": {
528
+ "ffn_mult": null,
529
+ "no_op": true,
530
+ "replace_with_linear": false,
531
+ "sparsify": null
532
+ }
533
+ },
534
+ {
535
+ "attention": {
536
+ "n_heads_in_group": null,
537
+ "no_op": true,
538
+ "num_sink_tokens": null,
539
+ "replace_with_linear": false,
540
+ "sparsify": null,
541
+ "unshifted_sink": false,
542
+ "use_prefill_window_in_sink_attention": false,
543
+ "window_length": null
544
+ },
545
+ "ffn": {
546
+ "ffn_mult": null,
547
+ "no_op": true,
548
+ "replace_with_linear": false,
549
+ "sparsify": null
550
+ }
551
+ },
552
+ {
553
+ "attention": {
554
+ "n_heads_in_group": null,
555
+ "no_op": true,
556
+ "num_sink_tokens": null,
557
+ "replace_with_linear": false,
558
+ "sparsify": null,
559
+ "unshifted_sink": false,
560
+ "use_prefill_window_in_sink_attention": false,
561
+ "window_length": null
562
+ },
563
+ "ffn": {
564
+ "ffn_mult": null,
565
+ "no_op": true,
566
+ "replace_with_linear": false,
567
+ "sparsify": null
568
+ }
569
+ },
570
+ {
571
+ "attention": {
572
+ "n_heads_in_group": null,
573
+ "no_op": true,
574
+ "num_sink_tokens": null,
575
+ "replace_with_linear": false,
576
+ "sparsify": null,
577
+ "unshifted_sink": false,
578
+ "use_prefill_window_in_sink_attention": false,
579
+ "window_length": null
580
+ },
581
+ "ffn": {
582
+ "ffn_mult": null,
583
+ "no_op": true,
584
+ "replace_with_linear": false,
585
+ "sparsify": null
586
+ }
587
+ },
588
+ {
589
+ "attention": {
590
+ "n_heads_in_group": 16,
591
+ "no_op": false,
592
+ "num_sink_tokens": null,
593
+ "replace_with_linear": false,
594
+ "sparsify": null,
595
+ "unshifted_sink": false,
596
+ "use_prefill_window_in_sink_attention": false,
597
+ "window_length": null
598
+ },
599
+ "ffn": {
600
+ "ffn_mult": 4.875,
601
+ "no_op": false,
602
+ "replace_with_linear": false,
603
+ "sparsify": null
604
+ }
605
+ },
606
+ {
607
+ "attention": {
608
+ "n_heads_in_group": 16,
609
+ "no_op": false,
610
+ "num_sink_tokens": null,
611
+ "replace_with_linear": false,
612
+ "sparsify": null,
613
+ "unshifted_sink": false,
614
+ "use_prefill_window_in_sink_attention": false,
615
+ "window_length": null
616
+ },
617
+ "ffn": {
618
+ "ffn_mult": 4.875,
619
+ "no_op": false,
620
+ "replace_with_linear": false,
621
+ "sparsify": null
622
+ }
623
+ },
624
+ {
625
+ "attention": {
626
+ "n_heads_in_group": 16,
627
+ "no_op": false,
628
+ "num_sink_tokens": null,
629
+ "replace_with_linear": false,
630
+ "sparsify": null,
631
+ "unshifted_sink": false,
632
+ "use_prefill_window_in_sink_attention": false,
633
+ "window_length": null
634
+ },
635
+ "ffn": {
636
+ "ffn_mult": 4.875,
637
+ "no_op": false,
638
+ "replace_with_linear": false,
639
+ "sparsify": null
640
+ }
641
+ },
642
+ {
643
+ "attention": {
644
+ "n_heads_in_group": 16,
645
+ "no_op": false,
646
+ "num_sink_tokens": null,
647
+ "replace_with_linear": false,
648
+ "sparsify": null,
649
+ "unshifted_sink": false,
650
+ "use_prefill_window_in_sink_attention": false,
651
+ "window_length": null
652
+ },
653
+ "ffn": {
654
+ "ffn_mult": 2.4375,
655
+ "no_op": false,
656
+ "replace_with_linear": false,
657
+ "sparsify": null
658
+ }
659
+ },
660
+ {
661
+ "attention": {
662
+ "n_heads_in_group": null,
663
+ "no_op": true,
664
+ "num_sink_tokens": null,
665
+ "replace_with_linear": false,
666
+ "sparsify": null,
667
+ "unshifted_sink": false,
668
+ "use_prefill_window_in_sink_attention": false,
669
+ "window_length": null
670
+ },
671
+ "ffn": {
672
+ "ffn_mult": null,
673
+ "no_op": true,
674
+ "replace_with_linear": false,
675
+ "sparsify": null
676
+ }
677
+ },
678
+ {
679
+ "attention": {
680
+ "n_heads_in_group": null,
681
+ "no_op": true,
682
+ "num_sink_tokens": null,
683
+ "replace_with_linear": false,
684
+ "sparsify": null,
685
+ "unshifted_sink": false,
686
+ "use_prefill_window_in_sink_attention": false,
687
+ "window_length": null
688
+ },
689
+ "ffn": {
690
+ "ffn_mult": null,
691
+ "no_op": true,
692
+ "replace_with_linear": false,
693
+ "sparsify": null
694
+ }
695
+ },
696
+ {
697
+ "attention": {
698
+ "n_heads_in_group": null,
699
+ "no_op": true,
700
+ "num_sink_tokens": null,
701
+ "replace_with_linear": false,
702
+ "sparsify": null,
703
+ "unshifted_sink": false,
704
+ "use_prefill_window_in_sink_attention": false,
705
+ "window_length": null
706
+ },
707
+ "ffn": {
708
+ "ffn_mult": null,
709
+ "no_op": true,
710
+ "replace_with_linear": false,
711
+ "sparsify": null
712
+ }
713
+ },
714
+ {
715
+ "attention": {
716
+ "n_heads_in_group": 16,
717
+ "no_op": false,
718
+ "num_sink_tokens": null,
719
+ "replace_with_linear": false,
720
+ "sparsify": null,
721
+ "unshifted_sink": false,
722
+ "use_prefill_window_in_sink_attention": false,
723
+ "window_length": null
724
+ },
725
+ "ffn": {
726
+ "ffn_mult": 1.95,
727
+ "no_op": false,
728
+ "replace_with_linear": false,
729
+ "sparsify": null
730
+ }
731
+ },
732
+ {
733
+ "attention": {
734
+ "n_heads_in_group": 16,
735
+ "no_op": false,
736
+ "num_sink_tokens": null,
737
+ "replace_with_linear": false,
738
+ "sparsify": null,
739
+ "unshifted_sink": false,
740
+ "use_prefill_window_in_sink_attention": false,
741
+ "window_length": null
742
+ },
743
+ "ffn": {
744
+ "ffn_mult": 1.95,
745
+ "no_op": false,
746
+ "replace_with_linear": false,
747
+ "sparsify": null
748
+ }
749
+ },
750
+ {
751
+ "attention": {
752
+ "n_heads_in_group": 16,
753
+ "no_op": false,
754
+ "num_sink_tokens": null,
755
+ "replace_with_linear": false,
756
+ "sparsify": null,
757
+ "unshifted_sink": false,
758
+ "use_prefill_window_in_sink_attention": false,
759
+ "window_length": null
760
+ },
761
+ "ffn": {
762
+ "ffn_mult": 1.95,
763
+ "no_op": false,
764
+ "replace_with_linear": false,
765
+ "sparsify": null
766
+ }
767
+ },
768
+ {
769
+ "attention": {
770
+ "n_heads_in_group": null,
771
+ "no_op": true,
772
+ "num_sink_tokens": null,
773
+ "replace_with_linear": false,
774
+ "sparsify": null,
775
+ "unshifted_sink": false,
776
+ "use_prefill_window_in_sink_attention": false,
777
+ "window_length": null
778
+ },
779
+ "ffn": {
780
+ "ffn_mult": 1.95,
781
+ "no_op": false,
782
+ "replace_with_linear": false,
783
+ "sparsify": null
784
+ }
785
+ },
786
+ {
787
+ "attention": {
788
+ "n_heads_in_group": 16,
789
+ "no_op": false,
790
+ "num_sink_tokens": null,
791
+ "replace_with_linear": false,
792
+ "sparsify": null,
793
+ "unshifted_sink": false,
794
+ "use_prefill_window_in_sink_attention": false,
795
+ "window_length": null
796
+ },
797
+ "ffn": {
798
+ "ffn_mult": 4.875,
799
+ "no_op": false,
800
+ "replace_with_linear": false,
801
+ "sparsify": null
802
+ }
803
+ },
804
+ {
805
+ "attention": {
806
+ "n_heads_in_group": null,
807
+ "no_op": true,
808
+ "num_sink_tokens": null,
809
+ "replace_with_linear": false,
810
+ "sparsify": null,
811
+ "unshifted_sink": false,
812
+ "use_prefill_window_in_sink_attention": false,
813
+ "window_length": null
814
+ },
815
+ "ffn": {
816
+ "ffn_mult": 4.875,
817
+ "no_op": false,
818
+ "replace_with_linear": false,
819
+ "sparsify": null
820
+ }
821
+ },
822
+ {
823
+ "attention": {
824
+ "n_heads_in_group": null,
825
+ "no_op": true,
826
+ "num_sink_tokens": null,
827
+ "replace_with_linear": false,
828
+ "sparsify": null,
829
+ "unshifted_sink": false,
830
+ "use_prefill_window_in_sink_attention": false,
831
+ "window_length": null
832
+ },
833
+ "ffn": {
834
+ "ffn_mult": null,
835
+ "no_op": true,
836
+ "replace_with_linear": false,
837
+ "sparsify": null
838
+ }
839
+ },
840
+ {
841
+ "attention": {
842
+ "n_heads_in_group": null,
843
+ "no_op": true,
844
+ "num_sink_tokens": null,
845
+ "replace_with_linear": false,
846
+ "sparsify": null,
847
+ "unshifted_sink": false,
848
+ "use_prefill_window_in_sink_attention": false,
849
+ "window_length": null
850
+ },
851
+ "ffn": {
852
+ "ffn_mult": null,
853
+ "no_op": true,
854
+ "replace_with_linear": false,
855
+ "sparsify": null
856
+ }
857
+ },
858
+ {
859
+ "attention": {
860
+ "n_heads_in_group": null,
861
+ "no_op": true,
862
+ "num_sink_tokens": null,
863
+ "replace_with_linear": false,
864
+ "sparsify": null,
865
+ "unshifted_sink": false,
866
+ "use_prefill_window_in_sink_attention": false,
867
+ "window_length": null
868
+ },
869
+ "ffn": {
870
+ "ffn_mult": null,
871
+ "no_op": true,
872
+ "replace_with_linear": false,
873
+ "sparsify": null
874
+ }
875
+ },
876
+ {
877
+ "attention": {
878
+ "n_heads_in_group": null,
879
+ "no_op": true,
880
+ "num_sink_tokens": null,
881
+ "replace_with_linear": false,
882
+ "sparsify": null,
883
+ "unshifted_sink": false,
884
+ "use_prefill_window_in_sink_attention": false,
885
+ "window_length": null
886
+ },
887
+ "ffn": {
888
+ "ffn_mult": null,
889
+ "no_op": true,
890
+ "replace_with_linear": false,
891
+ "sparsify": null
892
+ }
893
+ },
894
+ {
895
+ "attention": {
896
+ "n_heads_in_group": null,
897
+ "no_op": true,
898
+ "num_sink_tokens": null,
899
+ "replace_with_linear": false,
900
+ "sparsify": null,
901
+ "unshifted_sink": false,
902
+ "use_prefill_window_in_sink_attention": false,
903
+ "window_length": null
904
+ },
905
+ "ffn": {
906
+ "ffn_mult": null,
907
+ "no_op": true,
908
+ "replace_with_linear": false,
909
+ "sparsify": null
910
+ }
911
+ },
912
+ {
913
+ "attention": {
914
+ "n_heads_in_group": 16,
915
+ "no_op": false,
916
+ "num_sink_tokens": null,
917
+ "replace_with_linear": false,
918
+ "sparsify": null,
919
+ "unshifted_sink": false,
920
+ "use_prefill_window_in_sink_attention": false,
921
+ "window_length": null
922
+ },
923
+ "ffn": {
924
+ "ffn_mult": 4.875,
925
+ "no_op": false,
926
+ "replace_with_linear": false,
927
+ "sparsify": null
928
+ }
929
+ },
930
+ {
931
+ "attention": {
932
+ "n_heads_in_group": 16,
933
+ "no_op": false,
934
+ "num_sink_tokens": null,
935
+ "replace_with_linear": false,
936
+ "sparsify": null,
937
+ "unshifted_sink": false,
938
+ "use_prefill_window_in_sink_attention": false,
939
+ "window_length": null
940
+ },
941
+ "ffn": {
942
+ "ffn_mult": 4.875,
943
+ "no_op": false,
944
+ "replace_with_linear": false,
945
+ "sparsify": null
946
+ }
947
+ },
948
+ {
949
+ "attention": {
950
+ "n_heads_in_group": 16,
951
+ "no_op": false,
952
+ "num_sink_tokens": null,
953
+ "replace_with_linear": false,
954
+ "sparsify": null,
955
+ "unshifted_sink": false,
956
+ "use_prefill_window_in_sink_attention": false,
957
+ "window_length": null
958
+ },
959
+ "ffn": {
960
+ "ffn_mult": 4.875,
961
+ "no_op": false,
962
+ "replace_with_linear": false,
963
+ "sparsify": null
964
+ }
965
+ },
966
+ {
967
+ "attention": {
968
+ "n_heads_in_group": 16,
969
+ "no_op": false,
970
+ "num_sink_tokens": null,
971
+ "replace_with_linear": false,
972
+ "sparsify": null,
973
+ "unshifted_sink": false,
974
+ "use_prefill_window_in_sink_attention": false,
975
+ "window_length": null
976
+ },
977
+ "ffn": {
978
+ "ffn_mult": 4.875,
979
+ "no_op": false,
980
+ "replace_with_linear": false,
981
+ "sparsify": null
982
+ }
983
+ },
984
+ {
985
+ "attention": {
986
+ "n_heads_in_group": null,
987
+ "no_op": true,
988
+ "num_sink_tokens": null,
989
+ "replace_with_linear": false,
990
+ "sparsify": null,
991
+ "unshifted_sink": false,
992
+ "use_prefill_window_in_sink_attention": false,
993
+ "window_length": null
994
+ },
995
+ "ffn": {
996
+ "ffn_mult": null,
997
+ "no_op": true,
998
+ "replace_with_linear": false,
999
+ "sparsify": null
1000
+ }
1001
+ },
1002
+ {
1003
+ "attention": {
1004
+ "n_heads_in_group": null,
1005
+ "no_op": true,
1006
+ "num_sink_tokens": null,
1007
+ "replace_with_linear": false,
1008
+ "sparsify": null,
1009
+ "unshifted_sink": false,
1010
+ "use_prefill_window_in_sink_attention": false,
1011
+ "window_length": null
1012
+ },
1013
+ "ffn": {
1014
+ "ffn_mult": null,
1015
+ "no_op": true,
1016
+ "replace_with_linear": false,
1017
+ "sparsify": null
1018
+ }
1019
+ },
1020
+ {
1021
+ "attention": {
1022
+ "n_heads_in_group": null,
1023
+ "no_op": true,
1024
+ "num_sink_tokens": null,
1025
+ "replace_with_linear": false,
1026
+ "sparsify": null,
1027
+ "unshifted_sink": false,
1028
+ "use_prefill_window_in_sink_attention": false,
1029
+ "window_length": null
1030
+ },
1031
+ "ffn": {
1032
+ "ffn_mult": null,
1033
+ "no_op": true,
1034
+ "replace_with_linear": false,
1035
+ "sparsify": null
1036
+ }
1037
+ },
1038
+ {
1039
+ "attention": {
1040
+ "n_heads_in_group": null,
1041
+ "no_op": true,
1042
+ "num_sink_tokens": null,
1043
+ "replace_with_linear": false,
1044
+ "sparsify": null,
1045
+ "unshifted_sink": false,
1046
+ "use_prefill_window_in_sink_attention": false,
1047
+ "window_length": null
1048
+ },
1049
+ "ffn": {
1050
+ "ffn_mult": null,
1051
+ "no_op": true,
1052
+ "replace_with_linear": false,
1053
+ "sparsify": null
1054
+ }
1055
+ },
1056
+ {
1057
+ "attention": {
1058
+ "n_heads_in_group": null,
1059
+ "no_op": true,
1060
+ "num_sink_tokens": null,
1061
+ "replace_with_linear": false,
1062
+ "sparsify": null,
1063
+ "unshifted_sink": false,
1064
+ "use_prefill_window_in_sink_attention": false,
1065
+ "window_length": null
1066
+ },
1067
+ "ffn": {
1068
+ "ffn_mult": null,
1069
+ "no_op": true,
1070
+ "replace_with_linear": false,
1071
+ "sparsify": null
1072
+ }
1073
+ },
1074
+ {
1075
+ "attention": {
1076
+ "n_heads_in_group": 16,
1077
+ "no_op": false,
1078
+ "num_sink_tokens": null,
1079
+ "replace_with_linear": false,
1080
+ "sparsify": null,
1081
+ "unshifted_sink": false,
1082
+ "use_prefill_window_in_sink_attention": false,
1083
+ "window_length": null
1084
+ },
1085
+ "ffn": {
1086
+ "ffn_mult": 4.875,
1087
+ "no_op": false,
1088
+ "replace_with_linear": false,
1089
+ "sparsify": null
1090
+ }
1091
+ },
1092
+ {
1093
+ "attention": {
1094
+ "n_heads_in_group": 16,
1095
+ "no_op": false,
1096
+ "num_sink_tokens": null,
1097
+ "replace_with_linear": false,
1098
+ "sparsify": null,
1099
+ "unshifted_sink": false,
1100
+ "use_prefill_window_in_sink_attention": false,
1101
+ "window_length": null
1102
+ },
1103
+ "ffn": {
1104
+ "ffn_mult": 4.875,
1105
+ "no_op": false,
1106
+ "replace_with_linear": false,
1107
+ "sparsify": null
1108
+ }
1109
+ },
1110
+ {
1111
+ "attention": {
1112
+ "n_heads_in_group": 16,
1113
+ "no_op": false,
1114
+ "num_sink_tokens": null,
1115
+ "replace_with_linear": false,
1116
+ "sparsify": null,
1117
+ "unshifted_sink": false,
1118
+ "use_prefill_window_in_sink_attention": false,
1119
+ "window_length": null
1120
+ },
1121
+ "ffn": {
1122
+ "ffn_mult": 4.875,
1123
+ "no_op": false,
1124
+ "replace_with_linear": false,
1125
+ "sparsify": null
1126
+ }
1127
+ },
1128
+ {
1129
+ "attention": {
1130
+ "n_heads_in_group": 16,
1131
+ "no_op": false,
1132
+ "num_sink_tokens": null,
1133
+ "replace_with_linear": false,
1134
+ "sparsify": null,
1135
+ "unshifted_sink": false,
1136
+ "use_prefill_window_in_sink_attention": false,
1137
+ "window_length": null
1138
+ },
1139
+ "ffn": {
1140
+ "ffn_mult": 4.875,
1141
+ "no_op": false,
1142
+ "replace_with_linear": false,
1143
+ "sparsify": null
1144
+ }
1145
+ },
1146
+ {
1147
+ "attention": {
1148
+ "n_heads_in_group": null,
1149
+ "no_op": true,
1150
+ "num_sink_tokens": null,
1151
+ "replace_with_linear": false,
1152
+ "sparsify": null,
1153
+ "unshifted_sink": false,
1154
+ "use_prefill_window_in_sink_attention": false,
1155
+ "window_length": null
1156
+ },
1157
+ "ffn": {
1158
+ "ffn_mult": null,
1159
+ "no_op": true,
1160
+ "replace_with_linear": false,
1161
+ "sparsify": null
1162
+ }
1163
+ },
1164
+ {
1165
+ "attention": {
1166
+ "n_heads_in_group": null,
1167
+ "no_op": true,
1168
+ "num_sink_tokens": null,
1169
+ "replace_with_linear": false,
1170
+ "sparsify": null,
1171
+ "unshifted_sink": false,
1172
+ "use_prefill_window_in_sink_attention": false,
1173
+ "window_length": null
1174
+ },
1175
+ "ffn": {
1176
+ "ffn_mult": null,
1177
+ "no_op": true,
1178
+ "replace_with_linear": false,
1179
+ "sparsify": null
1180
+ }
1181
+ },
1182
+ {
1183
+ "attention": {
1184
+ "n_heads_in_group": null,
1185
+ "no_op": true,
1186
+ "num_sink_tokens": null,
1187
+ "replace_with_linear": false,
1188
+ "sparsify": null,
1189
+ "unshifted_sink": false,
1190
+ "use_prefill_window_in_sink_attention": false,
1191
+ "window_length": null
1192
+ },
1193
+ "ffn": {
1194
+ "ffn_mult": null,
1195
+ "no_op": true,
1196
+ "replace_with_linear": false,
1197
+ "sparsify": null
1198
+ }
1199
+ },
1200
+ {
1201
+ "attention": {
1202
+ "n_heads_in_group": null,
1203
+ "no_op": true,
1204
+ "num_sink_tokens": null,
1205
+ "replace_with_linear": false,
1206
+ "sparsify": null,
1207
+ "unshifted_sink": false,
1208
+ "use_prefill_window_in_sink_attention": false,
1209
+ "window_length": null
1210
+ },
1211
+ "ffn": {
1212
+ "ffn_mult": null,
1213
+ "no_op": true,
1214
+ "replace_with_linear": false,
1215
+ "sparsify": null
1216
+ }
1217
+ },
1218
+ {
1219
+ "attention": {
1220
+ "n_heads_in_group": null,
1221
+ "no_op": true,
1222
+ "num_sink_tokens": null,
1223
+ "replace_with_linear": false,
1224
+ "sparsify": null,
1225
+ "unshifted_sink": false,
1226
+ "use_prefill_window_in_sink_attention": false,
1227
+ "window_length": null
1228
+ },
1229
+ "ffn": {
1230
+ "ffn_mult": null,
1231
+ "no_op": true,
1232
+ "replace_with_linear": false,
1233
+ "sparsify": null
1234
+ }
1235
+ },
1236
+ {
1237
+ "attention": {
1238
+ "n_heads_in_group": 16,
1239
+ "no_op": false,
1240
+ "num_sink_tokens": null,
1241
+ "replace_with_linear": false,
1242
+ "sparsify": null,
1243
+ "unshifted_sink": false,
1244
+ "use_prefill_window_in_sink_attention": false,
1245
+ "window_length": null
1246
+ },
1247
+ "ffn": {
1248
+ "ffn_mult": 4.875,
1249
+ "no_op": false,
1250
+ "replace_with_linear": false,
1251
+ "sparsify": null
1252
+ }
1253
+ },
1254
+ {
1255
+ "attention": {
1256
+ "n_heads_in_group": 16,
1257
+ "no_op": false,
1258
+ "num_sink_tokens": null,
1259
+ "replace_with_linear": false,
1260
+ "sparsify": null,
1261
+ "unshifted_sink": false,
1262
+ "use_prefill_window_in_sink_attention": false,
1263
+ "window_length": null
1264
+ },
1265
+ "ffn": {
1266
+ "ffn_mult": 4.875,
1267
+ "no_op": false,
1268
+ "replace_with_linear": false,
1269
+ "sparsify": null
1270
+ }
1271
+ },
1272
+ {
1273
+ "attention": {
1274
+ "n_heads_in_group": 16,
1275
+ "no_op": false,
1276
+ "num_sink_tokens": null,
1277
+ "replace_with_linear": false,
1278
+ "sparsify": null,
1279
+ "unshifted_sink": false,
1280
+ "use_prefill_window_in_sink_attention": false,
1281
+ "window_length": null
1282
+ },
1283
+ "ffn": {
1284
+ "ffn_mult": 4.875,
1285
+ "no_op": false,
1286
+ "replace_with_linear": false,
1287
+ "sparsify": null
1288
+ }
1289
+ },
1290
+ {
1291
+ "attention": {
1292
+ "n_heads_in_group": 16,
1293
+ "no_op": false,
1294
+ "num_sink_tokens": null,
1295
+ "replace_with_linear": false,
1296
+ "sparsify": null,
1297
+ "unshifted_sink": false,
1298
+ "use_prefill_window_in_sink_attention": false,
1299
+ "window_length": null
1300
+ },
1301
+ "ffn": {
1302
+ "ffn_mult": 4.875,
1303
+ "no_op": false,
1304
+ "replace_with_linear": false,
1305
+ "sparsify": null
1306
+ }
1307
+ },
1308
+ {
1309
+ "attention": {
1310
+ "n_heads_in_group": null,
1311
+ "no_op": true,
1312
+ "num_sink_tokens": null,
1313
+ "replace_with_linear": false,
1314
+ "sparsify": null,
1315
+ "unshifted_sink": false,
1316
+ "use_prefill_window_in_sink_attention": false,
1317
+ "window_length": null
1318
+ },
1319
+ "ffn": {
1320
+ "ffn_mult": null,
1321
+ "no_op": true,
1322
+ "replace_with_linear": false,
1323
+ "sparsify": null
1324
+ }
1325
+ },
1326
+ {
1327
+ "attention": {
1328
+ "n_heads_in_group": null,
1329
+ "no_op": true,
1330
+ "num_sink_tokens": null,
1331
+ "replace_with_linear": false,
1332
+ "sparsify": null,
1333
+ "unshifted_sink": false,
1334
+ "use_prefill_window_in_sink_attention": false,
1335
+ "window_length": null
1336
+ },
1337
+ "ffn": {
1338
+ "ffn_mult": null,
1339
+ "no_op": true,
1340
+ "replace_with_linear": false,
1341
+ "sparsify": null
1342
+ }
1343
+ },
1344
+ {
1345
+ "attention": {
1346
+ "n_heads_in_group": null,
1347
+ "no_op": true,
1348
+ "num_sink_tokens": null,
1349
+ "replace_with_linear": false,
1350
+ "sparsify": null,
1351
+ "unshifted_sink": false,
1352
+ "use_prefill_window_in_sink_attention": false,
1353
+ "window_length": null
1354
+ },
1355
+ "ffn": {
1356
+ "ffn_mult": null,
1357
+ "no_op": true,
1358
+ "replace_with_linear": false,
1359
+ "sparsify": null
1360
+ }
1361
+ },
1362
+ {
1363
+ "attention": {
1364
+ "n_heads_in_group": null,
1365
+ "no_op": true,
1366
+ "num_sink_tokens": null,
1367
+ "replace_with_linear": false,
1368
+ "sparsify": null,
1369
+ "unshifted_sink": false,
1370
+ "use_prefill_window_in_sink_attention": false,
1371
+ "window_length": null
1372
+ },
1373
+ "ffn": {
1374
+ "ffn_mult": null,
1375
+ "no_op": true,
1376
+ "replace_with_linear": false,
1377
+ "sparsify": null
1378
+ }
1379
+ },
1380
+ {
1381
+ "attention": {
1382
+ "n_heads_in_group": null,
1383
+ "no_op": true,
1384
+ "num_sink_tokens": null,
1385
+ "replace_with_linear": false,
1386
+ "sparsify": null,
1387
+ "unshifted_sink": false,
1388
+ "use_prefill_window_in_sink_attention": false,
1389
+ "window_length": null
1390
+ },
1391
+ "ffn": {
1392
+ "ffn_mult": null,
1393
+ "no_op": true,
1394
+ "replace_with_linear": false,
1395
+ "sparsify": null
1396
+ }
1397
+ },
1398
+ {
1399
+ "attention": {
1400
+ "n_heads_in_group": 16,
1401
+ "no_op": false,
1402
+ "num_sink_tokens": null,
1403
+ "replace_with_linear": false,
1404
+ "sparsify": null,
1405
+ "unshifted_sink": false,
1406
+ "use_prefill_window_in_sink_attention": false,
1407
+ "window_length": null
1408
+ },
1409
+ "ffn": {
1410
+ "ffn_mult": 4.875,
1411
+ "no_op": false,
1412
+ "replace_with_linear": false,
1413
+ "sparsify": null
1414
+ }
1415
+ },
1416
+ {
1417
+ "attention": {
1418
+ "n_heads_in_group": 16,
1419
+ "no_op": false,
1420
+ "num_sink_tokens": null,
1421
+ "replace_with_linear": false,
1422
+ "sparsify": null,
1423
+ "unshifted_sink": false,
1424
+ "use_prefill_window_in_sink_attention": false,
1425
+ "window_length": null
1426
+ },
1427
+ "ffn": {
1428
+ "ffn_mult": 4.875,
1429
+ "no_op": false,
1430
+ "replace_with_linear": false,
1431
+ "sparsify": null
1432
+ }
1433
+ },
1434
+ {
1435
+ "attention": {
1436
+ "n_heads_in_group": 16,
1437
+ "no_op": false,
1438
+ "num_sink_tokens": null,
1439
+ "replace_with_linear": false,
1440
+ "sparsify": null,
1441
+ "unshifted_sink": false,
1442
+ "use_prefill_window_in_sink_attention": false,
1443
+ "window_length": null
1444
+ },
1445
+ "ffn": {
1446
+ "ffn_mult": 4.875,
1447
+ "no_op": false,
1448
+ "replace_with_linear": false,
1449
+ "sparsify": null
1450
+ }
1451
+ },
1452
+ {
1453
+ "attention": {
1454
+ "n_heads_in_group": 16,
1455
+ "no_op": false,
1456
+ "num_sink_tokens": null,
1457
+ "replace_with_linear": false,
1458
+ "sparsify": null,
1459
+ "unshifted_sink": false,
1460
+ "use_prefill_window_in_sink_attention": false,
1461
+ "window_length": null
1462
+ },
1463
+ "ffn": {
1464
+ "ffn_mult": 4.875,
1465
+ "no_op": false,
1466
+ "replace_with_linear": false,
1467
+ "sparsify": null
1468
+ }
1469
+ },
1470
+ {
1471
+ "attention": {
1472
+ "n_heads_in_group": null,
1473
+ "no_op": true,
1474
+ "num_sink_tokens": null,
1475
+ "replace_with_linear": false,
1476
+ "sparsify": null,
1477
+ "unshifted_sink": false,
1478
+ "use_prefill_window_in_sink_attention": false,
1479
+ "window_length": null
1480
+ },
1481
+ "ffn": {
1482
+ "ffn_mult": null,
1483
+ "no_op": true,
1484
+ "replace_with_linear": false,
1485
+ "sparsify": null
1486
+ }
1487
+ },
1488
+ {
1489
+ "attention": {
1490
+ "n_heads_in_group": null,
1491
+ "no_op": true,
1492
+ "num_sink_tokens": null,
1493
+ "replace_with_linear": false,
1494
+ "sparsify": null,
1495
+ "unshifted_sink": false,
1496
+ "use_prefill_window_in_sink_attention": false,
1497
+ "window_length": null
1498
+ },
1499
+ "ffn": {
1500
+ "ffn_mult": null,
1501
+ "no_op": true,
1502
+ "replace_with_linear": false,
1503
+ "sparsify": null
1504
+ }
1505
+ },
1506
+ {
1507
+ "attention": {
1508
+ "n_heads_in_group": null,
1509
+ "no_op": true,
1510
+ "num_sink_tokens": null,
1511
+ "replace_with_linear": false,
1512
+ "sparsify": null,
1513
+ "unshifted_sink": false,
1514
+ "use_prefill_window_in_sink_attention": false,
1515
+ "window_length": null
1516
+ },
1517
+ "ffn": {
1518
+ "ffn_mult": null,
1519
+ "no_op": true,
1520
+ "replace_with_linear": false,
1521
+ "sparsify": null
1522
+ }
1523
+ },
1524
+ {
1525
+ "attention": {
1526
+ "n_heads_in_group": null,
1527
+ "no_op": true,
1528
+ "num_sink_tokens": null,
1529
+ "replace_with_linear": false,
1530
+ "sparsify": null,
1531
+ "unshifted_sink": false,
1532
+ "use_prefill_window_in_sink_attention": false,
1533
+ "window_length": null
1534
+ },
1535
+ "ffn": {
1536
+ "ffn_mult": null,
1537
+ "no_op": true,
1538
+ "replace_with_linear": false,
1539
+ "sparsify": null
1540
+ }
1541
+ },
1542
+ {
1543
+ "attention": {
1544
+ "n_heads_in_group": null,
1545
+ "no_op": true,
1546
+ "num_sink_tokens": null,
1547
+ "replace_with_linear": false,
1548
+ "sparsify": null,
1549
+ "unshifted_sink": false,
1550
+ "use_prefill_window_in_sink_attention": false,
1551
+ "window_length": null
1552
+ },
1553
+ "ffn": {
1554
+ "ffn_mult": null,
1555
+ "no_op": true,
1556
+ "replace_with_linear": false,
1557
+ "sparsify": null
1558
+ }
1559
+ },
1560
+ {
1561
+ "attention": {
1562
+ "n_heads_in_group": 16,
1563
+ "no_op": false,
1564
+ "num_sink_tokens": null,
1565
+ "replace_with_linear": false,
1566
+ "sparsify": null,
1567
+ "unshifted_sink": false,
1568
+ "use_prefill_window_in_sink_attention": false,
1569
+ "window_length": null
1570
+ },
1571
+ "ffn": {
1572
+ "ffn_mult": 4.875,
1573
+ "no_op": false,
1574
+ "replace_with_linear": false,
1575
+ "sparsify": null
1576
+ }
1577
+ },
1578
+ {
1579
+ "attention": {
1580
+ "n_heads_in_group": 16,
1581
+ "no_op": false,
1582
+ "num_sink_tokens": null,
1583
+ "replace_with_linear": false,
1584
+ "sparsify": null,
1585
+ "unshifted_sink": false,
1586
+ "use_prefill_window_in_sink_attention": false,
1587
+ "window_length": null
1588
+ },
1589
+ "ffn": {
1590
+ "ffn_mult": 3.4125,
1591
+ "no_op": false,
1592
+ "replace_with_linear": false,
1593
+ "sparsify": null
1594
+ }
1595
+ },
1596
+ {
1597
+ "attention": {
1598
+ "n_heads_in_group": 16,
1599
+ "no_op": false,
1600
+ "num_sink_tokens": null,
1601
+ "replace_with_linear": false,
1602
+ "sparsify": null,
1603
+ "unshifted_sink": false,
1604
+ "use_prefill_window_in_sink_attention": false,
1605
+ "window_length": null
1606
+ },
1607
+ "ffn": {
1608
+ "ffn_mult": 3.4125,
1609
+ "no_op": false,
1610
+ "replace_with_linear": false,
1611
+ "sparsify": null
1612
+ }
1613
+ },
1614
+ {
1615
+ "attention": {
1616
+ "n_heads_in_group": 16,
1617
+ "no_op": false,
1618
+ "num_sink_tokens": null,
1619
+ "replace_with_linear": false,
1620
+ "sparsify": null,
1621
+ "unshifted_sink": false,
1622
+ "use_prefill_window_in_sink_attention": false,
1623
+ "window_length": null
1624
+ },
1625
+ "ffn": {
1626
+ "ffn_mult": 3.4125,
1627
+ "no_op": false,
1628
+ "replace_with_linear": false,
1629
+ "sparsify": null
1630
+ }
1631
+ },
1632
+ {
1633
+ "attention": {
1634
+ "n_heads_in_group": null,
1635
+ "no_op": true,
1636
+ "num_sink_tokens": null,
1637
+ "replace_with_linear": false,
1638
+ "sparsify": null,
1639
+ "unshifted_sink": false,
1640
+ "use_prefill_window_in_sink_attention": false,
1641
+ "window_length": null
1642
+ },
1643
+ "ffn": {
1644
+ "ffn_mult": null,
1645
+ "no_op": true,
1646
+ "replace_with_linear": false,
1647
+ "sparsify": null
1648
+ }
1649
+ },
1650
+ {
1651
+ "attention": {
1652
+ "n_heads_in_group": null,
1653
+ "no_op": true,
1654
+ "num_sink_tokens": null,
1655
+ "replace_with_linear": false,
1656
+ "sparsify": null,
1657
+ "unshifted_sink": false,
1658
+ "use_prefill_window_in_sink_attention": false,
1659
+ "window_length": null
1660
+ },
1661
+ "ffn": {
1662
+ "ffn_mult": null,
1663
+ "no_op": true,
1664
+ "replace_with_linear": false,
1665
+ "sparsify": null
1666
+ }
1667
+ },
1668
+ {
1669
+ "attention": {
1670
+ "n_heads_in_group": 16,
1671
+ "no_op": false,
1672
+ "num_sink_tokens": null,
1673
+ "replace_with_linear": false,
1674
+ "sparsify": null,
1675
+ "unshifted_sink": false,
1676
+ "use_prefill_window_in_sink_attention": false,
1677
+ "window_length": null
1678
+ },
1679
+ "ffn": {
1680
+ "ffn_mult": 2.925,
1681
+ "no_op": false,
1682
+ "replace_with_linear": false,
1683
+ "sparsify": null
1684
+ }
1685
+ },
1686
+ {
1687
+ "attention": {
1688
+ "n_heads_in_group": 16,
1689
+ "no_op": false,
1690
+ "num_sink_tokens": null,
1691
+ "replace_with_linear": false,
1692
+ "sparsify": null,
1693
+ "unshifted_sink": false,
1694
+ "use_prefill_window_in_sink_attention": false,
1695
+ "window_length": null
1696
+ },
1697
+ "ffn": {
1698
+ "ffn_mult": 2.4375,
1699
+ "no_op": false,
1700
+ "replace_with_linear": false,
1701
+ "sparsify": null
1702
+ }
1703
+ },
1704
+ {
1705
+ "attention": {
1706
+ "n_heads_in_group": 16,
1707
+ "no_op": false,
1708
+ "num_sink_tokens": null,
1709
+ "replace_with_linear": false,
1710
+ "sparsify": null,
1711
+ "unshifted_sink": false,
1712
+ "use_prefill_window_in_sink_attention": false,
1713
+ "window_length": null
1714
+ },
1715
+ "ffn": {
1716
+ "ffn_mult": 2.4375,
1717
+ "no_op": false,
1718
+ "replace_with_linear": false,
1719
+ "sparsify": null
1720
+ }
1721
+ },
1722
+ {
1723
+ "attention": {
1724
+ "n_heads_in_group": 16,
1725
+ "no_op": false,
1726
+ "num_sink_tokens": null,
1727
+ "replace_with_linear": false,
1728
+ "sparsify": null,
1729
+ "unshifted_sink": false,
1730
+ "use_prefill_window_in_sink_attention": false,
1731
+ "window_length": null
1732
+ },
1733
+ "ffn": {
1734
+ "ffn_mult": 2.4375,
1735
+ "no_op": false,
1736
+ "replace_with_linear": false,
1737
+ "sparsify": null
1738
+ }
1739
+ },
1740
+ {
1741
+ "attention": {
1742
+ "n_heads_in_group": null,
1743
+ "no_op": true,
1744
+ "num_sink_tokens": null,
1745
+ "replace_with_linear": false,
1746
+ "sparsify": null,
1747
+ "unshifted_sink": false,
1748
+ "use_prefill_window_in_sink_attention": false,
1749
+ "window_length": null
1750
+ },
1751
+ "ffn": {
1752
+ "ffn_mult": 2.4375,
1753
+ "no_op": false,
1754
+ "replace_with_linear": false,
1755
+ "sparsify": null
1756
+ }
1757
+ },
1758
+ {
1759
+ "attention": {
1760
+ "n_heads_in_group": null,
1761
+ "no_op": true,
1762
+ "num_sink_tokens": null,
1763
+ "replace_with_linear": false,
1764
+ "sparsify": null,
1765
+ "unshifted_sink": false,
1766
+ "use_prefill_window_in_sink_attention": false,
1767
+ "window_length": null
1768
+ },
1769
+ "ffn": {
1770
+ "ffn_mult": 2.4375,
1771
+ "no_op": false,
1772
+ "replace_with_linear": false,
1773
+ "sparsify": null
1774
+ }
1775
+ },
1776
+ {
1777
+ "attention": {
1778
+ "n_heads_in_group": 16,
1779
+ "no_op": false,
1780
+ "num_sink_tokens": null,
1781
+ "replace_with_linear": false,
1782
+ "sparsify": null,
1783
+ "unshifted_sink": false,
1784
+ "use_prefill_window_in_sink_attention": false,
1785
+ "window_length": null
1786
+ },
1787
+ "ffn": {
1788
+ "ffn_mult": 2.4375,
1789
+ "no_op": false,
1790
+ "replace_with_linear": false,
1791
+ "sparsify": null
1792
+ }
1793
+ },
1794
+ {
1795
+ "attention": {
1796
+ "n_heads_in_group": null,
1797
+ "no_op": true,
1798
+ "num_sink_tokens": null,
1799
+ "replace_with_linear": false,
1800
+ "sparsify": null,
1801
+ "unshifted_sink": false,
1802
+ "use_prefill_window_in_sink_attention": false,
1803
+ "window_length": null
1804
+ },
1805
+ "ffn": {
1806
+ "ffn_mult": null,
1807
+ "no_op": true,
1808
+ "replace_with_linear": false,
1809
+ "sparsify": null
1810
+ }
1811
+ },
1812
+ {
1813
+ "attention": {
1814
+ "n_heads_in_group": null,
1815
+ "no_op": true,
1816
+ "num_sink_tokens": null,
1817
+ "replace_with_linear": false,
1818
+ "sparsify": null,
1819
+ "unshifted_sink": false,
1820
+ "use_prefill_window_in_sink_attention": false,
1821
+ "window_length": null
1822
+ },
1823
+ "ffn": {
1824
+ "ffn_mult": 2.4375,
1825
+ "no_op": false,
1826
+ "replace_with_linear": false,
1827
+ "sparsify": null
1828
+ }
1829
+ },
1830
+ {
1831
+ "attention": {
1832
+ "n_heads_in_group": null,
1833
+ "no_op": true,
1834
+ "num_sink_tokens": null,
1835
+ "replace_with_linear": false,
1836
+ "sparsify": null,
1837
+ "unshifted_sink": false,
1838
+ "use_prefill_window_in_sink_attention": false,
1839
+ "window_length": null
1840
+ },
1841
+ "ffn": {
1842
+ "ffn_mult": 2.4375,
1843
+ "no_op": false,
1844
+ "replace_with_linear": false,
1845
+ "sparsify": null
1846
+ }
1847
+ },
1848
+ {
1849
+ "attention": {
1850
+ "n_heads_in_group": null,
1851
+ "no_op": true,
1852
+ "num_sink_tokens": null,
1853
+ "replace_with_linear": false,
1854
+ "sparsify": null,
1855
+ "unshifted_sink": false,
1856
+ "use_prefill_window_in_sink_attention": false,
1857
+ "window_length": null
1858
+ },
1859
+ "ffn": {
1860
+ "ffn_mult": 2.4375,
1861
+ "no_op": false,
1862
+ "replace_with_linear": false,
1863
+ "sparsify": null
1864
+ }
1865
+ },
1866
+ {
1867
+ "attention": {
1868
+ "n_heads_in_group": null,
1869
+ "no_op": true,
1870
+ "num_sink_tokens": null,
1871
+ "replace_with_linear": false,
1872
+ "sparsify": null,
1873
+ "unshifted_sink": false,
1874
+ "use_prefill_window_in_sink_attention": false,
1875
+ "window_length": null
1876
+ },
1877
+ "ffn": {
1878
+ "ffn_mult": 2.4375,
1879
+ "no_op": false,
1880
+ "replace_with_linear": false,
1881
+ "sparsify": null
1882
+ }
1883
+ },
1884
+ {
1885
+ "attention": {
1886
+ "n_heads_in_group": null,
1887
+ "no_op": true,
1888
+ "num_sink_tokens": null,
1889
+ "replace_with_linear": false,
1890
+ "sparsify": null,
1891
+ "unshifted_sink": false,
1892
+ "use_prefill_window_in_sink_attention": false,
1893
+ "window_length": null
1894
+ },
1895
+ "ffn": {
1896
+ "ffn_mult": 2.4375,
1897
+ "no_op": false,
1898
+ "replace_with_linear": false,
1899
+ "sparsify": null
1900
+ }
1901
+ },
1902
+ {
1903
+ "attention": {
1904
+ "n_heads_in_group": null,
1905
+ "no_op": true,
1906
+ "num_sink_tokens": null,
1907
+ "replace_with_linear": false,
1908
+ "sparsify": null,
1909
+ "unshifted_sink": false,
1910
+ "use_prefill_window_in_sink_attention": false,
1911
+ "window_length": null
1912
+ },
1913
+ "ffn": {
1914
+ "ffn_mult": 2.4375,
1915
+ "no_op": false,
1916
+ "replace_with_linear": false,
1917
+ "sparsify": null
1918
+ }
1919
+ },
1920
+ {
1921
+ "attention": {
1922
+ "n_heads_in_group": null,
1923
+ "no_op": true,
1924
+ "num_sink_tokens": null,
1925
+ "replace_with_linear": false,
1926
+ "sparsify": null,
1927
+ "unshifted_sink": false,
1928
+ "use_prefill_window_in_sink_attention": false,
1929
+ "window_length": null
1930
+ },
1931
+ "ffn": {
1932
+ "ffn_mult": 2.4375,
1933
+ "no_op": false,
1934
+ "replace_with_linear": false,
1935
+ "sparsify": null
1936
+ }
1937
+ },
1938
+ {
1939
+ "attention": {
1940
+ "n_heads_in_group": 16,
1941
+ "no_op": false,
1942
+ "num_sink_tokens": null,
1943
+ "replace_with_linear": false,
1944
+ "sparsify": null,
1945
+ "unshifted_sink": false,
1946
+ "use_prefill_window_in_sink_attention": false,
1947
+ "window_length": null
1948
+ },
1949
+ "ffn": {
1950
+ "ffn_mult": 2.4375,
1951
+ "no_op": false,
1952
+ "replace_with_linear": false,
1953
+ "sparsify": null
1954
+ }
1955
+ },
1956
+ {
1957
+ "attention": {
1958
+ "n_heads_in_group": null,
1959
+ "no_op": true,
1960
+ "num_sink_tokens": null,
1961
+ "replace_with_linear": false,
1962
+ "sparsify": null,
1963
+ "unshifted_sink": false,
1964
+ "use_prefill_window_in_sink_attention": false,
1965
+ "window_length": null
1966
+ },
1967
+ "ffn": {
1968
+ "ffn_mult": null,
1969
+ "no_op": true,
1970
+ "replace_with_linear": false,
1971
+ "sparsify": null
1972
+ }
1973
+ },
1974
+ {
1975
+ "attention": {
1976
+ "n_heads_in_group": null,
1977
+ "no_op": true,
1978
+ "num_sink_tokens": null,
1979
+ "replace_with_linear": false,
1980
+ "sparsify": null,
1981
+ "unshifted_sink": false,
1982
+ "use_prefill_window_in_sink_attention": false,
1983
+ "window_length": null
1984
+ },
1985
+ "ffn": {
1986
+ "ffn_mult": null,
1987
+ "no_op": true,
1988
+ "replace_with_linear": false,
1989
+ "sparsify": null
1990
+ }
1991
+ },
1992
+ {
1993
+ "attention": {
1994
+ "n_heads_in_group": null,
1995
+ "no_op": true,
1996
+ "num_sink_tokens": null,
1997
+ "replace_with_linear": false,
1998
+ "sparsify": null,
1999
+ "unshifted_sink": false,
2000
+ "use_prefill_window_in_sink_attention": false,
2001
+ "window_length": null
2002
+ },
2003
+ "ffn": {
2004
+ "ffn_mult": null,
2005
+ "no_op": true,
2006
+ "replace_with_linear": false,
2007
+ "sparsify": null
2008
+ }
2009
+ },
2010
+ {
2011
+ "attention": {
2012
+ "n_heads_in_group": null,
2013
+ "no_op": true,
2014
+ "num_sink_tokens": null,
2015
+ "replace_with_linear": false,
2016
+ "sparsify": null,
2017
+ "unshifted_sink": false,
2018
+ "use_prefill_window_in_sink_attention": false,
2019
+ "window_length": null
2020
+ },
2021
+ "ffn": {
2022
+ "ffn_mult": null,
2023
+ "no_op": true,
2024
+ "replace_with_linear": false,
2025
+ "sparsify": null
2026
+ }
2027
+ },
2028
+ {
2029
+ "attention": {
2030
+ "n_heads_in_group": null,
2031
+ "no_op": true,
2032
+ "num_sink_tokens": null,
2033
+ "replace_with_linear": false,
2034
+ "sparsify": null,
2035
+ "unshifted_sink": false,
2036
+ "use_prefill_window_in_sink_attention": false,
2037
+ "window_length": null
2038
+ },
2039
+ "ffn": {
2040
+ "ffn_mult": null,
2041
+ "no_op": true,
2042
+ "replace_with_linear": false,
2043
+ "sparsify": null
2044
+ }
2045
+ },
2046
+ {
2047
+ "attention": {
2048
+ "n_heads_in_group": 16,
2049
+ "no_op": false,
2050
+ "num_sink_tokens": null,
2051
+ "replace_with_linear": false,
2052
+ "sparsify": null,
2053
+ "unshifted_sink": false,
2054
+ "use_prefill_window_in_sink_attention": false,
2055
+ "window_length": null
2056
+ },
2057
+ "ffn": {
2058
+ "ffn_mult": 2.925,
2059
+ "no_op": false,
2060
+ "replace_with_linear": false,
2061
+ "sparsify": null
2062
+ }
2063
+ },
2064
+ {
2065
+ "attention": {
2066
+ "n_heads_in_group": 16,
2067
+ "no_op": false,
2068
+ "num_sink_tokens": null,
2069
+ "replace_with_linear": false,
2070
+ "sparsify": null,
2071
+ "unshifted_sink": false,
2072
+ "use_prefill_window_in_sink_attention": false,
2073
+ "window_length": null
2074
+ },
2075
+ "ffn": {
2076
+ "ffn_mult": 4.875,
2077
+ "no_op": false,
2078
+ "replace_with_linear": false,
2079
+ "sparsify": null
2080
+ }
2081
+ },
2082
+ {
2083
+ "attention": {
2084
+ "n_heads_in_group": null,
2085
+ "no_op": true,
2086
+ "num_sink_tokens": null,
2087
+ "replace_with_linear": false,
2088
+ "sparsify": null,
2089
+ "unshifted_sink": false,
2090
+ "use_prefill_window_in_sink_attention": false,
2091
+ "window_length": null
2092
+ },
2093
+ "ffn": {
2094
+ "ffn_mult": 4.875,
2095
+ "no_op": false,
2096
+ "replace_with_linear": false,
2097
+ "sparsify": null
2098
+ }
2099
+ },
2100
+ {
2101
+ "attention": {
2102
+ "n_heads_in_group": 16,
2103
+ "no_op": false,
2104
+ "num_sink_tokens": null,
2105
+ "replace_with_linear": false,
2106
+ "sparsify": null,
2107
+ "unshifted_sink": false,
2108
+ "use_prefill_window_in_sink_attention": false,
2109
+ "window_length": null
2110
+ },
2111
+ "ffn": {
2112
+ "ffn_mult": 4.875,
2113
+ "no_op": false,
2114
+ "replace_with_linear": false,
2115
+ "sparsify": null
2116
+ }
2117
+ },
2118
+ {
2119
+ "attention": {
2120
+ "n_heads_in_group": null,
2121
+ "no_op": true,
2122
+ "num_sink_tokens": null,
2123
+ "replace_with_linear": false,
2124
+ "sparsify": null,
2125
+ "unshifted_sink": false,
2126
+ "use_prefill_window_in_sink_attention": false,
2127
+ "window_length": null
2128
+ },
2129
+ "ffn": {
2130
+ "ffn_mult": null,
2131
+ "no_op": true,
2132
+ "replace_with_linear": false,
2133
+ "sparsify": null
2134
+ }
2135
+ },
2136
+ {
2137
+ "attention": {
2138
+ "n_heads_in_group": null,
2139
+ "no_op": true,
2140
+ "num_sink_tokens": null,
2141
+ "replace_with_linear": false,
2142
+ "sparsify": null,
2143
+ "unshifted_sink": false,
2144
+ "use_prefill_window_in_sink_attention": false,
2145
+ "window_length": null
2146
+ },
2147
+ "ffn": {
2148
+ "ffn_mult": null,
2149
+ "no_op": true,
2150
+ "replace_with_linear": false,
2151
+ "sparsify": null
2152
+ }
2153
+ },
2154
+ {
2155
+ "attention": {
2156
+ "n_heads_in_group": null,
2157
+ "no_op": true,
2158
+ "num_sink_tokens": null,
2159
+ "replace_with_linear": false,
2160
+ "sparsify": null,
2161
+ "unshifted_sink": false,
2162
+ "use_prefill_window_in_sink_attention": false,
2163
+ "window_length": null
2164
+ },
2165
+ "ffn": {
2166
+ "ffn_mult": null,
2167
+ "no_op": true,
2168
+ "replace_with_linear": false,
2169
+ "sparsify": null
2170
+ }
2171
+ },
2172
+ {
2173
+ "attention": {
2174
+ "n_heads_in_group": null,
2175
+ "no_op": true,
2176
+ "num_sink_tokens": null,
2177
+ "replace_with_linear": false,
2178
+ "sparsify": null,
2179
+ "unshifted_sink": false,
2180
+ "use_prefill_window_in_sink_attention": false,
2181
+ "window_length": null
2182
+ },
2183
+ "ffn": {
2184
+ "ffn_mult": null,
2185
+ "no_op": true,
2186
+ "replace_with_linear": false,
2187
+ "sparsify": null
2188
+ }
2189
+ },
2190
+ {
2191
+ "attention": {
2192
+ "n_heads_in_group": null,
2193
+ "no_op": true,
2194
+ "num_sink_tokens": null,
2195
+ "replace_with_linear": false,
2196
+ "sparsify": null,
2197
+ "unshifted_sink": false,
2198
+ "use_prefill_window_in_sink_attention": false,
2199
+ "window_length": null
2200
+ },
2201
+ "ffn": {
2202
+ "ffn_mult": null,
2203
+ "no_op": true,
2204
+ "replace_with_linear": false,
2205
+ "sparsify": null
2206
+ }
2207
+ },
2208
+ {
2209
+ "attention": {
2210
+ "n_heads_in_group": null,
2211
+ "no_op": true,
2212
+ "num_sink_tokens": null,
2213
+ "replace_with_linear": false,
2214
+ "sparsify": null,
2215
+ "unshifted_sink": false,
2216
+ "use_prefill_window_in_sink_attention": false,
2217
+ "window_length": null
2218
+ },
2219
+ "ffn": {
2220
+ "ffn_mult": null,
2221
+ "no_op": true,
2222
+ "replace_with_linear": false,
2223
+ "sparsify": null
2224
+ }
2225
+ },
2226
+ {
2227
+ "attention": {
2228
+ "n_heads_in_group": null,
2229
+ "no_op": true,
2230
+ "num_sink_tokens": null,
2231
+ "replace_with_linear": false,
2232
+ "sparsify": null,
2233
+ "unshifted_sink": false,
2234
+ "use_prefill_window_in_sink_attention": false,
2235
+ "window_length": null
2236
+ },
2237
+ "ffn": {
2238
+ "ffn_mult": null,
2239
+ "no_op": true,
2240
+ "replace_with_linear": false,
2241
+ "sparsify": null
2242
+ }
2243
+ },
2244
+ {
2245
+ "attention": {
2246
+ "n_heads_in_group": null,
2247
+ "no_op": true,
2248
+ "num_sink_tokens": null,
2249
+ "replace_with_linear": false,
2250
+ "sparsify": null,
2251
+ "unshifted_sink": false,
2252
+ "use_prefill_window_in_sink_attention": false,
2253
+ "window_length": null
2254
+ },
2255
+ "ffn": {
2256
+ "ffn_mult": null,
2257
+ "no_op": true,
2258
+ "replace_with_linear": false,
2259
+ "sparsify": null
2260
+ }
2261
+ },
2262
+ {
2263
+ "attention": {
2264
+ "n_heads_in_group": null,
2265
+ "no_op": true,
2266
+ "num_sink_tokens": null,
2267
+ "replace_with_linear": false,
2268
+ "sparsify": null,
2269
+ "unshifted_sink": false,
2270
+ "use_prefill_window_in_sink_attention": false,
2271
+ "window_length": null
2272
+ },
2273
+ "ffn": {
2274
+ "ffn_mult": 36.5625,
2275
+ "no_op": false,
2276
+ "replace_with_linear": false,
2277
+ "sparsify": null
2278
+ }
2279
+ },
2280
+ {
2281
+ "attention": {
2282
+ "n_heads_in_group": null,
2283
+ "no_op": true,
2284
+ "num_sink_tokens": null,
2285
+ "replace_with_linear": false,
2286
+ "sparsify": null,
2287
+ "unshifted_sink": false,
2288
+ "use_prefill_window_in_sink_attention": false,
2289
+ "window_length": null
2290
+ },
2291
+ "ffn": {
2292
+ "ffn_mult": null,
2293
+ "no_op": true,
2294
+ "replace_with_linear": false,
2295
+ "sparsify": null
2296
+ }
2297
+ },
2298
+ {
2299
+ "attention": {
2300
+ "n_heads_in_group": null,
2301
+ "no_op": true,
2302
+ "num_sink_tokens": null,
2303
+ "replace_with_linear": false,
2304
+ "sparsify": null,
2305
+ "unshifted_sink": false,
2306
+ "use_prefill_window_in_sink_attention": false,
2307
+ "window_length": null
2308
+ },
2309
+ "ffn": {
2310
+ "ffn_mult": null,
2311
+ "no_op": true,
2312
+ "replace_with_linear": false,
2313
+ "sparsify": null
2314
+ }
2315
+ },
2316
+ {
2317
+ "attention": {
2318
+ "n_heads_in_group": null,
2319
+ "no_op": true,
2320
+ "num_sink_tokens": null,
2321
+ "replace_with_linear": false,
2322
+ "sparsify": null,
2323
+ "unshifted_sink": false,
2324
+ "use_prefill_window_in_sink_attention": false,
2325
+ "window_length": null
2326
+ },
2327
+ "ffn": {
2328
+ "ffn_mult": null,
2329
+ "no_op": true,
2330
+ "replace_with_linear": false,
2331
+ "sparsify": null
2332
+ }
2333
+ },
2334
+ {
2335
+ "attention": {
2336
+ "n_heads_in_group": null,
2337
+ "no_op": true,
2338
+ "num_sink_tokens": null,
2339
+ "replace_with_linear": false,
2340
+ "sparsify": null,
2341
+ "unshifted_sink": false,
2342
+ "use_prefill_window_in_sink_attention": false,
2343
+ "window_length": null
2344
+ },
2345
+ "ffn": {
2346
+ "ffn_mult": null,
2347
+ "no_op": true,
2348
+ "replace_with_linear": false,
2349
+ "sparsify": null
2350
+ }
2351
+ },
2352
+ {
2353
+ "attention": {
2354
+ "n_heads_in_group": null,
2355
+ "no_op": true,
2356
+ "num_sink_tokens": null,
2357
+ "replace_with_linear": false,
2358
+ "sparsify": null,
2359
+ "unshifted_sink": false,
2360
+ "use_prefill_window_in_sink_attention": false,
2361
+ "window_length": null
2362
+ },
2363
+ "ffn": {
2364
+ "ffn_mult": null,
2365
+ "no_op": true,
2366
+ "replace_with_linear": false,
2367
+ "sparsify": null
2368
+ }
2369
+ },
2370
+ {
2371
+ "attention": {
2372
+ "n_heads_in_group": null,
2373
+ "no_op": true,
2374
+ "num_sink_tokens": null,
2375
+ "replace_with_linear": false,
2376
+ "sparsify": null,
2377
+ "unshifted_sink": false,
2378
+ "use_prefill_window_in_sink_attention": false,
2379
+ "window_length": null
2380
+ },
2381
+ "ffn": {
2382
+ "ffn_mult": null,
2383
+ "no_op": true,
2384
+ "replace_with_linear": false,
2385
+ "sparsify": null
2386
+ }
2387
+ },
2388
+ {
2389
+ "attention": {
2390
+ "n_heads_in_group": null,
2391
+ "no_op": true,
2392
+ "num_sink_tokens": null,
2393
+ "replace_with_linear": false,
2394
+ "sparsify": null,
2395
+ "unshifted_sink": false,
2396
+ "use_prefill_window_in_sink_attention": false,
2397
+ "window_length": null
2398
+ },
2399
+ "ffn": {
2400
+ "ffn_mult": null,
2401
+ "no_op": true,
2402
+ "replace_with_linear": false,
2403
+ "sparsify": null
2404
+ }
2405
+ },
2406
+ {
2407
+ "attention": {
2408
+ "n_heads_in_group": null,
2409
+ "no_op": true,
2410
+ "num_sink_tokens": null,
2411
+ "replace_with_linear": false,
2412
+ "sparsify": null,
2413
+ "unshifted_sink": false,
2414
+ "use_prefill_window_in_sink_attention": false,
2415
+ "window_length": null
2416
+ },
2417
+ "ffn": {
2418
+ "ffn_mult": null,
2419
+ "no_op": true,
2420
+ "replace_with_linear": false,
2421
+ "sparsify": null
2422
+ }
2423
+ },
2424
+ {
2425
+ "attention": {
2426
+ "n_heads_in_group": null,
2427
+ "no_op": true,
2428
+ "num_sink_tokens": null,
2429
+ "replace_with_linear": false,
2430
+ "sparsify": null,
2431
+ "unshifted_sink": false,
2432
+ "use_prefill_window_in_sink_attention": false,
2433
+ "window_length": null
2434
+ },
2435
+ "ffn": {
2436
+ "ffn_mult": 39.0,
2437
+ "no_op": false,
2438
+ "replace_with_linear": false,
2439
+ "sparsify": null
2440
+ }
2441
+ },
2442
+ {
2443
+ "attention": {
2444
+ "n_heads_in_group": null,
2445
+ "no_op": true,
2446
+ "num_sink_tokens": null,
2447
+ "replace_with_linear": false,
2448
+ "sparsify": null,
2449
+ "unshifted_sink": false,
2450
+ "use_prefill_window_in_sink_attention": false,
2451
+ "window_length": null
2452
+ },
2453
+ "ffn": {
2454
+ "ffn_mult": null,
2455
+ "no_op": true,
2456
+ "replace_with_linear": false,
2457
+ "sparsify": null
2458
+ }
2459
+ },
2460
+ {
2461
+ "attention": {
2462
+ "n_heads_in_group": null,
2463
+ "no_op": true,
2464
+ "num_sink_tokens": null,
2465
+ "replace_with_linear": false,
2466
+ "sparsify": null,
2467
+ "unshifted_sink": false,
2468
+ "use_prefill_window_in_sink_attention": false,
2469
+ "window_length": null
2470
+ },
2471
+ "ffn": {
2472
+ "ffn_mult": null,
2473
+ "no_op": true,
2474
+ "replace_with_linear": false,
2475
+ "sparsify": null
2476
+ }
2477
+ },
2478
+ {
2479
+ "attention": {
2480
+ "n_heads_in_group": null,
2481
+ "no_op": true,
2482
+ "num_sink_tokens": null,
2483
+ "replace_with_linear": false,
2484
+ "sparsify": null,
2485
+ "unshifted_sink": false,
2486
+ "use_prefill_window_in_sink_attention": false,
2487
+ "window_length": null
2488
+ },
2489
+ "ffn": {
2490
+ "ffn_mult": null,
2491
+ "no_op": true,
2492
+ "replace_with_linear": false,
2493
+ "sparsify": null
2494
+ }
2495
+ },
2496
+ {
2497
+ "attention": {
2498
+ "n_heads_in_group": null,
2499
+ "no_op": true,
2500
+ "num_sink_tokens": null,
2501
+ "replace_with_linear": false,
2502
+ "sparsify": null,
2503
+ "unshifted_sink": false,
2504
+ "use_prefill_window_in_sink_attention": false,
2505
+ "window_length": null
2506
+ },
2507
+ "ffn": {
2508
+ "ffn_mult": null,
2509
+ "no_op": true,
2510
+ "replace_with_linear": false,
2511
+ "sparsify": null
2512
+ }
2513
+ },
2514
+ {
2515
+ "attention": {
2516
+ "n_heads_in_group": null,
2517
+ "no_op": true,
2518
+ "num_sink_tokens": null,
2519
+ "replace_with_linear": false,
2520
+ "sparsify": null,
2521
+ "unshifted_sink": false,
2522
+ "use_prefill_window_in_sink_attention": false,
2523
+ "window_length": null
2524
+ },
2525
+ "ffn": {
2526
+ "ffn_mult": null,
2527
+ "no_op": true,
2528
+ "replace_with_linear": false,
2529
+ "sparsify": null
2530
+ }
2531
+ },
2532
+ {
2533
+ "attention": {
2534
+ "n_heads_in_group": null,
2535
+ "no_op": true,
2536
+ "num_sink_tokens": null,
2537
+ "replace_with_linear": false,
2538
+ "sparsify": null,
2539
+ "unshifted_sink": false,
2540
+ "use_prefill_window_in_sink_attention": false,
2541
+ "window_length": null
2542
+ },
2543
+ "ffn": {
2544
+ "ffn_mult": null,
2545
+ "no_op": true,
2546
+ "replace_with_linear": false,
2547
+ "sparsify": null
2548
+ }
2549
+ },
2550
+ {
2551
+ "attention": {
2552
+ "n_heads_in_group": null,
2553
+ "no_op": true,
2554
+ "num_sink_tokens": null,
2555
+ "replace_with_linear": false,
2556
+ "sparsify": null,
2557
+ "unshifted_sink": false,
2558
+ "use_prefill_window_in_sink_attention": false,
2559
+ "window_length": null
2560
+ },
2561
+ "ffn": {
2562
+ "ffn_mult": null,
2563
+ "no_op": true,
2564
+ "replace_with_linear": false,
2565
+ "sparsify": null
2566
+ }
2567
+ },
2568
+ {
2569
+ "attention": {
2570
+ "n_heads_in_group": null,
2571
+ "no_op": true,
2572
+ "num_sink_tokens": null,
2573
+ "replace_with_linear": false,
2574
+ "sparsify": null,
2575
+ "unshifted_sink": false,
2576
+ "use_prefill_window_in_sink_attention": false,
2577
+ "window_length": null
2578
+ },
2579
+ "ffn": {
2580
+ "ffn_mult": null,
2581
+ "no_op": true,
2582
+ "replace_with_linear": false,
2583
+ "sparsify": null
2584
+ }
2585
+ },
2586
+ {
2587
+ "attention": {
2588
+ "n_heads_in_group": null,
2589
+ "no_op": true,
2590
+ "num_sink_tokens": null,
2591
+ "replace_with_linear": false,
2592
+ "sparsify": null,
2593
+ "unshifted_sink": false,
2594
+ "use_prefill_window_in_sink_attention": false,
2595
+ "window_length": null
2596
+ },
2597
+ "ffn": {
2598
+ "ffn_mult": 31.40625,
2599
+ "no_op": false,
2600
+ "replace_with_linear": false,
2601
+ "sparsify": null
2602
+ }
2603
+ },
2604
+ {
2605
+ "attention": {
2606
+ "n_heads_in_group": null,
2607
+ "no_op": true,
2608
+ "num_sink_tokens": null,
2609
+ "replace_with_linear": false,
2610
+ "sparsify": null,
2611
+ "unshifted_sink": false,
2612
+ "use_prefill_window_in_sink_attention": false,
2613
+ "window_length": null
2614
+ },
2615
+ "ffn": {
2616
+ "ffn_mult": null,
2617
+ "no_op": true,
2618
+ "replace_with_linear": false,
2619
+ "sparsify": null
2620
+ }
2621
+ },
2622
+ {
2623
+ "attention": {
2624
+ "n_heads_in_group": null,
2625
+ "no_op": true,
2626
+ "num_sink_tokens": null,
2627
+ "replace_with_linear": false,
2628
+ "sparsify": null,
2629
+ "unshifted_sink": false,
2630
+ "use_prefill_window_in_sink_attention": false,
2631
+ "window_length": null
2632
+ },
2633
+ "ffn": {
2634
+ "ffn_mult": null,
2635
+ "no_op": true,
2636
+ "replace_with_linear": false,
2637
+ "sparsify": null
2638
+ }
2639
+ },
2640
+ {
2641
+ "attention": {
2642
+ "n_heads_in_group": null,
2643
+ "no_op": true,
2644
+ "num_sink_tokens": null,
2645
+ "replace_with_linear": false,
2646
+ "sparsify": null,
2647
+ "unshifted_sink": false,
2648
+ "use_prefill_window_in_sink_attention": false,
2649
+ "window_length": null
2650
+ },
2651
+ "ffn": {
2652
+ "ffn_mult": null,
2653
+ "no_op": true,
2654
+ "replace_with_linear": false,
2655
+ "sparsify": null
2656
+ }
2657
+ },
2658
+ {
2659
+ "attention": {
2660
+ "n_heads_in_group": null,
2661
+ "no_op": true,
2662
+ "num_sink_tokens": null,
2663
+ "replace_with_linear": false,
2664
+ "sparsify": null,
2665
+ "unshifted_sink": false,
2666
+ "use_prefill_window_in_sink_attention": false,
2667
+ "window_length": null
2668
+ },
2669
+ "ffn": {
2670
+ "ffn_mult": null,
2671
+ "no_op": true,
2672
+ "replace_with_linear": false,
2673
+ "sparsify": null
2674
+ }
2675
+ },
2676
+ {
2677
+ "attention": {
2678
+ "n_heads_in_group": null,
2679
+ "no_op": true,
2680
+ "num_sink_tokens": null,
2681
+ "replace_with_linear": false,
2682
+ "sparsify": null,
2683
+ "unshifted_sink": false,
2684
+ "use_prefill_window_in_sink_attention": false,
2685
+ "window_length": null
2686
+ },
2687
+ "ffn": {
2688
+ "ffn_mult": null,
2689
+ "no_op": true,
2690
+ "replace_with_linear": false,
2691
+ "sparsify": null
2692
+ }
2693
+ },
2694
+ {
2695
+ "attention": {
2696
+ "n_heads_in_group": null,
2697
+ "no_op": true,
2698
+ "num_sink_tokens": null,
2699
+ "replace_with_linear": false,
2700
+ "sparsify": null,
2701
+ "unshifted_sink": false,
2702
+ "use_prefill_window_in_sink_attention": false,
2703
+ "window_length": null
2704
+ },
2705
+ "ffn": {
2706
+ "ffn_mult": 27.5625,
2707
+ "no_op": false,
2708
+ "replace_with_linear": false,
2709
+ "sparsify": null
2710
+ }
2711
+ },
2712
+ {
2713
+ "attention": {
2714
+ "n_heads_in_group": null,
2715
+ "no_op": true,
2716
+ "num_sink_tokens": null,
2717
+ "replace_with_linear": false,
2718
+ "sparsify": null,
2719
+ "unshifted_sink": false,
2720
+ "use_prefill_window_in_sink_attention": false,
2721
+ "window_length": null
2722
+ },
2723
+ "ffn": {
2724
+ "ffn_mult": 1.95,
2725
+ "no_op": false,
2726
+ "replace_with_linear": false,
2727
+ "sparsify": null
2728
+ }
2729
+ },
2730
+ {
2731
+ "attention": {
2732
+ "n_heads_in_group": 16,
2733
+ "no_op": false,
2734
+ "num_sink_tokens": null,
2735
+ "replace_with_linear": false,
2736
+ "sparsify": null,
2737
+ "unshifted_sink": false,
2738
+ "use_prefill_window_in_sink_attention": false,
2739
+ "window_length": null
2740
+ },
2741
+ "ffn": {
2742
+ "ffn_mult": 1.95,
2743
+ "no_op": false,
2744
+ "replace_with_linear": false,
2745
+ "sparsify": null
2746
+ }
2747
+ },
2748
+ {
2749
+ "attention": {
2750
+ "n_heads_in_group": 16,
2751
+ "no_op": false,
2752
+ "num_sink_tokens": null,
2753
+ "replace_with_linear": false,
2754
+ "sparsify": null,
2755
+ "unshifted_sink": false,
2756
+ "use_prefill_window_in_sink_attention": false,
2757
+ "window_length": null
2758
+ },
2759
+ "ffn": {
2760
+ "ffn_mult": 2.4375,
2761
+ "no_op": false,
2762
+ "replace_with_linear": false,
2763
+ "sparsify": null
2764
+ }
2765
+ },
2766
+ {
2767
+ "attention": {
2768
+ "n_heads_in_group": null,
2769
+ "no_op": true,
2770
+ "num_sink_tokens": null,
2771
+ "replace_with_linear": false,
2772
+ "sparsify": null,
2773
+ "unshifted_sink": false,
2774
+ "use_prefill_window_in_sink_attention": false,
2775
+ "window_length": null
2776
+ },
2777
+ "ffn": {
2778
+ "ffn_mult": null,
2779
+ "no_op": true,
2780
+ "replace_with_linear": false,
2781
+ "sparsify": null
2782
+ }
2783
+ },
2784
+ {
2785
+ "attention": {
2786
+ "n_heads_in_group": 16,
2787
+ "no_op": false,
2788
+ "num_sink_tokens": null,
2789
+ "replace_with_linear": false,
2790
+ "sparsify": null,
2791
+ "unshifted_sink": false,
2792
+ "use_prefill_window_in_sink_attention": false,
2793
+ "window_length": null
2794
+ },
2795
+ "ffn": {
2796
+ "ffn_mult": 2.4375,
2797
+ "no_op": false,
2798
+ "replace_with_linear": false,
2799
+ "sparsify": null
2800
+ }
2801
+ },
2802
+ {
2803
+ "attention": {
2804
+ "n_heads_in_group": 16,
2805
+ "no_op": false,
2806
+ "num_sink_tokens": null,
2807
+ "replace_with_linear": false,
2808
+ "sparsify": null,
2809
+ "unshifted_sink": false,
2810
+ "use_prefill_window_in_sink_attention": false,
2811
+ "window_length": null
2812
+ },
2813
+ "ffn": {
2814
+ "ffn_mult": 2.4375,
2815
+ "no_op": false,
2816
+ "replace_with_linear": false,
2817
+ "sparsify": null
2818
+ }
2819
+ },
2820
+ {
2821
+ "attention": {
2822
+ "n_heads_in_group": 16,
2823
+ "no_op": false,
2824
+ "num_sink_tokens": null,
2825
+ "replace_with_linear": false,
2826
+ "sparsify": null,
2827
+ "unshifted_sink": false,
2828
+ "use_prefill_window_in_sink_attention": false,
2829
+ "window_length": null
2830
+ },
2831
+ "ffn": {
2832
+ "ffn_mult": 3.4125,
2833
+ "no_op": false,
2834
+ "replace_with_linear": false,
2835
+ "sparsify": null
2836
+ }
2837
+ },
2838
+ {
2839
+ "attention": {
2840
+ "n_heads_in_group": 16,
2841
+ "no_op": false,
2842
+ "num_sink_tokens": null,
2843
+ "replace_with_linear": false,
2844
+ "sparsify": null,
2845
+ "unshifted_sink": false,
2846
+ "use_prefill_window_in_sink_attention": false,
2847
+ "window_length": null
2848
+ },
2849
+ "ffn": {
2850
+ "ffn_mult": 4.875,
2851
+ "no_op": false,
2852
+ "replace_with_linear": false,
2853
+ "sparsify": null
2854
+ }
2855
+ },
2856
+ {
2857
+ "attention": {
2858
+ "n_heads_in_group": 16,
2859
+ "no_op": false,
2860
+ "num_sink_tokens": null,
2861
+ "replace_with_linear": false,
2862
+ "sparsify": null,
2863
+ "unshifted_sink": false,
2864
+ "use_prefill_window_in_sink_attention": false,
2865
+ "window_length": null
2866
+ },
2867
+ "ffn": {
2868
+ "ffn_mult": 4.875,
2869
+ "no_op": false,
2870
+ "replace_with_linear": false,
2871
+ "sparsify": null
2872
+ }
2873
+ },
2874
+ {
2875
+ "attention": {
2876
+ "n_heads_in_group": 16,
2877
+ "no_op": false,
2878
+ "num_sink_tokens": null,
2879
+ "replace_with_linear": false,
2880
+ "sparsify": null,
2881
+ "unshifted_sink": false,
2882
+ "use_prefill_window_in_sink_attention": false,
2883
+ "window_length": null
2884
+ },
2885
+ "ffn": {
2886
+ "ffn_mult": 4.875,
2887
+ "no_op": false,
2888
+ "replace_with_linear": false,
2889
+ "sparsify": null
2890
+ }
2891
+ },
2892
+ {
2893
+ "attention": {
2894
+ "n_heads_in_group": 16,
2895
+ "no_op": false,
2896
+ "num_sink_tokens": null,
2897
+ "replace_with_linear": false,
2898
+ "sparsify": null,
2899
+ "unshifted_sink": false,
2900
+ "use_prefill_window_in_sink_attention": false,
2901
+ "window_length": null
2902
+ },
2903
+ "ffn": {
2904
+ "ffn_mult": 4.875,
2905
+ "no_op": false,
2906
+ "replace_with_linear": false,
2907
+ "sparsify": null
2908
+ }
2909
+ },
2910
+ {
2911
+ "attention": {
2912
+ "n_heads_in_group": 16,
2913
+ "no_op": false,
2914
+ "num_sink_tokens": null,
2915
+ "replace_with_linear": false,
2916
+ "sparsify": null,
2917
+ "unshifted_sink": false,
2918
+ "use_prefill_window_in_sink_attention": false,
2919
+ "window_length": null
2920
+ },
2921
+ "ffn": {
2922
+ "ffn_mult": 2.4375,
2923
+ "no_op": false,
2924
+ "replace_with_linear": false,
2925
+ "sparsify": null
2926
+ }
2927
+ }
2928
+ ],
2929
+ "bos_token_id": 128000,
2930
+ "eos_token_id": [
2931
+ 128001,
2932
+ 128008,
2933
+ 128009
2934
+ ],
2935
+ "hidden_act": "silu",
2936
+ "hidden_size": 16384,
2937
+ "initializer_range": 0.02,
2938
+ "intermediate_size": null,
2939
+ "max_position_embeddings": 131072,
2940
+ "mlp_bias": false,
2941
+ "model_type": "nemotron-nas",
2942
+ "num_attention_heads": 128,
2943
+ "num_hidden_layers": 162,
2944
+ "num_key_value_heads": null,
2945
+ "pretraining_tp": 1,
2946
+ "quantization": {
2947
+ "group_size": 64,
2948
+ "bits": 5
2949
+ },
2950
+ "quantization_config": {
2951
+ "group_size": 64,
2952
+ "bits": 5
2953
+ },
2954
+ "rms_norm_eps": 1e-05,
2955
+ "rope_scaling": {
2956
+ "factor": 16.0,
2957
+ "high_freq_factor": 4.0,
2958
+ "low_freq_factor": 1.0,
2959
+ "original_max_position_embeddings": 8192,
2960
+ "rope_type": "llama3"
2961
+ },
2962
+ "rope_theta": 500000.0,
2963
+ "tie_word_embeddings": false,
2964
+ "torch_dtype": "bfloat16",
2965
+ "transformers_version": "4.45.1",
2966
+ "use_cache": true,
2967
+ "vocab_size": 128256
2968
+ }
configuration_decilm.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 Nvidia Corporation. All rights reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import dataclasses
17
+ import warnings
18
+ from typing import Dict, Any
19
+
20
+ from transformers.utils import is_flash_attn_2_available
21
+
22
+ from .block_config import BlockConfig
23
+ from .transformers_4_44_2__configuration_llama import LlamaConfig
24
+ from .transformers_4_44_2__modeling_rope_utils import \
25
+ rope_config_validation # fake import to make AutoConfig infer the dependency
26
+
27
+ rope_config_validation # this line is here to make sure that auto-formatting doesn't remove the import
28
+
29
+
30
+ class DeciLMConfig(LlamaConfig):
31
+ model_type = "nemotron-nas"
32
+
33
+ def __init__(
34
+ self,
35
+ block_configs: list[dict] | list[BlockConfig] = None,
36
+ **kwargs,
37
+ ):
38
+ attn_implementation = kwargs.pop("attn_implementation", None)
39
+ if attn_implementation is None and is_flash_attn_2_available():
40
+ attn_implementation = "flash_attention_2"
41
+
42
+ if block_configs is not None:
43
+ if isinstance(block_configs[0], dict):
44
+ block_configs = [BlockConfig(**conf) for conf in block_configs]
45
+
46
+ using_unshifted_sink = any([block_config.attention.unshifted_sink for block_config in block_configs])
47
+ if using_unshifted_sink and attn_implementation != "eager":
48
+ warnings.warn("Forcing attn_implementation='eager' since some attention layers use unshifted sink")
49
+ attn_implementation = "eager"
50
+
51
+ super().__init__(attn_implementation=attn_implementation, **kwargs)
52
+
53
+ self.intermediate_size = None
54
+ self.num_key_value_heads = None
55
+
56
+ if block_configs is not None:
57
+ assert len(block_configs) == self.num_hidden_layers
58
+
59
+ self.block_configs: list[BlockConfig] = block_configs
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ self_dict = super().to_dict()
63
+ if self.block_configs is not None:
64
+ self_dict["block_configs"] = [dataclasses.asdict(conf) for conf in self.block_configs]
65
+ return self_dict
model-00001-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d49f61929c79acd544495b219f27257be094ae251e5206136dcba28c8e25abfe
3
+ size 5222511151
model-00002-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce0189b3649ca44846ddb38c2cd7b644e44dd580aaa5c1e3202d291b6396115b
3
+ size 5170607401
model-00003-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa0540d8726c212be8f6395689e091b5713611146a652d717a11e0ad6b83aba7
3
+ size 5063845654
model-00004-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c0ef1028792ea404fde65c1a39222227feb4183dbd303da38fcb02203f3eb91
3
+ size 4982969933
model-00005-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e385ea5ecd094a244d7adf21d424a0b6d34a5f89c7b797e3bc0430d06aa38ed5
3
+ size 4982969913
model-00006-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2cfff97517254a550b9c394798479da68287f4a11b13e0e9688ac0be0f20e6cf
3
+ size 5366782906
model-00007-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5a0817b9759c38492e3aac93360f4af9bff66fd35815a2b66c4ea3015a5f4cb
3
+ size 5366918587
model-00008-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f384e885337a13ed9eb3c63130309b7b1164a9401e605b5b481361a7dd34a2f
3
+ size 5207364379
model-00009-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4bfc9059e4703389eb9ddca329a479243261ef128ae1a936d2ca64111a46e3c
3
+ size 5366782890
model-00010-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa876744b1888ba4f9bbb07b7cf892b29f01fa43d00a75ceeaf17300918e78ca
3
+ size 4991391523
model-00011-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2bf6ea9cf567d1fdd5fa557285510d5fd745c949140f905d9fcfadb55972521
3
+ size 4982969919
model-00012-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:564cde10363c0b1b63edbf9d56289dd797fc820c9c300ce8f9992e85f30a9ecc
3
+ size 5366782898
model-00013-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:400ba8e589409f1899834ecb3ad6354643ed11c3c16a7b75c09a761851de91aa
3
+ size 4991391503
model-00014-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13b2c2877462d63037cd2411aa9b36230c1b51690b4b35e9eebdef6d711842af
3
+ size 4982969937
model-00015-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70a1559348c0841080144be70111ffde5c5da73b6cc65724e82b1154063b074d
3
+ size 5366782902
model-00016-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94402d41c512143a128c6f6e8e29ce89ffe3a90168bfe75ea38030667247695a
3
+ size 5334606241
model-00017-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c3347aeec9112fc6533c9f57f624dec8198e190dcb6c277b4411845e7603ef5
3
+ size 5196457278
model-00018-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa85a5da90c9ac7f2a7fa18f165e292876125ac7f8f0b87bbffd6385a08e631a
3
+ size 5190688356
model-00019-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa4b3f8d23b0ad90f44bfbd177b14768d92b8da5be6deed9d0b879af68bc3509
3
+ size 5282964127
model-00020-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b87b579786a33a22e0067f4240261515562eb4b79542eda1796386767f73eddf
3
+ size 5279979439
model-00021-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4a61de8001adc24acbb5aa0059336efab5b0034f8705d4b121cea528627ccbe
3
+ size 1983972983
model-00022-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09707e79711414e6c3c292bda16a278a46455eb7118b5e5926ac9896de762eb8
3
+ size 4498391419
model-00023-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81fb9daa903a77d4c149844b0663824c6237f9ce0b86b5fafcef666812efde09
3
+ size 4498391419
model-00024-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0757b27b4762c7444f15a29aedc558ff162b2bd8473c81837673e1e7f658422
3
+ size 4498424294
model-00025-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f61f904ed146d2235c88b0c6d6cf4cd042f523da7c16ed2f723bcc10817baed
3
+ size 4798284155
model-00026-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:385e1539699a73953e1787e90397c8adbd6ca6bbf966641693135777e3ae9c01
3
+ size 4798284155
model-00027-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6d326fb220cff958d75010358440cb10a7011c7902ef37e6b16d9205e52aeef
3
+ size 4798317030
model-00028-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b3fe373ccb7e2a680f798cb4bc3cce63771ebacab24558a5288fa3d8db6d11e
3
+ size 3864002939
model-00029-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db7b7b76f131d507750cb846b3e45481de6e83ef45f9db6ef4aa56889c51e5a0
3
+ size 3864002939
model-00030-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e1746e6c65cdd0c662c2411e85a77afd7b66925c15b73e392a7d071fa1839c3
3
+ size 3864035814
model-00031-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1a66a9907bf9773cd7d9f9c7f4ce2a0fb262604f70f60b104551bc6d1bae4dc
3
+ size 3391095163
model-00032-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:680b8585a464806b33cc65e03808111ef269c36766286ed515e8eaaf6064f58f
3
+ size 3391095163
model-00033-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec8ffd059d32126994c8461142e2c9f528ca2e1ed520ad1722e864109dfd330f
3
+ size 5236723941
model-00034-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b928599551a8105fe29fcf5fd7df498264f7f75ca62f3dec7da8a6fb5d4808b
3
+ size 5109950524
model-00035-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13980621da56136f212fcdb2544cd6ff08fab0eb6b56133cfd4a9cf227184afe
3
+ size 5196422353
model-00036-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5041e415d4547071c2ba52a4c98751fc314c7d2a5ec128fa84a1966f53611c1c
3
+ size 5282896248
model-00037-of-00037.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf6566e695a19fce29bdb12f901382325224c6ed2c7664eeaacd5c4de33c1711
3
+ size 1444675892
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
modeling_decilm.py ADDED
@@ -0,0 +1,1681 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 Nvidia Corporation, Google Inc, HuggingFace Inc, EleutherAI. All rights reserved.
3
+ #
4
+ # This code for Nvidia's model is based on the Llama modeling code by HuggingFace,
5
+ # which is in turn based on EleutherAI's GPT-NeoX library and the GPT-NeoX and
6
+ # OPT implementations in this library.
7
+ # Sliding window code based on Gemma2 by Google.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+
21
+ import math
22
+ from typing import List, Optional, Tuple, Union
23
+
24
+ import torch
25
+ import torch.nn.functional as F
26
+ import torch.utils.checkpoint
27
+ from torch import nn
28
+ from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
29
+ from transformers import GenerationConfig
30
+ from transformers.generation.utils import NEED_SETUP_CACHE_CLASSES_MAPPING, GenerationMixin, GenerateOutput
31
+ from transformers.modeling_utils import PreTrainedModel
32
+ from transformers.models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
33
+ from transformers.utils import (
34
+ add_start_docstrings,
35
+ add_start_docstrings_to_model_forward,
36
+ is_flash_attn_greater_or_equal_2_10,
37
+ logging,
38
+ replace_return_docstrings,
39
+ )
40
+
41
+ from .block_config import AttentionConfig, FFNConfig
42
+ from .configuration_decilm import DeciLMConfig
43
+ from .transformers_4_44_2__activations import ACT2FN
44
+ from .transformers_4_44_2__cache_utils import Cache, StaticCache
45
+ from .transformers_4_44_2__modeling_attn_mask_utils import AttentionMaskConverter
46
+ from .transformers_4_44_2__modeling_flash_attention_utils_backward_compat import _flash_attention_forward
47
+ from .transformers_4_44_2__modeling_outputs import (
48
+ BaseModelOutputWithPast,
49
+ CausalLMOutputWithPast,
50
+ QuestionAnsweringModelOutput,
51
+ SequenceClassifierOutputWithPast,
52
+ TokenClassifierOutput,
53
+ )
54
+ from .transformers_4_44_2__modeling_rope_utils import ROPE_INIT_FUNCTIONS
55
+ from .transformers_4_44_2__pytorch_utils import ALL_LAYERNORM_LAYERS
56
+ from .variable_cache import VariableCache
57
+
58
+ MODEL_FOR_CAUSAL_LM_MAPPING_NAMES[DeciLMConfig.model_type] = "DeciLMForCausalLM"
59
+ logger = logging.get_logger(__name__)
60
+
61
+ _CONFIG_FOR_DOC = "DeciLMConfig"
62
+
63
+
64
+ def _prepare_4d_causal_attention_mask_with_cache_position(
65
+ attention_mask: torch.Tensor,
66
+ sequence_length: int,
67
+ target_length: int,
68
+ dtype: torch.dtype,
69
+ device: torch.device,
70
+ min_dtype: float,
71
+ cache_position: torch.Tensor,
72
+ batch_size: int,
73
+ ):
74
+ """
75
+ Creates a causal 4D mask of shape `(batch_size, 1, query_length, key_value_length)` from a 2D mask of shape
76
+ `(batch_size, key_value_length)`, or if the input `attention_mask` is already 4D, do nothing.
77
+
78
+ Args:
79
+ attention_mask (`torch.Tensor`):
80
+ A 2D attention mask of shape `(batch_size, key_value_length)` or a 4D attention mask of shape `(batch_size, 1, query_length, key_value_length)`.
81
+ sequence_length (`int`):
82
+ The sequence length being processed.
83
+ target_length (`int`):
84
+ The target length: when generating with static cache, the mask should be as long as the static cache, to account for the 0 padding, the part of the cache that is not filled yet.
85
+ dtype (`torch.dtype`):
86
+ The dtype to use for the 4D attention mask.
87
+ device (`torch.device`):
88
+ The device to place the 4D attention mask on.
89
+ min_dtype (`float`):
90
+ The minimum value representable with the dtype `dtype`.
91
+ cache_position (`torch.Tensor`):
92
+ Indices depicting the position of the input sequence tokens in the sequence.
93
+ batch_size (`torch.Tensor`):
94
+ Batch size.
95
+ """
96
+ if attention_mask is not None and attention_mask.dim() == 4:
97
+ # In this case we assume that the mask comes already in inverted form and requires no inversion or slicing.
98
+ causal_mask = attention_mask
99
+ else:
100
+ causal_mask = torch.full((sequence_length, target_length), fill_value=min_dtype, dtype=dtype, device=device)
101
+ if sequence_length != 1:
102
+ causal_mask = torch.triu(causal_mask, diagonal=1)
103
+ causal_mask *= torch.arange(target_length, device=device) > cache_position.reshape(-1, 1)
104
+ causal_mask = causal_mask[None, None, :, :].expand(batch_size, 1, -1, -1)
105
+ if attention_mask is not None:
106
+ causal_mask = causal_mask.clone() # copy to contiguous memory for in-place edit
107
+ mask_length = attention_mask.shape[-1]
108
+ padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :]
109
+ padding_mask = padding_mask == 0
110
+ causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
111
+ padding_mask, min_dtype
112
+ )
113
+
114
+ return causal_mask
115
+
116
+
117
+ class DeciLMRMSNorm(nn.Module):
118
+ def __init__(self, hidden_size, eps=1e-6):
119
+ """
120
+ DeciLMRMSNorm is equivalent to T5LayerNorm
121
+ """
122
+ super().__init__()
123
+ self.weight = nn.Parameter(torch.ones(hidden_size))
124
+ self.variance_epsilon = eps
125
+
126
+ def forward(self, hidden_states):
127
+ input_dtype = hidden_states.dtype
128
+ hidden_states = hidden_states.to(torch.float32)
129
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
130
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
131
+ return self.weight * hidden_states.to(input_dtype)
132
+
133
+ def extra_repr(self):
134
+ return f"{tuple(self.weight.shape)}, eps={self.variance_epsilon}"
135
+
136
+
137
+ ALL_LAYERNORM_LAYERS.append(DeciLMRMSNorm)
138
+
139
+
140
+ class DeciLMRotaryEmbedding(nn.Module):
141
+ def __init__(
142
+ self,
143
+ dim=None,
144
+ max_position_embeddings=2048,
145
+ base=10000,
146
+ device=None,
147
+ scaling_factor=1.0,
148
+ rope_type="default",
149
+ config: Optional[DeciLMConfig] = None,
150
+ ):
151
+ super().__init__()
152
+ # TODO (joao): remove the `if` below, only used for BC
153
+ self.rope_kwargs = {}
154
+ if config is None:
155
+ logger.warning_once(
156
+ "`DeciLMRotaryEmbedding` can now be fully parameterized by passing the model config through the "
157
+ "`config` argument. All other arguments will be removed in v4.45"
158
+ )
159
+ self.rope_kwargs = {
160
+ "rope_type": rope_type,
161
+ "factor": scaling_factor,
162
+ "dim": dim,
163
+ "base": base,
164
+ "max_position_embeddings": max_position_embeddings,
165
+ }
166
+ self.rope_type = rope_type
167
+ self.max_seq_len_cached = max_position_embeddings
168
+ self.original_max_seq_len = max_position_embeddings
169
+ else:
170
+ # BC: "rope_type" was originally "type"
171
+ if config.rope_scaling is not None:
172
+ self.rope_type = config.rope_scaling.get("rope_type", config.rope_scaling.get("type"))
173
+ else:
174
+ self.rope_type = "default"
175
+ self.max_seq_len_cached = config.max_position_embeddings
176
+ self.original_max_seq_len = config.max_position_embeddings
177
+
178
+ self.config = config
179
+ self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
180
+
181
+ inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device, **self.rope_kwargs)
182
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
183
+ self.original_inv_freq = self.inv_freq
184
+
185
+ def _dynamic_frequency_update(self, position_ids, device):
186
+ """
187
+ dynamic RoPE layers should recompute `inv_freq` in the following situations:
188
+ 1 - growing beyond the cached sequence length (allow scaling)
189
+ 2 - the current sequence length is in the original scale (avoid losing precision with small sequences)
190
+ """
191
+ seq_len = torch.max(position_ids) + 1
192
+ if seq_len > self.max_seq_len_cached: # growth
193
+ inv_freq, self.attention_scaling = self.rope_init_fn(
194
+ self.config, device, seq_len=seq_len, **self.rope_kwargs
195
+ )
196
+ self.register_buffer("inv_freq", inv_freq, persistent=False) # TODO joao: may break with compilation
197
+ self.max_seq_len_cached = seq_len
198
+
199
+ if seq_len < self.original_max_seq_len and self.max_seq_len_cached > self.original_max_seq_len: # reset
200
+ self.register_buffer("inv_freq", self.original_inv_freq, persistent=False)
201
+ self.max_seq_len_cached = self.original_max_seq_len
202
+
203
+ @torch.no_grad()
204
+ def forward(self, x, position_ids):
205
+ if "dynamic" in self.rope_type:
206
+ self._dynamic_frequency_update(position_ids, device=x.device)
207
+
208
+ # Core RoPE block
209
+ inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1)
210
+ position_ids_expanded = position_ids[:, None, :].float()
211
+ # Force float32 (see https://github.com/huggingface/transformers/pull/29285)
212
+ device_type = x.device.type
213
+ device_type = device_type if isinstance(device_type, str) and device_type != "mps" else "cpu"
214
+ with torch.autocast(device_type=device_type, enabled=False):
215
+ freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
216
+ emb = torch.cat((freqs, freqs), dim=-1)
217
+ cos = emb.cos()
218
+ sin = emb.sin()
219
+
220
+ # Advanced RoPE types (e.g. yarn) apply a post-processing scaling factor, equivalent to scaling attention
221
+ cos = cos * self.attention_scaling
222
+ sin = sin * self.attention_scaling
223
+
224
+ return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
225
+
226
+
227
+ class DeciLMLinearScalingRotaryEmbedding(DeciLMRotaryEmbedding):
228
+ """DeciLMRotaryEmbedding extended with linear scaling. Credits to the Reddit user /u/kaiokendev"""
229
+
230
+ def __init__(self, *args, **kwargs):
231
+ logger.warning_once(
232
+ "`DeciLMLinearScalingRotaryEmbedding` is deprecated an will be removed in v4.45. Please use "
233
+ "`DeciLMRotaryEmbedding`, which now also does linear scaling (simply pass the model config to __init__)."
234
+ )
235
+ kwargs["rope_type"] = "linear"
236
+ super().__init__(*args, **kwargs)
237
+
238
+
239
+ class DeciLMDynamicNTKScalingRotaryEmbedding(DeciLMRotaryEmbedding):
240
+ """DeciLMRotaryEmbedding extended with Dynamic NTK scaling. Credits to the Reddit users /u/bloc97 and /u/emozilla"""
241
+
242
+ def __init__(self, *args, **kwargs):
243
+ logger.warning_once(
244
+ "`DeciLMDynamicNTKScalingRotaryEmbedding` is deprecated an will be removed in v4.45. Please use "
245
+ "`DeciLMRotaryEmbedding`, which now also does dynamic ntk scaling (simply pass the model config to "
246
+ "__init__)."
247
+ )
248
+ kwargs["rope_type"] = "dynamic"
249
+ super().__init__(*args, **kwargs)
250
+
251
+
252
+ def rotate_half(x):
253
+ """Rotates half the hidden dims of the input."""
254
+ x1 = x[..., : x.shape[-1] // 2]
255
+ x2 = x[..., x.shape[-1] // 2:]
256
+ return torch.cat((-x2, x1), dim=-1)
257
+
258
+
259
+ def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
260
+ """Applies Rotary Position Embedding to the query and key tensors.
261
+
262
+ Args:
263
+ q (`torch.Tensor`): The query tensor.
264
+ k (`torch.Tensor`): The key tensor.
265
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
266
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
267
+ position_ids (`torch.Tensor`, *optional*):
268
+ Deprecated and unused.
269
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
270
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
271
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
272
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
273
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
274
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
275
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
276
+ Returns:
277
+ `tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
278
+ """
279
+ cos = cos.unsqueeze(unsqueeze_dim)
280
+ sin = sin.unsqueeze(unsqueeze_dim)
281
+ q_embed = (q * cos) + (rotate_half(q) * sin)
282
+ k_embed = (k * cos) + (rotate_half(k) * sin)
283
+ return q_embed, k_embed
284
+
285
+
286
+ class DeciLMMLP(nn.Module):
287
+ def __init__(self,
288
+ config: DeciLMConfig,
289
+ ffn_config: FFNConfig,
290
+ ):
291
+ super().__init__()
292
+ self.config = config
293
+ self.ffn_config = ffn_config
294
+ self.hidden_size = config.hidden_size
295
+ self.intermediate_size = _ffn_mult_to_intermediate_size(
296
+ ffn_config.ffn_mult, config.hidden_size) # DeciLM-specific code
297
+ self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=config.mlp_bias)
298
+ self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=config.mlp_bias)
299
+ self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=config.mlp_bias)
300
+ self.act_fn = ACT2FN[config.hidden_act]
301
+
302
+ if ffn_config.sparsify is not None:
303
+ self.register_full_backward_hook(sparsity_backward_hook)
304
+
305
+ def forward(self, x):
306
+ if self.config.pretraining_tp > 1:
307
+ slice = self.intermediate_size // self.config.pretraining_tp
308
+ gate_proj_slices = self.gate_proj.weight.split(slice, dim=0)
309
+ up_proj_slices = self.up_proj.weight.split(slice, dim=0)
310
+ down_proj_slices = self.down_proj.weight.split(slice, dim=1)
311
+
312
+ gate_proj = torch.cat(
313
+ [F.linear(x, gate_proj_slices[i]) for i in range(self.config.pretraining_tp)], dim=-1
314
+ )
315
+ up_proj = torch.cat([F.linear(x, up_proj_slices[i]) for i in range(self.config.pretraining_tp)], dim=-1)
316
+
317
+ intermediate_states = (self.act_fn(gate_proj) * up_proj).split(slice, dim=2)
318
+ down_proj = [
319
+ F.linear(intermediate_states[i], down_proj_slices[i]) for i in range(self.config.pretraining_tp)
320
+ ]
321
+ down_proj = sum(down_proj)
322
+ else:
323
+ down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
324
+
325
+ return down_proj
326
+
327
+
328
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
329
+ """
330
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
331
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
332
+ """
333
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
334
+ if n_rep == 1:
335
+ return hidden_states
336
+ hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
337
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
338
+
339
+
340
+ class DeciLMAttention(nn.Module):
341
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
342
+
343
+ def __init__(self,
344
+ config: DeciLMConfig,
345
+ attention_config: AttentionConfig,
346
+ layer_idx: Optional[int] = None,
347
+ ):
348
+ super().__init__()
349
+ self.config = config
350
+ self.attention_config = attention_config
351
+ self.layer_idx = layer_idx
352
+ if layer_idx is None:
353
+ logger.warning_once(
354
+ f"Instantiating {self.__class__.__name__} without passing a `layer_idx` is not recommended and will "
355
+ "lead to errors during the forward call if caching is used. Please make sure to provide a `layer_idx` "
356
+ "when creating this class."
357
+ )
358
+
359
+ self.attention_dropout = config.attention_dropout
360
+ self.hidden_size = config.hidden_size
361
+ self.num_heads = config.num_attention_heads
362
+ self.head_dim = self.hidden_size // self.num_heads
363
+ self.num_key_value_groups = attention_config.n_heads_in_group # DeciLM-specific code
364
+ self.num_key_value_heads = self.num_heads // self.num_key_value_groups # DeciLM-specific code
365
+ self.max_position_embeddings = config.max_position_embeddings
366
+ self.rope_theta = config.rope_theta
367
+ self.is_causal = True
368
+
369
+ if (self.head_dim * self.num_heads) != self.hidden_size:
370
+ raise ValueError(
371
+ f"hidden_size must be divisible by num_heads (got `hidden_size`: {self.hidden_size}"
372
+ f" and `num_heads`: {self.num_heads})."
373
+ )
374
+
375
+ self.q_proj = nn.Linear(self.hidden_size, self.num_heads * self.head_dim, bias=config.attention_bias)
376
+ self.k_proj = nn.Linear(self.hidden_size, self.num_key_value_heads * self.head_dim, bias=config.attention_bias)
377
+ self.v_proj = nn.Linear(self.hidden_size, self.num_key_value_heads * self.head_dim, bias=config.attention_bias)
378
+ self.o_proj = nn.Linear(self.hidden_size, self.hidden_size, bias=config.attention_bias)
379
+
380
+ # TODO (joao): remove in v4.45 (RoPE is computed in the model, not in the decoder layers)
381
+ self.rotary_emb = DeciLMRotaryEmbedding(config=self.config)
382
+
383
+ if attention_config.sparsify is not None:
384
+ self.register_full_backward_hook(sparsity_backward_hook)
385
+
386
+ def forward(
387
+ self,
388
+ hidden_states: torch.Tensor,
389
+ attention_mask: Optional[torch.Tensor] = None,
390
+ position_ids: Optional[torch.LongTensor] = None,
391
+ past_key_value: Optional[Cache] = None,
392
+ output_attentions: bool = False,
393
+ use_cache: bool = False,
394
+ cache_position: Optional[torch.LongTensor] = None,
395
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # will become mandatory in v4.45
396
+ **kwargs,
397
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
398
+ bsz, q_len, _ = hidden_states.size()
399
+ if self.config.pretraining_tp > 1:
400
+ key_value_slicing = (self.num_key_value_heads * self.head_dim) // self.config.pretraining_tp
401
+ query_slices = self.q_proj.weight.split(
402
+ (self.num_heads * self.head_dim) // self.config.pretraining_tp, dim=0
403
+ )
404
+ key_slices = self.k_proj.weight.split(key_value_slicing, dim=0)
405
+ value_slices = self.v_proj.weight.split(key_value_slicing, dim=0)
406
+
407
+ query_states = [F.linear(hidden_states, query_slices[i]) for i in range(self.config.pretraining_tp)]
408
+ query_states = torch.cat(query_states, dim=-1)
409
+
410
+ key_states = [F.linear(hidden_states, key_slices[i]) for i in range(self.config.pretraining_tp)]
411
+ key_states = torch.cat(key_states, dim=-1)
412
+
413
+ value_states = [F.linear(hidden_states, value_slices[i]) for i in range(self.config.pretraining_tp)]
414
+ value_states = torch.cat(value_states, dim=-1)
415
+
416
+ else:
417
+ query_states = self.q_proj(hidden_states)
418
+ key_states = self.k_proj(hidden_states)
419
+ value_states = self.v_proj(hidden_states)
420
+
421
+ query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
422
+ key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
423
+ value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
424
+
425
+ if position_embeddings is None:
426
+ logger.warning_once(
427
+ "The attention layers in this model are transitioning from computing the RoPE embeddings internally "
428
+ "through `position_ids` (2D tensor with the indexes of the tokens), to using externally computed "
429
+ "`position_embeddings` (Tuple of tensors, containing cos and sin). In v4.45 `position_ids` will be "
430
+ "removed and `position_embeddings` will be mandatory."
431
+ )
432
+ cos, sin = self.rotary_emb(value_states, position_ids)
433
+ else:
434
+ cos, sin = position_embeddings
435
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
436
+
437
+ if past_key_value is not None:
438
+ # sin and cos are specific to RoPE models; cache_position needed for the static cache
439
+ cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
440
+ key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
441
+
442
+ key_states = repeat_kv(key_states, self.num_key_value_groups)
443
+ value_states = repeat_kv(value_states, self.num_key_value_groups)
444
+
445
+ attn_weights = torch.matmul(query_states, key_states.transpose(2, 3)) / math.sqrt(self.head_dim)
446
+
447
+ if attention_mask is not None: # no matter the length, we just slice it
448
+ causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
449
+ attn_weights = attn_weights + causal_mask
450
+
451
+ # upcast attention to fp32
452
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query_states.dtype)
453
+ attn_weights = nn.functional.dropout(attn_weights, p=self.attention_dropout, training=self.training)
454
+ attn_output = torch.matmul(attn_weights, value_states)
455
+
456
+ if attn_output.size() != (bsz, self.num_heads, q_len, self.head_dim):
457
+ raise ValueError(
458
+ f"`attn_output` should be of size {(bsz, self.num_heads, q_len, self.head_dim)}, but is"
459
+ f" {attn_output.size()}"
460
+ )
461
+
462
+ attn_output = attn_output.transpose(1, 2).contiguous()
463
+
464
+ attn_output = attn_output.reshape(bsz, q_len, -1)
465
+
466
+ if self.config.pretraining_tp > 1:
467
+ attn_output = attn_output.split(self.hidden_size // self.config.pretraining_tp, dim=2)
468
+ o_proj_slices = self.o_proj.weight.split(self.hidden_size // self.config.pretraining_tp, dim=1)
469
+ attn_output = sum([F.linear(attn_output[i], o_proj_slices[i]) for i in range(self.config.pretraining_tp)])
470
+ else:
471
+ attn_output = self.o_proj(attn_output)
472
+
473
+ if not output_attentions:
474
+ attn_weights = None
475
+
476
+ return attn_output, attn_weights, past_key_value
477
+
478
+
479
+ class DeciLMFlashAttention2(DeciLMAttention):
480
+ """
481
+ DeciLM flash attention module. This module inherits from `DeciLMAttention` as the weights of the module stays
482
+ untouched. The only required change would be on the forward pass where it needs to correctly call the public API of
483
+ flash attention and deal with padding tokens in case the input contains any of them.
484
+ """
485
+
486
+ def __init__(self, *args, **kwargs):
487
+ super().__init__(*args, **kwargs)
488
+
489
+ # TODO: Should be removed once Flash Attention for RoCm is bumped to 2.1.
490
+ # flash_attn<2.1 generates top-left aligned causal mask, while what is needed here is bottom-right alignement, that was made default for flash_attn>=2.1. This attribute is used to handle this difference. Reference: https://github.com/Dao-AILab/flash-attention/releases/tag/v2.1.0.
491
+ # Beware that with flash_attn<2.1, using q_seqlen != k_seqlen (except for the case q_seqlen == 1) produces a wrong mask (top-left).
492
+ self._flash_attn_uses_top_left_mask = not is_flash_attn_greater_or_equal_2_10()
493
+
494
+ self.sliding_window = self.attention_config.prefill_sliding_window
495
+
496
+ def forward(
497
+ self,
498
+ hidden_states: torch.Tensor,
499
+ attention_mask: Optional[torch.LongTensor] = None,
500
+ position_ids: Optional[torch.LongTensor] = None,
501
+ past_key_value: Optional[Cache] = None,
502
+ output_attentions: bool = False,
503
+ use_cache: bool = False,
504
+ cache_position: Optional[torch.LongTensor] = None,
505
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # will become mandatory in v4.45
506
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
507
+ output_attentions = False
508
+
509
+ bsz, q_len, _ = hidden_states.size()
510
+
511
+ query_states = self.q_proj(hidden_states)
512
+ key_states = self.k_proj(hidden_states)
513
+ value_states = self.v_proj(hidden_states)
514
+
515
+ # Flash attention requires the input to have the shape
516
+ # batch_size x seq_length x head_dim x hidden_dim
517
+ # therefore we just need to keep the original shape
518
+ query_states = query_states.view(bsz, q_len, self.num_heads, self.head_dim).transpose(1, 2)
519
+ key_states = key_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
520
+ value_states = value_states.view(bsz, q_len, self.num_key_value_heads, self.head_dim).transpose(1, 2)
521
+
522
+ if position_embeddings is None:
523
+ logger.warning_once(
524
+ "The attention layers in this model are transitioning from computing the RoPE embeddings internally "
525
+ "through `position_ids` (2D tensor with the indexes of the tokens), to using externally computed "
526
+ "`position_embeddings` (Tuple of tensors, containing cos and sin). In v4.45 `position_ids` will be "
527
+ "removed and `position_embeddings` will be mandatory."
528
+ )
529
+ cos, sin = self.rotary_emb(value_states, position_ids)
530
+ else:
531
+ cos, sin = position_embeddings
532
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
533
+
534
+ if past_key_value is not None:
535
+ # sin and cos are specific to RoPE models; cache_position needed for the static cache
536
+ cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
537
+ key_states, value_states = past_key_value.update(key_states, value_states, self.layer_idx, cache_kwargs)
538
+
539
+ # TODO: These transpose are quite inefficient but Flash Attention requires the layout [batch_size, sequence_length, num_heads, head_dim]. We would need to refactor the KV cache
540
+ # to be able to avoid many of these transpose/reshape/view.
541
+ query_states = query_states.transpose(1, 2)
542
+ key_states = key_states.transpose(1, 2)
543
+ value_states = value_states.transpose(1, 2)
544
+
545
+ dropout_rate = self.attention_dropout if self.training else 0.0
546
+
547
+ # In PEFT, usually we cast the layer norms in float32 for training stability reasons
548
+ # therefore the input hidden states gets silently casted in float32. Hence, we need
549
+ # cast them back in the correct dtype just to be sure everything works as expected.
550
+ # This might slowdown training & inference so it is recommended to not cast the LayerNorms
551
+ # in fp32. (DeciLMRMSNorm handles it correctly)
552
+
553
+ input_dtype = query_states.dtype
554
+ if input_dtype == torch.float32:
555
+ if torch.is_autocast_enabled():
556
+ target_dtype = torch.get_autocast_gpu_dtype()
557
+ # Handle the case where the model is quantized
558
+ elif hasattr(self.config, "_pre_quantization_dtype"):
559
+ target_dtype = self.config._pre_quantization_dtype
560
+ else:
561
+ target_dtype = self.q_proj.weight.dtype
562
+
563
+ logger.warning_once(
564
+ f"The input hidden states seems to be silently casted in float32, this might be related to"
565
+ f" the fact you have upcasted embedding or layer norm layers in float32. We will cast back the input in"
566
+ f" {target_dtype}."
567
+ )
568
+
569
+ query_states = query_states.to(target_dtype)
570
+ key_states = key_states.to(target_dtype)
571
+ value_states = value_states.to(target_dtype)
572
+
573
+ attn_output = _flash_attention_forward(
574
+ query_states,
575
+ key_states,
576
+ value_states,
577
+ attention_mask,
578
+ q_len,
579
+ position_ids=position_ids,
580
+ dropout=dropout_rate,
581
+ sliding_window=self.sliding_window,
582
+ use_top_left_mask=self._flash_attn_uses_top_left_mask,
583
+ is_causal=self.is_causal,
584
+ )
585
+
586
+ attn_output = attn_output.reshape(bsz, q_len, -1).contiguous()
587
+ attn_output = self.o_proj(attn_output)
588
+
589
+ if not output_attentions:
590
+ attn_weights = None
591
+
592
+ return attn_output, attn_weights, past_key_value
593
+
594
+
595
+ DECILM_ATTENTION_CLASSES = {
596
+ "eager": DeciLMAttention,
597
+ "flash_attention_2": DeciLMFlashAttention2,
598
+ }
599
+
600
+
601
+ class DeciLMDecoderLayer(nn.Module):
602
+ # DeciLM-specific code
603
+ def __init__(self, config: DeciLMConfig, layer_idx: int):
604
+ super().__init__()
605
+ self.config = config
606
+ self.hidden_size = config.hidden_size
607
+ self.block_config = config.block_configs[layer_idx]
608
+ self.attention_config = self.block_config.attention
609
+ self.ffn_config = self.block_config.ffn
610
+
611
+ if not self.attention_config.no_op:
612
+ self.input_layernorm = DeciLMRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
613
+ if not self.attention_config.replace_with_linear:
614
+ self.self_attn = DECILM_ATTENTION_CLASSES[config._attn_implementation](
615
+ config=config, attention_config=self.attention_config, layer_idx=layer_idx)
616
+ else:
617
+ self.self_attn = DeciLMLinearAttention(config)
618
+
619
+ if not self.ffn_config.no_op:
620
+ self.post_attention_layernorm = DeciLMRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
621
+ if not self.ffn_config.replace_with_linear:
622
+ self.mlp = DeciLMMLP(config, self.ffn_config)
623
+ else:
624
+ self.mlp = DeciLMLinearMLP(config)
625
+
626
+ self.is_sliding = self.attention_config.is_sliding
627
+ self.sliding_window = self.attention_config.prefill_sliding_window
628
+
629
+ def forward(
630
+ self,
631
+ hidden_states: torch.Tensor,
632
+ attention_mask: Optional[torch.Tensor] = None,
633
+ position_ids: Optional[torch.LongTensor] = None,
634
+ past_key_value: Optional[Cache] = None,
635
+ output_attentions: Optional[bool] = False,
636
+ use_cache: Optional[bool] = False,
637
+ cache_position: Optional[torch.LongTensor] = None,
638
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None, # will become mandatory in v4.45
639
+ **kwargs,
640
+ ) -> Tuple[torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]]:
641
+ """
642
+ Args:
643
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
644
+ attention_mask (`torch.FloatTensor`, *optional*):
645
+ attention mask of size `(batch_size, sequence_length)` if flash attention is used or `(batch_size, 1,
646
+ query_sequence_length, key_sequence_length)` if default attention is used.
647
+ output_attentions (`bool`, *optional*):
648
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under
649
+ returned tensors for more detail.
650
+ use_cache (`bool`, *optional*):
651
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
652
+ (see `past_key_values`).
653
+ past_key_value (`Tuple(torch.FloatTensor)`, *optional*): cached past key and value projection states
654
+ cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
655
+ Indices depicting the position of the input sequence tokens in the sequence
656
+ position_embeddings (`Tuple[torch.FloatTensor, torch.FloatTensor]`, *optional*):
657
+ Tuple containing the cosine and sine positional embeddings of shape `(batch_size, seq_len, head_dim)`,
658
+ with `head_dim` being the embedding dimension of each attention head.
659
+ kwargs (`dict`, *optional*):
660
+ Arbitrary kwargs to be ignored, used for FSDP and other methods that injects code
661
+ into the model
662
+ """
663
+ if self.attention_config.unshifted_sink and self.attention_config.is_sink:
664
+ attention_mask = self._unshifted_sink_mask(
665
+ attention_mask, hidden_states,
666
+ self.attention_config.window_length, self.attention_config.num_sink_tokens)
667
+ else:
668
+ attention_mask = self._gemma2_window_mask(attention_mask, hidden_states, past_key_value)
669
+
670
+ self_attn_weights = None
671
+ present_key_value = past_key_value
672
+ if self.attention_config.no_op:
673
+ pass
674
+ elif self.attention_config.replace_with_linear:
675
+ residual = hidden_states
676
+ hidden_states = self.input_layernorm(hidden_states)
677
+ hidden_states = self.self_attn(hidden_states)
678
+ hidden_states = residual + hidden_states
679
+ else:
680
+ residual = hidden_states
681
+ hidden_states = self.input_layernorm(hidden_states)
682
+ hidden_states, self_attn_weights, present_key_value = self.self_attn(
683
+ hidden_states=hidden_states,
684
+ attention_mask=attention_mask,
685
+ position_ids=position_ids,
686
+ past_key_value=past_key_value,
687
+ output_attentions=output_attentions,
688
+ use_cache=use_cache,
689
+ cache_position=cache_position,
690
+ position_embeddings=position_embeddings,
691
+ **kwargs,
692
+ )
693
+ hidden_states = residual + hidden_states
694
+
695
+ if not self.ffn_config.no_op:
696
+ residual = hidden_states
697
+ hidden_states = self.post_attention_layernorm(hidden_states)
698
+ hidden_states = self.mlp(hidden_states)
699
+ hidden_states = residual + hidden_states
700
+
701
+ outputs = (hidden_states,)
702
+
703
+ if output_attentions:
704
+ outputs += (self_attn_weights,)
705
+
706
+ if use_cache:
707
+ outputs += (present_key_value,)
708
+
709
+ return outputs
710
+
711
+ def _gemma2_window_mask(self,
712
+ attention_mask: Optional[torch.Tensor],
713
+ hidden_states: torch.Tensor,
714
+ past_key_value: Optional[VariableCache],
715
+ ) -> Optional[torch.Tensor]:
716
+ if self.is_sliding and attention_mask is not None: # efficient SDPA and no padding
717
+ # Flash-attn is a 2D tensor
718
+ if self.config._attn_implementation == "flash_attention_2":
719
+ if past_key_value is not None: # when decoding
720
+ attention_mask = attention_mask[:, -self.sliding_window:]
721
+ else:
722
+ min_dtype = torch.finfo(hidden_states.dtype).min
723
+ sliding_window_mask = torch.tril(
724
+ torch.ones_like(attention_mask, dtype=torch.bool), diagonal=-self.sliding_window
725
+ )
726
+ attention_mask = torch.where(sliding_window_mask, min_dtype, attention_mask)
727
+ if attention_mask.shape[-1] <= 1: # when decoding
728
+ attention_mask = attention_mask[:, :, :, -self.sliding_window:]
729
+ return attention_mask
730
+
731
+ def _unshifted_sink_mask(self,
732
+ attention_mask: torch.Tensor,
733
+ hidden_states: torch.Tensor,
734
+ window_length: int,
735
+ num_sink_tokens: Optional[int],
736
+ ) -> torch.Tensor:
737
+ assert self.config._attn_implementation == "eager", "Unshifted sink is only supported in 'eager' mode."
738
+ assert attention_mask is not None, "The attention mask seems to not be prepared"
739
+
740
+ attention_mask = attention_mask.clone()
741
+ min_dtype = torch.finfo(hidden_states.dtype).min
742
+
743
+ if window_length == 0:
744
+ attention_mask = torch.full_like(attention_mask, fill_value=min_dtype)
745
+ else:
746
+ query_length = attention_mask.shape[-2]
747
+ is_decode = (query_length == 1)
748
+ if is_decode:
749
+ attention_mask[:, :, :, :-window_length] = min_dtype
750
+ else:
751
+ sliding_window_mask = torch.tril(
752
+ torch.ones_like(attention_mask, dtype=torch.bool), diagonal=-window_length
753
+ )
754
+ attention_mask = torch.where(sliding_window_mask, min_dtype, attention_mask)
755
+
756
+ attention_mask[:, :, :, :num_sink_tokens] = 0
757
+ return attention_mask
758
+
759
+
760
+ DECILM_START_DOCSTRING = r"""
761
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
762
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
763
+ etc.)
764
+
765
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
766
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
767
+ and behavior.
768
+
769
+ Parameters:
770
+ config ([`DeciLMConfig`]):
771
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
772
+ load the weights associated with the model, only the configuration. Check out the
773
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
774
+ """
775
+
776
+
777
+ @add_start_docstrings(
778
+ "The bare DeciLM Model outputting raw hidden-states without any specific head on top.",
779
+ DECILM_START_DOCSTRING,
780
+ )
781
+ class DeciLMPreTrainedModel(PreTrainedModel):
782
+ config_class = DeciLMConfig
783
+ base_model_prefix = "model"
784
+ supports_gradient_checkpointing = True
785
+ _no_split_modules = ["DeciLMDecoderLayer"]
786
+ _skip_keys_device_placement = ["past_key_values"]
787
+ _supports_flash_attn_2 = True
788
+ _supports_sdpa = False
789
+ _supports_cache_class = True
790
+ _supports_quantized_cache = False
791
+ _supports_static_cache = True
792
+
793
+ def _init_weights(self, module):
794
+ std = self.config.initializer_range
795
+ if isinstance(module, nn.Linear):
796
+ module.weight.data.normal_(mean=0.0, std=std)
797
+ if module.bias is not None:
798
+ module.bias.data.zero_()
799
+ elif isinstance(module, nn.Embedding):
800
+ module.weight.data.normal_(mean=0.0, std=std)
801
+ if module.padding_idx is not None:
802
+ module.weight.data[module.padding_idx].zero_()
803
+
804
+ def _prepare_generation_config(
805
+ self, generation_config: Optional[GenerationConfig], **kwargs: dict
806
+ ) -> tuple[GenerationConfig, dict]:
807
+ # DeciLM-specific code
808
+ generation_config, model_kwargs = super()._prepare_generation_config(generation_config, **kwargs)
809
+ generation_config.cache_implementation = "variable"
810
+ NEED_SETUP_CACHE_CLASSES_MAPPING["variable"] = VariableCache
811
+ return generation_config, model_kwargs
812
+
813
+
814
+ DECILM_INPUTS_DOCSTRING = r"""
815
+ Args:
816
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
817
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
818
+ it.
819
+
820
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
821
+ [`PreTrainedTokenizer.__call__`] for details.
822
+
823
+ [What are input IDs?](../glossary#input-ids)
824
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
825
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
826
+
827
+ - 1 for tokens that are **not masked**,
828
+ - 0 for tokens that are **masked**.
829
+
830
+ [What are attention masks?](../glossary#attention-mask)
831
+
832
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
833
+ [`PreTrainedTokenizer.__call__`] for details.
834
+
835
+ If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
836
+ `past_key_values`).
837
+
838
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
839
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
840
+ information on the default strategy.
841
+
842
+ - 1 indicates the head is **not masked**,
843
+ - 0 indicates the head is **masked**.
844
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
845
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
846
+ config.n_positions - 1]`.
847
+
848
+ [What are position IDs?](../glossary#position-ids)
849
+ past_key_values (`VariableCache`, *optional*):
850
+ Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
851
+ blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
852
+ returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
853
+
854
+ If passed to the forward function, past_key_values must be a VariableCache object (see imports).
855
+ For generation purposes, this is already handled inside model.generate().
856
+
857
+ If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
858
+ have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
859
+ of shape `(batch_size, sequence_length)`.
860
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
861
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
862
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
863
+ model's internal embedding lookup matrix.
864
+ use_cache (`bool`, *optional*):
865
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
866
+ `past_key_values`).
867
+ output_attentions (`bool`, *optional*):
868
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
869
+ tensors for more detail.
870
+ output_hidden_states (`bool`, *optional*):
871
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
872
+ more detail.
873
+ return_dict (`bool`, *optional*):
874
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
875
+ cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
876
+ Indices depicting the position of the input sequence tokens in the sequence. Contrarily to `position_ids`,
877
+ this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
878
+ the complete sequence length.
879
+ """
880
+
881
+
882
+ @add_start_docstrings(
883
+ "The bare DeciLM Model outputting raw hidden-states without any specific head on top.",
884
+ DECILM_START_DOCSTRING,
885
+ )
886
+ class DeciLMModel(DeciLMPreTrainedModel):
887
+ """
888
+ Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`DeciLMDecoderLayer`]
889
+
890
+ Args:
891
+ config: DeciLMConfig
892
+ """
893
+
894
+ def __init__(self, config: DeciLMConfig):
895
+ super().__init__(config)
896
+ self.padding_idx = config.pad_token_id
897
+ self.vocab_size = config.vocab_size
898
+
899
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
900
+ self.layers = nn.ModuleList(
901
+ [DeciLMDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
902
+ )
903
+ self.norm = DeciLMRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
904
+ self.rotary_emb = DeciLMRotaryEmbedding(config=config)
905
+ self.gradient_checkpointing = False
906
+
907
+ # Initialize weights and apply final processing
908
+ self.post_init()
909
+
910
+ def get_input_embeddings(self):
911
+ return self.embed_tokens
912
+
913
+ def set_input_embeddings(self, value):
914
+ self.embed_tokens = value
915
+
916
+ @add_start_docstrings_to_model_forward(DECILM_INPUTS_DOCSTRING)
917
+ def forward(
918
+ self,
919
+ input_ids: torch.LongTensor = None,
920
+ attention_mask: Optional[torch.Tensor] = None,
921
+ position_ids: Optional[torch.LongTensor] = None,
922
+ past_key_values: Optional[Union[Cache, List[torch.FloatTensor]]] = None,
923
+ inputs_embeds: Optional[torch.FloatTensor] = None,
924
+ use_cache: Optional[bool] = None,
925
+ output_attentions: Optional[bool] = None,
926
+ output_hidden_states: Optional[bool] = None,
927
+ return_dict: Optional[bool] = None,
928
+ cache_position: Optional[torch.LongTensor] = None,
929
+ ) -> Union[Tuple, BaseModelOutputWithPast]:
930
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
931
+ output_hidden_states = (
932
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
933
+ )
934
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
935
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
936
+
937
+ if (input_ids is None) ^ (inputs_embeds is not None):
938
+ raise ValueError(
939
+ "You cannot specify both input_ids and inputs_embeds at the same time, and must specify either one"
940
+ )
941
+
942
+ if self.gradient_checkpointing and self.training and use_cache:
943
+ logger.warning_once(
944
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`."
945
+ )
946
+ use_cache = False
947
+
948
+ if inputs_embeds is None:
949
+ inputs_embeds = self.embed_tokens(input_ids)
950
+
951
+ is_legacy_cache_format = (past_key_values is not None) and not isinstance(past_key_values, Cache)
952
+ if is_legacy_cache_format:
953
+ raise NotImplementedError("DeciLMModel does not support legacy cache format, please use a newer "
954
+ "transformers version or use VariableCache explicitly (see import in this file).")
955
+
956
+ if cache_position is None:
957
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
958
+ cache_position = torch.arange(
959
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
960
+ )
961
+ if position_ids is None:
962
+ position_ids = cache_position.unsqueeze(0)
963
+
964
+ causal_mask = self._update_causal_mask(
965
+ attention_mask, inputs_embeds, cache_position, past_key_values, output_attentions
966
+ )
967
+ hidden_states = inputs_embeds
968
+
969
+ # create position embeddings to be shared across the decoder layers
970
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
971
+
972
+ # decoder layers
973
+ all_hidden_states = () if output_hidden_states else None
974
+ all_self_attns = () if output_attentions else None
975
+ next_decoder_cache = None
976
+
977
+ for decoder_layer in self.layers:
978
+ if output_hidden_states:
979
+ all_hidden_states += (hidden_states,)
980
+
981
+ if self.gradient_checkpointing and self.training:
982
+ layer_outputs = self._gradient_checkpointing_func(
983
+ decoder_layer.__call__,
984
+ hidden_states,
985
+ causal_mask,
986
+ position_ids,
987
+ past_key_values,
988
+ output_attentions,
989
+ use_cache,
990
+ cache_position,
991
+ position_embeddings,
992
+ )
993
+ else:
994
+ layer_outputs = decoder_layer(
995
+ hidden_states,
996
+ attention_mask=causal_mask,
997
+ position_ids=position_ids,
998
+ past_key_value=past_key_values,
999
+ output_attentions=output_attentions,
1000
+ use_cache=use_cache,
1001
+ cache_position=cache_position,
1002
+ position_embeddings=position_embeddings,
1003
+ )
1004
+
1005
+ hidden_states = layer_outputs[0]
1006
+
1007
+ if use_cache:
1008
+ next_decoder_cache = layer_outputs[2 if output_attentions else 1]
1009
+
1010
+ if output_attentions:
1011
+ all_self_attns += (layer_outputs[1],)
1012
+
1013
+ hidden_states = self.norm(hidden_states)
1014
+
1015
+ # add hidden states from the last decoder layer
1016
+ if output_hidden_states:
1017
+ all_hidden_states += (hidden_states,)
1018
+
1019
+ next_cache = next_decoder_cache if use_cache else None
1020
+
1021
+ if not return_dict:
1022
+ return tuple(v for v in [hidden_states, next_cache, all_hidden_states, all_self_attns] if v is not None)
1023
+ return BaseModelOutputWithPast(
1024
+ last_hidden_state=hidden_states,
1025
+ past_key_values=next_cache,
1026
+ hidden_states=all_hidden_states,
1027
+ attentions=all_self_attns,
1028
+ )
1029
+
1030
+ def _update_causal_mask(
1031
+ self,
1032
+ attention_mask: torch.Tensor,
1033
+ input_tensor: torch.Tensor,
1034
+ cache_position: torch.Tensor,
1035
+ past_key_values: Cache,
1036
+ output_attentions: bool,
1037
+ ):
1038
+ # TODO: As of torch==2.2.0, the `attention_mask` passed to the model in `generate` is 2D and of dynamic length even when the static
1039
+ # KV cache is used. This is an issue for torch.compile which then recaptures cudagraphs at each decode steps due to the dynamic shapes.
1040
+ # (`recording cudagraph tree for symint key 13`, etc.), which is VERY slow. A workaround is `@torch.compiler.disable`, but this prevents using
1041
+ # `fullgraph=True`. See more context in https://github.com/huggingface/transformers/pull/29114
1042
+
1043
+ if self.config._attn_implementation == "flash_attention_2":
1044
+ if attention_mask is not None and 0.0 in attention_mask:
1045
+ return attention_mask
1046
+ return None
1047
+
1048
+ # For SDPA, when possible, we will rely on its `is_causal` argument instead of its `attn_mask` argument, in
1049
+ # order to dispatch on Flash Attention 2. This feature is not compatible with static cache, as SDPA will fail
1050
+ # to infer the attention mask.
1051
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
1052
+ assert not isinstance(past_key_values, StaticCache), "DeciLM does not support StaticCache"
1053
+ using_static_cache = isinstance(past_key_values, StaticCache)
1054
+
1055
+ # When output attentions is True, sdpa implementation's forward method calls the eager implementation's forward
1056
+ if self.config._attn_implementation == "sdpa" and not using_static_cache and not output_attentions:
1057
+ if AttentionMaskConverter._ignore_causal_mask_sdpa(
1058
+ attention_mask,
1059
+ inputs_embeds=input_tensor,
1060
+ past_key_values_length=past_seen_tokens,
1061
+ is_training=self.training,
1062
+ ) and all([not layer.is_sliding for layer in self.layers]):
1063
+ return None
1064
+
1065
+ dtype, device = input_tensor.dtype, input_tensor.device
1066
+ min_dtype = torch.finfo(dtype).min
1067
+ sequence_length = input_tensor.shape[1]
1068
+ if using_static_cache:
1069
+ target_length = past_key_values.get_max_length()
1070
+ else:
1071
+ target_length = (
1072
+ attention_mask.shape[-1]
1073
+ if isinstance(attention_mask, torch.Tensor)
1074
+ else past_seen_tokens + sequence_length + 1
1075
+ )
1076
+
1077
+ # In case the provided `attention` mask is 2D, we generate a causal mask here (4D).
1078
+ causal_mask = _prepare_4d_causal_attention_mask_with_cache_position(
1079
+ attention_mask,
1080
+ sequence_length=sequence_length,
1081
+ target_length=target_length,
1082
+ dtype=dtype,
1083
+ device=device,
1084
+ min_dtype=min_dtype,
1085
+ cache_position=cache_position,
1086
+ batch_size=input_tensor.shape[0],
1087
+ )
1088
+
1089
+ if (
1090
+ self.config._attn_implementation == "sdpa"
1091
+ and attention_mask is not None
1092
+ and attention_mask.device.type == "cuda"
1093
+ and not output_attentions
1094
+ ):
1095
+ # Attend to all tokens in fully masked rows in the causal_mask, for example the relevant first rows when
1096
+ # using left padding. This is required by F.scaled_dot_product_attention memory-efficient attention path.
1097
+ # Details: https://github.com/pytorch/pytorch/issues/110213
1098
+ causal_mask = AttentionMaskConverter._unmask_unattended(causal_mask, min_dtype)
1099
+
1100
+ return causal_mask
1101
+
1102
+
1103
+ class DeciLMForCausalLM(DeciLMPreTrainedModel, GenerationMixin):
1104
+ _tied_weights_keys = ["lm_head.weight"]
1105
+
1106
+ def __init__(self, config):
1107
+ super().__init__(config)
1108
+ self.model = DeciLMModel(config)
1109
+ self.vocab_size = config.vocab_size
1110
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
1111
+
1112
+ # Initialize weights and apply final processing
1113
+ self.post_init()
1114
+
1115
+ def get_input_embeddings(self):
1116
+ return self.model.embed_tokens
1117
+
1118
+ def set_input_embeddings(self, value):
1119
+ self.model.embed_tokens = value
1120
+
1121
+ def get_output_embeddings(self):
1122
+ return self.lm_head
1123
+
1124
+ def set_output_embeddings(self, new_embeddings):
1125
+ self.lm_head = new_embeddings
1126
+
1127
+ def set_decoder(self, decoder):
1128
+ self.model = decoder
1129
+
1130
+ def get_decoder(self):
1131
+ return self.model
1132
+
1133
+ @add_start_docstrings_to_model_forward(DECILM_INPUTS_DOCSTRING)
1134
+ @replace_return_docstrings(output_type=CausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC)
1135
+ def forward(
1136
+ self,
1137
+ input_ids: torch.LongTensor = None,
1138
+ attention_mask: Optional[torch.Tensor] = None,
1139
+ position_ids: Optional[torch.LongTensor] = None,
1140
+ past_key_values: Optional[Union[Cache, List[torch.FloatTensor]]] = None,
1141
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1142
+ labels: Optional[torch.LongTensor] = None,
1143
+ use_cache: Optional[bool] = None,
1144
+ output_attentions: Optional[bool] = None,
1145
+ output_hidden_states: Optional[bool] = None,
1146
+ return_dict: Optional[bool] = None,
1147
+ cache_position: Optional[torch.LongTensor] = None,
1148
+ ) -> Union[Tuple, CausalLMOutputWithPast]:
1149
+ r"""
1150
+ Args:
1151
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1152
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
1153
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
1154
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
1155
+
1156
+ Return:
1157
+ """
1158
+ output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
1159
+ output_hidden_states = (
1160
+ output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
1161
+ )
1162
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1163
+
1164
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
1165
+ outputs = self.model(
1166
+ input_ids=input_ids,
1167
+ attention_mask=attention_mask,
1168
+ position_ids=position_ids,
1169
+ past_key_values=past_key_values,
1170
+ inputs_embeds=inputs_embeds,
1171
+ use_cache=use_cache,
1172
+ output_attentions=output_attentions,
1173
+ output_hidden_states=output_hidden_states,
1174
+ return_dict=return_dict,
1175
+ cache_position=cache_position,
1176
+ )
1177
+
1178
+ hidden_states = outputs[0]
1179
+ if self.config.pretraining_tp > 1:
1180
+ lm_head_slices = self.lm_head.weight.split(self.vocab_size // self.config.pretraining_tp, dim=0)
1181
+ logits = [F.linear(hidden_states, lm_head_slices[i]) for i in range(self.config.pretraining_tp)]
1182
+ logits = torch.cat(logits, dim=-1)
1183
+ else:
1184
+ logits = self.lm_head(hidden_states)
1185
+ logits = logits.float()
1186
+
1187
+ loss = None
1188
+ if labels is not None:
1189
+ # Shift so that tokens < n predict n
1190
+ shift_logits = logits[..., :-1, :].contiguous()
1191
+ shift_labels = labels[..., 1:].contiguous()
1192
+ # Flatten the tokens
1193
+ loss_fct = CrossEntropyLoss()
1194
+ shift_logits = shift_logits.view(-1, self.config.vocab_size)
1195
+ shift_labels = shift_labels.view(-1)
1196
+ # Enable model parallelism
1197
+ shift_labels = shift_labels.to(shift_logits.device)
1198
+ loss = loss_fct(shift_logits, shift_labels)
1199
+
1200
+ if not return_dict:
1201
+ output = (logits,) + outputs[1:]
1202
+ return (loss,) + output if loss is not None else output
1203
+
1204
+ return CausalLMOutputWithPast(
1205
+ loss=loss,
1206
+ logits=logits,
1207
+ past_key_values=outputs.past_key_values,
1208
+ hidden_states=outputs.hidden_states,
1209
+ attentions=outputs.attentions,
1210
+ )
1211
+
1212
+ def prepare_inputs_for_generation(
1213
+ self,
1214
+ input_ids,
1215
+ past_key_values=None,
1216
+ attention_mask=None,
1217
+ inputs_embeds=None,
1218
+ cache_position=None,
1219
+ position_ids=None,
1220
+ use_cache=True,
1221
+ **kwargs,
1222
+ ):
1223
+ # If we have cache: let's slice `input_ids` through `cache_position`, to keep only the unprocessed tokens
1224
+ # Exception 1: when passing input_embeds, input_ids may be missing entries
1225
+ # Exception 2: some generation methods do special slicing of input_ids, so we don't need to do it here
1226
+ if past_key_values is not None:
1227
+ if inputs_embeds is not None: # Exception 1
1228
+ input_ids = input_ids[:, -cache_position.shape[0]:]
1229
+ elif input_ids.shape[1] != cache_position.shape[0]: # Default case (the "else", a no op, is Exception 2)
1230
+ input_ids = input_ids[:, cache_position]
1231
+
1232
+ if attention_mask is not None and position_ids is None:
1233
+ # create position_ids on the fly for batch generation
1234
+ position_ids = attention_mask.long().cumsum(-1) - 1
1235
+ position_ids.masked_fill_(attention_mask == 0, 1)
1236
+ if past_key_values:
1237
+ position_ids = position_ids[:, -input_ids.shape[1]:]
1238
+
1239
+ # This `clone` call is needed to avoid recapturing cuda graphs with `torch.compile`'s `mode="reduce-overhead`, as otherwise the input `position_ids` would have various stride during the decoding. Here, simply using `.contiguous()` is not sufficient as in the batch size = 1 case, `position_ids` is already contiguous but with varying stride which retriggers a capture.
1240
+ position_ids = position_ids.clone(memory_format=torch.contiguous_format)
1241
+
1242
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
1243
+ if inputs_embeds is not None and cache_position[0] == 0:
1244
+ model_inputs = {"inputs_embeds": inputs_embeds, "input_ids": None}
1245
+ else:
1246
+ # The clone here is for the same reason as for `position_ids`.
1247
+ model_inputs = {"input_ids": input_ids.clone(memory_format=torch.contiguous_format), "inputs_embeds": None}
1248
+
1249
+ assert not isinstance(past_key_values, StaticCache), "DeciLM does not support StaticCache"
1250
+ if isinstance(past_key_values, StaticCache) and attention_mask.ndim == 2:
1251
+ if model_inputs["inputs_embeds"] is not None:
1252
+ batch_size, sequence_length, _ = model_inputs["inputs_embeds"].shape
1253
+ device = model_inputs["inputs_embeds"].device
1254
+ else:
1255
+ batch_size, sequence_length = model_inputs["input_ids"].shape
1256
+ device = model_inputs["input_ids"].device
1257
+
1258
+ dtype = self.lm_head.weight.dtype
1259
+ min_dtype = torch.finfo(dtype).min
1260
+
1261
+ attention_mask = _prepare_4d_causal_attention_mask_with_cache_position(
1262
+ attention_mask,
1263
+ sequence_length=sequence_length,
1264
+ target_length=past_key_values.get_max_length(),
1265
+ dtype=dtype,
1266
+ device=device,
1267
+ min_dtype=min_dtype,
1268
+ cache_position=cache_position,
1269
+ batch_size=batch_size,
1270
+ )
1271
+
1272
+ model_inputs.update(
1273
+ {
1274
+ "position_ids": position_ids,
1275
+ "cache_position": cache_position,
1276
+ "past_key_values": past_key_values,
1277
+ "use_cache": use_cache,
1278
+ "attention_mask": attention_mask,
1279
+ }
1280
+ )
1281
+ return model_inputs
1282
+
1283
+ def _maybe_initialize_input_ids_for_generation(
1284
+ self,
1285
+ inputs: Optional[torch.Tensor] = None,
1286
+ bos_token_id: Optional[torch.Tensor] = None,
1287
+ model_kwargs: Optional[dict[str, torch.Tensor]] = None,
1288
+ ) -> torch.LongTensor:
1289
+ """
1290
+ Patching hf bug that creates wrong cache length if only inputs_embeds are passed to the model
1291
+ """
1292
+ input_ids = super()._maybe_initialize_input_ids_for_generation(
1293
+ inputs=inputs, bos_token_id=bos_token_id, model_kwargs=model_kwargs)
1294
+ if (
1295
+ "inputs_embeds" in model_kwargs
1296
+ and input_ids is not None
1297
+ and input_ids.shape[1] == 0
1298
+ ):
1299
+ batch_size, input_sequence_length = model_kwargs["inputs_embeds"].shape[:2]
1300
+ input_ids = torch.zeros((batch_size, input_sequence_length), dtype=torch.long, device=self.device)
1301
+ return input_ids
1302
+
1303
+ def generate(
1304
+ self,
1305
+ inputs: Optional[torch.Tensor] = None,
1306
+ *args,
1307
+ **kwargs,
1308
+ ) -> Union[GenerateOutput, torch.LongTensor]:
1309
+ """
1310
+ Patching hf bug that creates wrong cache length if only inputs_embeds are passed to the model
1311
+ """
1312
+ only_passed_inputs_embeds = (
1313
+ "inputs_embeds" in kwargs and
1314
+ "input_ids" not in kwargs and
1315
+ inputs is None
1316
+ )
1317
+ if only_passed_inputs_embeds:
1318
+ input_sequence_length = kwargs["inputs_embeds"].shape[1]
1319
+
1320
+ generation_output = super().generate(inputs=inputs, *args, **kwargs)
1321
+
1322
+ if only_passed_inputs_embeds and isinstance(generation_output, torch.Tensor):
1323
+ generation_output = generation_output[:, input_sequence_length:]
1324
+
1325
+ return generation_output
1326
+
1327
+
1328
+ @add_start_docstrings(
1329
+ """
1330
+ The DeciLM Model transformer with a sequence classification head on top (linear layer).
1331
+
1332
+ [`DeciLMForSequenceClassification`] uses the last token in order to do the classification, as other causal models
1333
+ (e.g. GPT-2) do.
1334
+
1335
+ Since it does classification on the last token, it requires to know the position of the last token. If a
1336
+ `pad_token_id` is defined in the configuration, it finds the last token that is not a padding token in each row. If
1337
+ no `pad_token_id` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
1338
+ padding tokens when `inputs_embeds` are passed instead of `input_ids`, it does the same (take the last value in
1339
+ each row of the batch).
1340
+ """,
1341
+ DECILM_START_DOCSTRING,
1342
+ )
1343
+ class DeciLMForSequenceClassification(DeciLMPreTrainedModel):
1344
+ def __init__(self, config):
1345
+ super().__init__(config)
1346
+ self.num_labels = config.num_labels
1347
+ self.model = DeciLMModel(config)
1348
+ self.score = nn.Linear(config.hidden_size, self.num_labels, bias=False)
1349
+
1350
+ # Initialize weights and apply final processing
1351
+ self.post_init()
1352
+
1353
+ def get_input_embeddings(self):
1354
+ return self.model.embed_tokens
1355
+
1356
+ def set_input_embeddings(self, value):
1357
+ self.model.embed_tokens = value
1358
+
1359
+ @add_start_docstrings_to_model_forward(DECILM_INPUTS_DOCSTRING)
1360
+ def forward(
1361
+ self,
1362
+ input_ids: Optional[torch.LongTensor] = None,
1363
+ attention_mask: Optional[torch.Tensor] = None,
1364
+ position_ids: Optional[torch.LongTensor] = None,
1365
+ past_key_values: Optional[Union[Cache, List[torch.FloatTensor]]] = None,
1366
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1367
+ labels: Optional[torch.LongTensor] = None,
1368
+ use_cache: Optional[bool] = None,
1369
+ output_attentions: Optional[bool] = None,
1370
+ output_hidden_states: Optional[bool] = None,
1371
+ return_dict: Optional[bool] = None,
1372
+ ) -> Union[Tuple, SequenceClassifierOutputWithPast]:
1373
+ r"""
1374
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1375
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1376
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1377
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1378
+ """
1379
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1380
+
1381
+ transformer_outputs = self.model(
1382
+ input_ids,
1383
+ attention_mask=attention_mask,
1384
+ position_ids=position_ids,
1385
+ past_key_values=past_key_values,
1386
+ inputs_embeds=inputs_embeds,
1387
+ use_cache=use_cache,
1388
+ output_attentions=output_attentions,
1389
+ output_hidden_states=output_hidden_states,
1390
+ return_dict=return_dict,
1391
+ )
1392
+ hidden_states = transformer_outputs[0]
1393
+ logits = self.score(hidden_states)
1394
+
1395
+ if input_ids is not None:
1396
+ batch_size = input_ids.shape[0]
1397
+ else:
1398
+ batch_size = inputs_embeds.shape[0]
1399
+
1400
+ if self.config.pad_token_id is None and batch_size != 1:
1401
+ raise ValueError("Cannot handle batch sizes > 1 if no padding token is defined.")
1402
+ if self.config.pad_token_id is None:
1403
+ sequence_lengths = -1
1404
+ else:
1405
+ if input_ids is not None:
1406
+ # if no pad token found, use modulo instead of reverse indexing for ONNX compatibility
1407
+ sequence_lengths = torch.eq(input_ids, self.config.pad_token_id).int().argmax(-1) - 1
1408
+ sequence_lengths = sequence_lengths % input_ids.shape[-1]
1409
+ sequence_lengths = sequence_lengths.to(logits.device)
1410
+ else:
1411
+ sequence_lengths = -1
1412
+
1413
+ pooled_logits = logits[torch.arange(batch_size, device=logits.device), sequence_lengths]
1414
+
1415
+ loss = None
1416
+ if labels is not None:
1417
+ labels = labels.to(logits.device)
1418
+ if self.config.problem_type is None:
1419
+ if self.num_labels == 1:
1420
+ self.config.problem_type = "regression"
1421
+ elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
1422
+ self.config.problem_type = "single_label_classification"
1423
+ else:
1424
+ self.config.problem_type = "multi_label_classification"
1425
+
1426
+ if self.config.problem_type == "regression":
1427
+ loss_fct = MSELoss()
1428
+ if self.num_labels == 1:
1429
+ loss = loss_fct(pooled_logits.squeeze(), labels.squeeze())
1430
+ else:
1431
+ loss = loss_fct(pooled_logits, labels)
1432
+ elif self.config.problem_type == "single_label_classification":
1433
+ loss_fct = CrossEntropyLoss()
1434
+ loss = loss_fct(pooled_logits.view(-1, self.num_labels), labels.view(-1))
1435
+ elif self.config.problem_type == "multi_label_classification":
1436
+ loss_fct = BCEWithLogitsLoss()
1437
+ loss = loss_fct(pooled_logits, labels)
1438
+ if not return_dict:
1439
+ output = (pooled_logits,) + transformer_outputs[1:]
1440
+ return ((loss,) + output) if loss is not None else output
1441
+
1442
+ return SequenceClassifierOutputWithPast(
1443
+ loss=loss,
1444
+ logits=pooled_logits,
1445
+ past_key_values=transformer_outputs.past_key_values,
1446
+ hidden_states=transformer_outputs.hidden_states,
1447
+ attentions=transformer_outputs.attentions,
1448
+ )
1449
+
1450
+
1451
+ @add_start_docstrings(
1452
+ """
1453
+ The DeciLM Model transformer with a span classification head on top for extractive question-answering tasks like
1454
+ SQuAD (a linear layer on top of the hidden-states output to compute `span start logits` and `span end logits`).
1455
+ """,
1456
+ DECILM_START_DOCSTRING,
1457
+ )
1458
+ class DeciLMForQuestionAnswering(DeciLMPreTrainedModel):
1459
+ base_model_prefix = "transformer"
1460
+
1461
+ # Copied from transformers.models.bloom.modeling_bloom.BloomForQuestionAnswering.__init__ with Bloom->DeciLM
1462
+ def __init__(self, config):
1463
+ super().__init__(config)
1464
+ self.transformer = DeciLMModel(config)
1465
+ self.qa_outputs = nn.Linear(config.hidden_size, 2)
1466
+
1467
+ # Initialize weights and apply final processing
1468
+ self.post_init()
1469
+
1470
+ def get_input_embeddings(self):
1471
+ return self.transformer.embed_tokens
1472
+
1473
+ def set_input_embeddings(self, value):
1474
+ self.transformer.embed_tokens = value
1475
+
1476
+ @add_start_docstrings_to_model_forward(DECILM_INPUTS_DOCSTRING)
1477
+ def forward(
1478
+ self,
1479
+ input_ids: Optional[torch.LongTensor] = None,
1480
+ attention_mask: Optional[torch.FloatTensor] = None,
1481
+ position_ids: Optional[torch.LongTensor] = None,
1482
+ past_key_values: Optional[Union[Cache, List[torch.FloatTensor]]] = None,
1483
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1484
+ start_positions: Optional[torch.LongTensor] = None,
1485
+ end_positions: Optional[torch.LongTensor] = None,
1486
+ output_attentions: Optional[bool] = None,
1487
+ output_hidden_states: Optional[bool] = None,
1488
+ return_dict: Optional[bool] = None,
1489
+ ) -> Union[Tuple, QuestionAnsweringModelOutput]:
1490
+ r"""
1491
+ start_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1492
+ Labels for position (index) of the start of the labelled span for computing the token classification loss.
1493
+ Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
1494
+ are not taken into account for computing the loss.
1495
+ end_positions (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1496
+ Labels for position (index) of the end of the labelled span for computing the token classification loss.
1497
+ Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
1498
+ are not taken into account for computing the loss.
1499
+ """
1500
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1501
+
1502
+ outputs = self.transformer(
1503
+ input_ids,
1504
+ attention_mask=attention_mask,
1505
+ position_ids=position_ids,
1506
+ past_key_values=past_key_values,
1507
+ inputs_embeds=inputs_embeds,
1508
+ output_attentions=output_attentions,
1509
+ output_hidden_states=output_hidden_states,
1510
+ return_dict=return_dict,
1511
+ )
1512
+
1513
+ sequence_output = outputs[0]
1514
+
1515
+ logits = self.qa_outputs(sequence_output)
1516
+ start_logits, end_logits = logits.split(1, dim=-1)
1517
+ start_logits = start_logits.squeeze(-1).contiguous()
1518
+ end_logits = end_logits.squeeze(-1).contiguous()
1519
+
1520
+ total_loss = None
1521
+ if start_positions is not None and end_positions is not None:
1522
+ # If we are on multi-GPU, split add a dimension
1523
+ if len(start_positions.size()) > 1:
1524
+ start_positions = start_positions.squeeze(-1).to(start_logits.device)
1525
+ if len(end_positions.size()) > 1:
1526
+ end_positions = end_positions.squeeze(-1).to(end_logits.device)
1527
+ # sometimes the start/end positions are outside our model inputs, we ignore these terms
1528
+ ignored_index = start_logits.size(1)
1529
+ start_positions = start_positions.clamp(0, ignored_index)
1530
+ end_positions = end_positions.clamp(0, ignored_index)
1531
+
1532
+ loss_fct = CrossEntropyLoss(ignore_index=ignored_index)
1533
+ start_loss = loss_fct(start_logits, start_positions)
1534
+ end_loss = loss_fct(end_logits, end_positions)
1535
+ total_loss = (start_loss + end_loss) / 2
1536
+
1537
+ if not return_dict:
1538
+ output = (start_logits, end_logits) + outputs[2:]
1539
+ return ((total_loss,) + output) if total_loss is not None else output
1540
+
1541
+ return QuestionAnsweringModelOutput(
1542
+ loss=total_loss,
1543
+ start_logits=start_logits,
1544
+ end_logits=end_logits,
1545
+ hidden_states=outputs.hidden_states,
1546
+ attentions=outputs.attentions,
1547
+ )
1548
+
1549
+
1550
+ @add_start_docstrings(
1551
+ """
1552
+ The DeciLM Model transformer with a token classification head on top (a linear layer on top of the hidden-states
1553
+ output) e.g. for Named-Entity-Recognition (NER) tasks.
1554
+ """,
1555
+ DECILM_START_DOCSTRING,
1556
+ )
1557
+ class DeciLMForTokenClassification(DeciLMPreTrainedModel):
1558
+ def __init__(self, config):
1559
+ super().__init__(config)
1560
+ self.num_labels = config.num_labels
1561
+ self.model = DeciLMModel(config)
1562
+ if getattr(config, "classifier_dropout", None) is not None:
1563
+ classifier_dropout = config.classifier_dropout
1564
+ elif getattr(config, "hidden_dropout", None) is not None:
1565
+ classifier_dropout = config.hidden_dropout
1566
+ else:
1567
+ classifier_dropout = 0.1
1568
+ self.dropout = nn.Dropout(classifier_dropout)
1569
+ self.score = nn.Linear(config.hidden_size, config.num_labels)
1570
+
1571
+ # Initialize weights and apply final processing
1572
+ self.post_init()
1573
+
1574
+ def get_input_embeddings(self):
1575
+ return self.model.embed_tokens
1576
+
1577
+ def set_input_embeddings(self, value):
1578
+ self.model.embed_tokens = value
1579
+
1580
+ @add_start_docstrings_to_model_forward(DECILM_INPUTS_DOCSTRING)
1581
+ def forward(
1582
+ self,
1583
+ input_ids: Optional[torch.LongTensor] = None,
1584
+ attention_mask: Optional[torch.Tensor] = None,
1585
+ position_ids: Optional[torch.LongTensor] = None,
1586
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1587
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1588
+ labels: Optional[torch.LongTensor] = None,
1589
+ use_cache: Optional[bool] = None,
1590
+ output_attentions: Optional[bool] = None,
1591
+ output_hidden_states: Optional[bool] = None,
1592
+ return_dict: Optional[bool] = None,
1593
+ ) -> Union[Tuple, TokenClassifierOutput]:
1594
+ r"""
1595
+ labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
1596
+ Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
1597
+ config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
1598
+ `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
1599
+ """
1600
+ return_dict = return_dict if return_dict is not None else self.config.use_return_dict
1601
+
1602
+ outputs = self.model(
1603
+ input_ids,
1604
+ attention_mask=attention_mask,
1605
+ position_ids=position_ids,
1606
+ past_key_values=past_key_values,
1607
+ inputs_embeds=inputs_embeds,
1608
+ use_cache=use_cache,
1609
+ output_attentions=output_attentions,
1610
+ output_hidden_states=output_hidden_states,
1611
+ return_dict=return_dict,
1612
+ )
1613
+ sequence_output = outputs[0]
1614
+ sequence_output = self.dropout(sequence_output)
1615
+ logits = self.score(sequence_output)
1616
+
1617
+ loss = None
1618
+ if labels is not None:
1619
+ loss_fct = CrossEntropyLoss()
1620
+ loss = loss_fct(logits.view(-1, self.num_labels), labels.view(-1))
1621
+
1622
+ if not return_dict:
1623
+ output = (logits,) + outputs[2:]
1624
+ return ((loss,) + output) if loss is not None else output
1625
+
1626
+ return TokenClassifierOutput(
1627
+ loss=loss,
1628
+ logits=logits,
1629
+ hidden_states=outputs.hidden_states,
1630
+ attentions=outputs.attentions,
1631
+ )
1632
+
1633
+
1634
+ ########################################################################
1635
+ # DeciLM-specific code
1636
+ ########################################################################
1637
+
1638
+
1639
+ def _ffn_mult_to_intermediate_size(ffn_mult: float, n_embd: int) -> int:
1640
+ # DeciLM-specific code
1641
+ intermediate_size = int(2 * ffn_mult * n_embd / 3)
1642
+ return _find_multiple(intermediate_size, 256)
1643
+
1644
+
1645
+ def _find_multiple(n: int, k: int) -> int:
1646
+ # DeciLM-specific code
1647
+ if n % k == 0:
1648
+ return n
1649
+ return n + k - (n % k)
1650
+
1651
+
1652
+ class DeciLMLinearMLP(nn.Module):
1653
+ # DeciLM-specific code
1654
+ def __init__(self,
1655
+ config: DeciLMConfig,
1656
+ ):
1657
+ super().__init__()
1658
+ self.linear_mlp = nn.Linear(in_features=config.hidden_size,
1659
+ out_features=config.hidden_size,
1660
+ bias=False)
1661
+
1662
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
1663
+ return self.linear_mlp.forward(x)
1664
+
1665
+
1666
+ class DeciLMLinearAttention(nn.Module):
1667
+ # DeciLM-specific code
1668
+ def __init__(self,
1669
+ config: DeciLMConfig,
1670
+ ):
1671
+ super().__init__()
1672
+ self.linear_attn = nn.Linear(in_features=config.hidden_size,
1673
+ out_features=config.hidden_size,
1674
+ bias=False)
1675
+
1676
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
1677
+ return self.linear_attn.forward(x)
1678
+
1679
+
1680
+ def sparsity_backward_hook(*args, **kwargs):
1681
+ raise NotImplementedError("No support for sparsity when training HF DeciLM (inference is ok though)")
special_tokens_map.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|begin_of_text|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|eot_id|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ }
16
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b9e4e7fb171f92fd137b777cc2714bf87d11576700a1dcd7a399e7bbe39537b
3
+ size 17209920
tokenizer_config.json ADDED
@@ -0,0 +1,2062 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "128000": {
4
+ "content": "<|begin_of_text|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "128001": {
12
+ "content": "<|end_of_text|>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "128002": {
20
+ "content": "<|reserved_special_token_0|>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "128003": {
28
+ "content": "<|reserved_special_token_1|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128004": {
36
+ "content": "<|finetune_right_pad_id|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "128005": {
44
+ "content": "<|reserved_special_token_2|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "128006": {
52
+ "content": "<|start_header_id|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "128007": {
60
+ "content": "<|end_header_id|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "128008": {
68
+ "content": "<|eom_id|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "128009": {
76
+ "content": "<|eot_id|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "128010": {
84
+ "content": "<|python_tag|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "128011": {
92
+ "content": "<|reserved_special_token_3|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "128012": {
100
+ "content": "<|reserved_special_token_4|>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "128013": {
108
+ "content": "<|reserved_special_token_5|>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "128014": {
116
+ "content": "<|reserved_special_token_6|>",
117
+ "lstrip": false,
118
+ "normalized": false,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": true
122
+ },
123
+ "128015": {
124
+ "content": "<|reserved_special_token_7|>",
125
+ "lstrip": false,
126
+ "normalized": false,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": true
130
+ },
131
+ "128016": {
132
+ "content": "<|reserved_special_token_8|>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": true
138
+ },
139
+ "128017": {
140
+ "content": "<|reserved_special_token_9|>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": true
146
+ },
147
+ "128018": {
148
+ "content": "<|reserved_special_token_10|>",
149
+ "lstrip": false,
150
+ "normalized": false,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": true
154
+ },
155
+ "128019": {
156
+ "content": "<|reserved_special_token_11|>",
157
+ "lstrip": false,
158
+ "normalized": false,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": true
162
+ },
163
+ "128020": {
164
+ "content": "<|reserved_special_token_12|>",
165
+ "lstrip": false,
166
+ "normalized": false,
167
+ "rstrip": false,
168
+ "single_word": false,
169
+ "special": true
170
+ },
171
+ "128021": {
172
+ "content": "<|reserved_special_token_13|>",
173
+ "lstrip": false,
174
+ "normalized": false,
175
+ "rstrip": false,
176
+ "single_word": false,
177
+ "special": true
178
+ },
179
+ "128022": {
180
+ "content": "<|reserved_special_token_14|>",
181
+ "lstrip": false,
182
+ "normalized": false,
183
+ "rstrip": false,
184
+ "single_word": false,
185
+ "special": true
186
+ },
187
+ "128023": {
188
+ "content": "<|reserved_special_token_15|>",
189
+ "lstrip": false,
190
+ "normalized": false,
191
+ "rstrip": false,
192
+ "single_word": false,
193
+ "special": true
194
+ },
195
+ "128024": {
196
+ "content": "<|reserved_special_token_16|>",
197
+ "lstrip": false,
198
+ "normalized": false,
199
+ "rstrip": false,
200
+ "single_word": false,
201
+ "special": true
202
+ },
203
+ "128025": {
204
+ "content": "<|reserved_special_token_17|>",
205
+ "lstrip": false,
206
+ "normalized": false,
207
+ "rstrip": false,
208
+ "single_word": false,
209
+ "special": true
210
+ },
211
+ "128026": {
212
+ "content": "<|reserved_special_token_18|>",
213
+ "lstrip": false,
214
+ "normalized": false,
215
+ "rstrip": false,
216
+ "single_word": false,
217
+ "special": true
218
+ },
219
+ "128027": {
220
+ "content": "<|reserved_special_token_19|>",
221
+ "lstrip": false,
222
+ "normalized": false,
223
+ "rstrip": false,
224
+ "single_word": false,
225
+ "special": true
226
+ },
227
+ "128028": {
228
+ "content": "<|reserved_special_token_20|>",
229
+ "lstrip": false,
230
+ "normalized": false,
231
+ "rstrip": false,
232
+ "single_word": false,
233
+ "special": true
234
+ },
235
+ "128029": {
236
+ "content": "<|reserved_special_token_21|>",
237
+ "lstrip": false,
238
+ "normalized": false,
239
+ "rstrip": false,
240
+ "single_word": false,
241
+ "special": true
242
+ },
243
+ "128030": {
244
+ "content": "<|reserved_special_token_22|>",
245
+ "lstrip": false,
246
+ "normalized": false,
247
+ "rstrip": false,
248
+ "single_word": false,
249
+ "special": true
250
+ },
251
+ "128031": {
252
+ "content": "<|reserved_special_token_23|>",
253
+ "lstrip": false,
254
+ "normalized": false,
255
+ "rstrip": false,
256
+ "single_word": false,
257
+ "special": true
258
+ },
259
+ "128032": {
260
+ "content": "<|reserved_special_token_24|>",
261
+ "lstrip": false,
262
+ "normalized": false,
263
+ "rstrip": false,
264
+ "single_word": false,
265
+ "special": true
266
+ },
267
+ "128033": {
268
+ "content": "<|reserved_special_token_25|>",
269
+ "lstrip": false,
270
+ "normalized": false,
271
+ "rstrip": false,
272
+ "single_word": false,
273
+ "special": true
274
+ },
275
+ "128034": {
276
+ "content": "<|reserved_special_token_26|>",
277
+ "lstrip": false,
278
+ "normalized": false,
279
+ "rstrip": false,
280
+ "single_word": false,
281
+ "special": true
282
+ },
283
+ "128035": {
284
+ "content": "<|reserved_special_token_27|>",
285
+ "lstrip": false,
286
+ "normalized": false,
287
+ "rstrip": false,
288
+ "single_word": false,
289
+ "special": true
290
+ },
291
+ "128036": {
292
+ "content": "<|reserved_special_token_28|>",
293
+ "lstrip": false,
294
+ "normalized": false,
295
+ "rstrip": false,
296
+ "single_word": false,
297
+ "special": true
298
+ },
299
+ "128037": {
300
+ "content": "<|reserved_special_token_29|>",
301
+ "lstrip": false,
302
+ "normalized": false,
303
+ "rstrip": false,
304
+ "single_word": false,
305
+ "special": true
306
+ },
307
+ "128038": {
308
+ "content": "<|reserved_special_token_30|>",
309
+ "lstrip": false,
310
+ "normalized": false,
311
+ "rstrip": false,
312
+ "single_word": false,
313
+ "special": true
314
+ },
315
+ "128039": {
316
+ "content": "<|reserved_special_token_31|>",
317
+ "lstrip": false,
318
+ "normalized": false,
319
+ "rstrip": false,
320
+ "single_word": false,
321
+ "special": true
322
+ },
323
+ "128040": {
324
+ "content": "<|reserved_special_token_32|>",
325
+ "lstrip": false,
326
+ "normalized": false,
327
+ "rstrip": false,
328
+ "single_word": false,
329
+ "special": true
330
+ },
331
+ "128041": {
332
+ "content": "<|reserved_special_token_33|>",
333
+ "lstrip": false,
334
+ "normalized": false,
335
+ "rstrip": false,
336
+ "single_word": false,
337
+ "special": true
338
+ },
339
+ "128042": {
340
+ "content": "<|reserved_special_token_34|>",
341
+ "lstrip": false,
342
+ "normalized": false,
343
+ "rstrip": false,
344
+ "single_word": false,
345
+ "special": true
346
+ },
347
+ "128043": {
348
+ "content": "<|reserved_special_token_35|>",
349
+ "lstrip": false,
350
+ "normalized": false,
351
+ "rstrip": false,
352
+ "single_word": false,
353
+ "special": true
354
+ },
355
+ "128044": {
356
+ "content": "<|reserved_special_token_36|>",
357
+ "lstrip": false,
358
+ "normalized": false,
359
+ "rstrip": false,
360
+ "single_word": false,
361
+ "special": true
362
+ },
363
+ "128045": {
364
+ "content": "<|reserved_special_token_37|>",
365
+ "lstrip": false,
366
+ "normalized": false,
367
+ "rstrip": false,
368
+ "single_word": false,
369
+ "special": true
370
+ },
371
+ "128046": {
372
+ "content": "<|reserved_special_token_38|>",
373
+ "lstrip": false,
374
+ "normalized": false,
375
+ "rstrip": false,
376
+ "single_word": false,
377
+ "special": true
378
+ },
379
+ "128047": {
380
+ "content": "<|reserved_special_token_39|>",
381
+ "lstrip": false,
382
+ "normalized": false,
383
+ "rstrip": false,
384
+ "single_word": false,
385
+ "special": true
386
+ },
387
+ "128048": {
388
+ "content": "<|reserved_special_token_40|>",
389
+ "lstrip": false,
390
+ "normalized": false,
391
+ "rstrip": false,
392
+ "single_word": false,
393
+ "special": true
394
+ },
395
+ "128049": {
396
+ "content": "<|reserved_special_token_41|>",
397
+ "lstrip": false,
398
+ "normalized": false,
399
+ "rstrip": false,
400
+ "single_word": false,
401
+ "special": true
402
+ },
403
+ "128050": {
404
+ "content": "<|reserved_special_token_42|>",
405
+ "lstrip": false,
406
+ "normalized": false,
407
+ "rstrip": false,
408
+ "single_word": false,
409
+ "special": true
410
+ },
411
+ "128051": {
412
+ "content": "<|reserved_special_token_43|>",
413
+ "lstrip": false,
414
+ "normalized": false,
415
+ "rstrip": false,
416
+ "single_word": false,
417
+ "special": true
418
+ },
419
+ "128052": {
420
+ "content": "<|reserved_special_token_44|>",
421
+ "lstrip": false,
422
+ "normalized": false,
423
+ "rstrip": false,
424
+ "single_word": false,
425
+ "special": true
426
+ },
427
+ "128053": {
428
+ "content": "<|reserved_special_token_45|>",
429
+ "lstrip": false,
430
+ "normalized": false,
431
+ "rstrip": false,
432
+ "single_word": false,
433
+ "special": true
434
+ },
435
+ "128054": {
436
+ "content": "<|reserved_special_token_46|>",
437
+ "lstrip": false,
438
+ "normalized": false,
439
+ "rstrip": false,
440
+ "single_word": false,
441
+ "special": true
442
+ },
443
+ "128055": {
444
+ "content": "<|reserved_special_token_47|>",
445
+ "lstrip": false,
446
+ "normalized": false,
447
+ "rstrip": false,
448
+ "single_word": false,
449
+ "special": true
450
+ },
451
+ "128056": {
452
+ "content": "<|reserved_special_token_48|>",
453
+ "lstrip": false,
454
+ "normalized": false,
455
+ "rstrip": false,
456
+ "single_word": false,
457
+ "special": true
458
+ },
459
+ "128057": {
460
+ "content": "<|reserved_special_token_49|>",
461
+ "lstrip": false,
462
+ "normalized": false,
463
+ "rstrip": false,
464
+ "single_word": false,
465
+ "special": true
466
+ },
467
+ "128058": {
468
+ "content": "<|reserved_special_token_50|>",
469
+ "lstrip": false,
470
+ "normalized": false,
471
+ "rstrip": false,
472
+ "single_word": false,
473
+ "special": true
474
+ },
475
+ "128059": {
476
+ "content": "<|reserved_special_token_51|>",
477
+ "lstrip": false,
478
+ "normalized": false,
479
+ "rstrip": false,
480
+ "single_word": false,
481
+ "special": true
482
+ },
483
+ "128060": {
484
+ "content": "<|reserved_special_token_52|>",
485
+ "lstrip": false,
486
+ "normalized": false,
487
+ "rstrip": false,
488
+ "single_word": false,
489
+ "special": true
490
+ },
491
+ "128061": {
492
+ "content": "<|reserved_special_token_53|>",
493
+ "lstrip": false,
494
+ "normalized": false,
495
+ "rstrip": false,
496
+ "single_word": false,
497
+ "special": true
498
+ },
499
+ "128062": {
500
+ "content": "<|reserved_special_token_54|>",
501
+ "lstrip": false,
502
+ "normalized": false,
503
+ "rstrip": false,
504
+ "single_word": false,
505
+ "special": true
506
+ },
507
+ "128063": {
508
+ "content": "<|reserved_special_token_55|>",
509
+ "lstrip": false,
510
+ "normalized": false,
511
+ "rstrip": false,
512
+ "single_word": false,
513
+ "special": true
514
+ },
515
+ "128064": {
516
+ "content": "<|reserved_special_token_56|>",
517
+ "lstrip": false,
518
+ "normalized": false,
519
+ "rstrip": false,
520
+ "single_word": false,
521
+ "special": true
522
+ },
523
+ "128065": {
524
+ "content": "<|reserved_special_token_57|>",
525
+ "lstrip": false,
526
+ "normalized": false,
527
+ "rstrip": false,
528
+ "single_word": false,
529
+ "special": true
530
+ },
531
+ "128066": {
532
+ "content": "<|reserved_special_token_58|>",
533
+ "lstrip": false,
534
+ "normalized": false,
535
+ "rstrip": false,
536
+ "single_word": false,
537
+ "special": true
538
+ },
539
+ "128067": {
540
+ "content": "<|reserved_special_token_59|>",
541
+ "lstrip": false,
542
+ "normalized": false,
543
+ "rstrip": false,
544
+ "single_word": false,
545
+ "special": true
546
+ },
547
+ "128068": {
548
+ "content": "<|reserved_special_token_60|>",
549
+ "lstrip": false,
550
+ "normalized": false,
551
+ "rstrip": false,
552
+ "single_word": false,
553
+ "special": true
554
+ },
555
+ "128069": {
556
+ "content": "<|reserved_special_token_61|>",
557
+ "lstrip": false,
558
+ "normalized": false,
559
+ "rstrip": false,
560
+ "single_word": false,
561
+ "special": true
562
+ },
563
+ "128070": {
564
+ "content": "<|reserved_special_token_62|>",
565
+ "lstrip": false,
566
+ "normalized": false,
567
+ "rstrip": false,
568
+ "single_word": false,
569
+ "special": true
570
+ },
571
+ "128071": {
572
+ "content": "<|reserved_special_token_63|>",
573
+ "lstrip": false,
574
+ "normalized": false,
575
+ "rstrip": false,
576
+ "single_word": false,
577
+ "special": true
578
+ },
579
+ "128072": {
580
+ "content": "<|reserved_special_token_64|>",
581
+ "lstrip": false,
582
+ "normalized": false,
583
+ "rstrip": false,
584
+ "single_word": false,
585
+ "special": true
586
+ },
587
+ "128073": {
588
+ "content": "<|reserved_special_token_65|>",
589
+ "lstrip": false,
590
+ "normalized": false,
591
+ "rstrip": false,
592
+ "single_word": false,
593
+ "special": true
594
+ },
595
+ "128074": {
596
+ "content": "<|reserved_special_token_66|>",
597
+ "lstrip": false,
598
+ "normalized": false,
599
+ "rstrip": false,
600
+ "single_word": false,
601
+ "special": true
602
+ },
603
+ "128075": {
604
+ "content": "<|reserved_special_token_67|>",
605
+ "lstrip": false,
606
+ "normalized": false,
607
+ "rstrip": false,
608
+ "single_word": false,
609
+ "special": true
610
+ },
611
+ "128076": {
612
+ "content": "<|reserved_special_token_68|>",
613
+ "lstrip": false,
614
+ "normalized": false,
615
+ "rstrip": false,
616
+ "single_word": false,
617
+ "special": true
618
+ },
619
+ "128077": {
620
+ "content": "<|reserved_special_token_69|>",
621
+ "lstrip": false,
622
+ "normalized": false,
623
+ "rstrip": false,
624
+ "single_word": false,
625
+ "special": true
626
+ },
627
+ "128078": {
628
+ "content": "<|reserved_special_token_70|>",
629
+ "lstrip": false,
630
+ "normalized": false,
631
+ "rstrip": false,
632
+ "single_word": false,
633
+ "special": true
634
+ },
635
+ "128079": {
636
+ "content": "<|reserved_special_token_71|>",
637
+ "lstrip": false,
638
+ "normalized": false,
639
+ "rstrip": false,
640
+ "single_word": false,
641
+ "special": true
642
+ },
643
+ "128080": {
644
+ "content": "<|reserved_special_token_72|>",
645
+ "lstrip": false,
646
+ "normalized": false,
647
+ "rstrip": false,
648
+ "single_word": false,
649
+ "special": true
650
+ },
651
+ "128081": {
652
+ "content": "<|reserved_special_token_73|>",
653
+ "lstrip": false,
654
+ "normalized": false,
655
+ "rstrip": false,
656
+ "single_word": false,
657
+ "special": true
658
+ },
659
+ "128082": {
660
+ "content": "<|reserved_special_token_74|>",
661
+ "lstrip": false,
662
+ "normalized": false,
663
+ "rstrip": false,
664
+ "single_word": false,
665
+ "special": true
666
+ },
667
+ "128083": {
668
+ "content": "<|reserved_special_token_75|>",
669
+ "lstrip": false,
670
+ "normalized": false,
671
+ "rstrip": false,
672
+ "single_word": false,
673
+ "special": true
674
+ },
675
+ "128084": {
676
+ "content": "<|reserved_special_token_76|>",
677
+ "lstrip": false,
678
+ "normalized": false,
679
+ "rstrip": false,
680
+ "single_word": false,
681
+ "special": true
682
+ },
683
+ "128085": {
684
+ "content": "<|reserved_special_token_77|>",
685
+ "lstrip": false,
686
+ "normalized": false,
687
+ "rstrip": false,
688
+ "single_word": false,
689
+ "special": true
690
+ },
691
+ "128086": {
692
+ "content": "<|reserved_special_token_78|>",
693
+ "lstrip": false,
694
+ "normalized": false,
695
+ "rstrip": false,
696
+ "single_word": false,
697
+ "special": true
698
+ },
699
+ "128087": {
700
+ "content": "<|reserved_special_token_79|>",
701
+ "lstrip": false,
702
+ "normalized": false,
703
+ "rstrip": false,
704
+ "single_word": false,
705
+ "special": true
706
+ },
707
+ "128088": {
708
+ "content": "<|reserved_special_token_80|>",
709
+ "lstrip": false,
710
+ "normalized": false,
711
+ "rstrip": false,
712
+ "single_word": false,
713
+ "special": true
714
+ },
715
+ "128089": {
716
+ "content": "<|reserved_special_token_81|>",
717
+ "lstrip": false,
718
+ "normalized": false,
719
+ "rstrip": false,
720
+ "single_word": false,
721
+ "special": true
722
+ },
723
+ "128090": {
724
+ "content": "<|reserved_special_token_82|>",
725
+ "lstrip": false,
726
+ "normalized": false,
727
+ "rstrip": false,
728
+ "single_word": false,
729
+ "special": true
730
+ },
731
+ "128091": {
732
+ "content": "<|reserved_special_token_83|>",
733
+ "lstrip": false,
734
+ "normalized": false,
735
+ "rstrip": false,
736
+ "single_word": false,
737
+ "special": true
738
+ },
739
+ "128092": {
740
+ "content": "<|reserved_special_token_84|>",
741
+ "lstrip": false,
742
+ "normalized": false,
743
+ "rstrip": false,
744
+ "single_word": false,
745
+ "special": true
746
+ },
747
+ "128093": {
748
+ "content": "<|reserved_special_token_85|>",
749
+ "lstrip": false,
750
+ "normalized": false,
751
+ "rstrip": false,
752
+ "single_word": false,
753
+ "special": true
754
+ },
755
+ "128094": {
756
+ "content": "<|reserved_special_token_86|>",
757
+ "lstrip": false,
758
+ "normalized": false,
759
+ "rstrip": false,
760
+ "single_word": false,
761
+ "special": true
762
+ },
763
+ "128095": {
764
+ "content": "<|reserved_special_token_87|>",
765
+ "lstrip": false,
766
+ "normalized": false,
767
+ "rstrip": false,
768
+ "single_word": false,
769
+ "special": true
770
+ },
771
+ "128096": {
772
+ "content": "<|reserved_special_token_88|>",
773
+ "lstrip": false,
774
+ "normalized": false,
775
+ "rstrip": false,
776
+ "single_word": false,
777
+ "special": true
778
+ },
779
+ "128097": {
780
+ "content": "<|reserved_special_token_89|>",
781
+ "lstrip": false,
782
+ "normalized": false,
783
+ "rstrip": false,
784
+ "single_word": false,
785
+ "special": true
786
+ },
787
+ "128098": {
788
+ "content": "<|reserved_special_token_90|>",
789
+ "lstrip": false,
790
+ "normalized": false,
791
+ "rstrip": false,
792
+ "single_word": false,
793
+ "special": true
794
+ },
795
+ "128099": {
796
+ "content": "<|reserved_special_token_91|>",
797
+ "lstrip": false,
798
+ "normalized": false,
799
+ "rstrip": false,
800
+ "single_word": false,
801
+ "special": true
802
+ },
803
+ "128100": {
804
+ "content": "<|reserved_special_token_92|>",
805
+ "lstrip": false,
806
+ "normalized": false,
807
+ "rstrip": false,
808
+ "single_word": false,
809
+ "special": true
810
+ },
811
+ "128101": {
812
+ "content": "<|reserved_special_token_93|>",
813
+ "lstrip": false,
814
+ "normalized": false,
815
+ "rstrip": false,
816
+ "single_word": false,
817
+ "special": true
818
+ },
819
+ "128102": {
820
+ "content": "<|reserved_special_token_94|>",
821
+ "lstrip": false,
822
+ "normalized": false,
823
+ "rstrip": false,
824
+ "single_word": false,
825
+ "special": true
826
+ },
827
+ "128103": {
828
+ "content": "<|reserved_special_token_95|>",
829
+ "lstrip": false,
830
+ "normalized": false,
831
+ "rstrip": false,
832
+ "single_word": false,
833
+ "special": true
834
+ },
835
+ "128104": {
836
+ "content": "<|reserved_special_token_96|>",
837
+ "lstrip": false,
838
+ "normalized": false,
839
+ "rstrip": false,
840
+ "single_word": false,
841
+ "special": true
842
+ },
843
+ "128105": {
844
+ "content": "<|reserved_special_token_97|>",
845
+ "lstrip": false,
846
+ "normalized": false,
847
+ "rstrip": false,
848
+ "single_word": false,
849
+ "special": true
850
+ },
851
+ "128106": {
852
+ "content": "<|reserved_special_token_98|>",
853
+ "lstrip": false,
854
+ "normalized": false,
855
+ "rstrip": false,
856
+ "single_word": false,
857
+ "special": true
858
+ },
859
+ "128107": {
860
+ "content": "<|reserved_special_token_99|>",
861
+ "lstrip": false,
862
+ "normalized": false,
863
+ "rstrip": false,
864
+ "single_word": false,
865
+ "special": true
866
+ },
867
+ "128108": {
868
+ "content": "<|reserved_special_token_100|>",
869
+ "lstrip": false,
870
+ "normalized": false,
871
+ "rstrip": false,
872
+ "single_word": false,
873
+ "special": true
874
+ },
875
+ "128109": {
876
+ "content": "<|reserved_special_token_101|>",
877
+ "lstrip": false,
878
+ "normalized": false,
879
+ "rstrip": false,
880
+ "single_word": false,
881
+ "special": true
882
+ },
883
+ "128110": {
884
+ "content": "<|reserved_special_token_102|>",
885
+ "lstrip": false,
886
+ "normalized": false,
887
+ "rstrip": false,
888
+ "single_word": false,
889
+ "special": true
890
+ },
891
+ "128111": {
892
+ "content": "<|reserved_special_token_103|>",
893
+ "lstrip": false,
894
+ "normalized": false,
895
+ "rstrip": false,
896
+ "single_word": false,
897
+ "special": true
898
+ },
899
+ "128112": {
900
+ "content": "<|reserved_special_token_104|>",
901
+ "lstrip": false,
902
+ "normalized": false,
903
+ "rstrip": false,
904
+ "single_word": false,
905
+ "special": true
906
+ },
907
+ "128113": {
908
+ "content": "<|reserved_special_token_105|>",
909
+ "lstrip": false,
910
+ "normalized": false,
911
+ "rstrip": false,
912
+ "single_word": false,
913
+ "special": true
914
+ },
915
+ "128114": {
916
+ "content": "<|reserved_special_token_106|>",
917
+ "lstrip": false,
918
+ "normalized": false,
919
+ "rstrip": false,
920
+ "single_word": false,
921
+ "special": true
922
+ },
923
+ "128115": {
924
+ "content": "<|reserved_special_token_107|>",
925
+ "lstrip": false,
926
+ "normalized": false,
927
+ "rstrip": false,
928
+ "single_word": false,
929
+ "special": true
930
+ },
931
+ "128116": {
932
+ "content": "<|reserved_special_token_108|>",
933
+ "lstrip": false,
934
+ "normalized": false,
935
+ "rstrip": false,
936
+ "single_word": false,
937
+ "special": true
938
+ },
939
+ "128117": {
940
+ "content": "<|reserved_special_token_109|>",
941
+ "lstrip": false,
942
+ "normalized": false,
943
+ "rstrip": false,
944
+ "single_word": false,
945
+ "special": true
946
+ },
947
+ "128118": {
948
+ "content": "<|reserved_special_token_110|>",
949
+ "lstrip": false,
950
+ "normalized": false,
951
+ "rstrip": false,
952
+ "single_word": false,
953
+ "special": true
954
+ },
955
+ "128119": {
956
+ "content": "<|reserved_special_token_111|>",
957
+ "lstrip": false,
958
+ "normalized": false,
959
+ "rstrip": false,
960
+ "single_word": false,
961
+ "special": true
962
+ },
963
+ "128120": {
964
+ "content": "<|reserved_special_token_112|>",
965
+ "lstrip": false,
966
+ "normalized": false,
967
+ "rstrip": false,
968
+ "single_word": false,
969
+ "special": true
970
+ },
971
+ "128121": {
972
+ "content": "<|reserved_special_token_113|>",
973
+ "lstrip": false,
974
+ "normalized": false,
975
+ "rstrip": false,
976
+ "single_word": false,
977
+ "special": true
978
+ },
979
+ "128122": {
980
+ "content": "<|reserved_special_token_114|>",
981
+ "lstrip": false,
982
+ "normalized": false,
983
+ "rstrip": false,
984
+ "single_word": false,
985
+ "special": true
986
+ },
987
+ "128123": {
988
+ "content": "<|reserved_special_token_115|>",
989
+ "lstrip": false,
990
+ "normalized": false,
991
+ "rstrip": false,
992
+ "single_word": false,
993
+ "special": true
994
+ },
995
+ "128124": {
996
+ "content": "<|reserved_special_token_116|>",
997
+ "lstrip": false,
998
+ "normalized": false,
999
+ "rstrip": false,
1000
+ "single_word": false,
1001
+ "special": true
1002
+ },
1003
+ "128125": {
1004
+ "content": "<|reserved_special_token_117|>",
1005
+ "lstrip": false,
1006
+ "normalized": false,
1007
+ "rstrip": false,
1008
+ "single_word": false,
1009
+ "special": true
1010
+ },
1011
+ "128126": {
1012
+ "content": "<|reserved_special_token_118|>",
1013
+ "lstrip": false,
1014
+ "normalized": false,
1015
+ "rstrip": false,
1016
+ "single_word": false,
1017
+ "special": true
1018
+ },
1019
+ "128127": {
1020
+ "content": "<|reserved_special_token_119|>",
1021
+ "lstrip": false,
1022
+ "normalized": false,
1023
+ "rstrip": false,
1024
+ "single_word": false,
1025
+ "special": true
1026
+ },
1027
+ "128128": {
1028
+ "content": "<|reserved_special_token_120|>",
1029
+ "lstrip": false,
1030
+ "normalized": false,
1031
+ "rstrip": false,
1032
+ "single_word": false,
1033
+ "special": true
1034
+ },
1035
+ "128129": {
1036
+ "content": "<|reserved_special_token_121|>",
1037
+ "lstrip": false,
1038
+ "normalized": false,
1039
+ "rstrip": false,
1040
+ "single_word": false,
1041
+ "special": true
1042
+ },
1043
+ "128130": {
1044
+ "content": "<|reserved_special_token_122|>",
1045
+ "lstrip": false,
1046
+ "normalized": false,
1047
+ "rstrip": false,
1048
+ "single_word": false,
1049
+ "special": true
1050
+ },
1051
+ "128131": {
1052
+ "content": "<|reserved_special_token_123|>",
1053
+ "lstrip": false,
1054
+ "normalized": false,
1055
+ "rstrip": false,
1056
+ "single_word": false,
1057
+ "special": true
1058
+ },
1059
+ "128132": {
1060
+ "content": "<|reserved_special_token_124|>",
1061
+ "lstrip": false,
1062
+ "normalized": false,
1063
+ "rstrip": false,
1064
+ "single_word": false,
1065
+ "special": true
1066
+ },
1067
+ "128133": {
1068
+ "content": "<|reserved_special_token_125|>",
1069
+ "lstrip": false,
1070
+ "normalized": false,
1071
+ "rstrip": false,
1072
+ "single_word": false,
1073
+ "special": true
1074
+ },
1075
+ "128134": {
1076
+ "content": "<|reserved_special_token_126|>",
1077
+ "lstrip": false,
1078
+ "normalized": false,
1079
+ "rstrip": false,
1080
+ "single_word": false,
1081
+ "special": true
1082
+ },
1083
+ "128135": {
1084
+ "content": "<|reserved_special_token_127|>",
1085
+ "lstrip": false,
1086
+ "normalized": false,
1087
+ "rstrip": false,
1088
+ "single_word": false,
1089
+ "special": true
1090
+ },
1091
+ "128136": {
1092
+ "content": "<|reserved_special_token_128|>",
1093
+ "lstrip": false,
1094
+ "normalized": false,
1095
+ "rstrip": false,
1096
+ "single_word": false,
1097
+ "special": true
1098
+ },
1099
+ "128137": {
1100
+ "content": "<|reserved_special_token_129|>",
1101
+ "lstrip": false,
1102
+ "normalized": false,
1103
+ "rstrip": false,
1104
+ "single_word": false,
1105
+ "special": true
1106
+ },
1107
+ "128138": {
1108
+ "content": "<|reserved_special_token_130|>",
1109
+ "lstrip": false,
1110
+ "normalized": false,
1111
+ "rstrip": false,
1112
+ "single_word": false,
1113
+ "special": true
1114
+ },
1115
+ "128139": {
1116
+ "content": "<|reserved_special_token_131|>",
1117
+ "lstrip": false,
1118
+ "normalized": false,
1119
+ "rstrip": false,
1120
+ "single_word": false,
1121
+ "special": true
1122
+ },
1123
+ "128140": {
1124
+ "content": "<|reserved_special_token_132|>",
1125
+ "lstrip": false,
1126
+ "normalized": false,
1127
+ "rstrip": false,
1128
+ "single_word": false,
1129
+ "special": true
1130
+ },
1131
+ "128141": {
1132
+ "content": "<|reserved_special_token_133|>",
1133
+ "lstrip": false,
1134
+ "normalized": false,
1135
+ "rstrip": false,
1136
+ "single_word": false,
1137
+ "special": true
1138
+ },
1139
+ "128142": {
1140
+ "content": "<|reserved_special_token_134|>",
1141
+ "lstrip": false,
1142
+ "normalized": false,
1143
+ "rstrip": false,
1144
+ "single_word": false,
1145
+ "special": true
1146
+ },
1147
+ "128143": {
1148
+ "content": "<|reserved_special_token_135|>",
1149
+ "lstrip": false,
1150
+ "normalized": false,
1151
+ "rstrip": false,
1152
+ "single_word": false,
1153
+ "special": true
1154
+ },
1155
+ "128144": {
1156
+ "content": "<|reserved_special_token_136|>",
1157
+ "lstrip": false,
1158
+ "normalized": false,
1159
+ "rstrip": false,
1160
+ "single_word": false,
1161
+ "special": true
1162
+ },
1163
+ "128145": {
1164
+ "content": "<|reserved_special_token_137|>",
1165
+ "lstrip": false,
1166
+ "normalized": false,
1167
+ "rstrip": false,
1168
+ "single_word": false,
1169
+ "special": true
1170
+ },
1171
+ "128146": {
1172
+ "content": "<|reserved_special_token_138|>",
1173
+ "lstrip": false,
1174
+ "normalized": false,
1175
+ "rstrip": false,
1176
+ "single_word": false,
1177
+ "special": true
1178
+ },
1179
+ "128147": {
1180
+ "content": "<|reserved_special_token_139|>",
1181
+ "lstrip": false,
1182
+ "normalized": false,
1183
+ "rstrip": false,
1184
+ "single_word": false,
1185
+ "special": true
1186
+ },
1187
+ "128148": {
1188
+ "content": "<|reserved_special_token_140|>",
1189
+ "lstrip": false,
1190
+ "normalized": false,
1191
+ "rstrip": false,
1192
+ "single_word": false,
1193
+ "special": true
1194
+ },
1195
+ "128149": {
1196
+ "content": "<|reserved_special_token_141|>",
1197
+ "lstrip": false,
1198
+ "normalized": false,
1199
+ "rstrip": false,
1200
+ "single_word": false,
1201
+ "special": true
1202
+ },
1203
+ "128150": {
1204
+ "content": "<|reserved_special_token_142|>",
1205
+ "lstrip": false,
1206
+ "normalized": false,
1207
+ "rstrip": false,
1208
+ "single_word": false,
1209
+ "special": true
1210
+ },
1211
+ "128151": {
1212
+ "content": "<|reserved_special_token_143|>",
1213
+ "lstrip": false,
1214
+ "normalized": false,
1215
+ "rstrip": false,
1216
+ "single_word": false,
1217
+ "special": true
1218
+ },
1219
+ "128152": {
1220
+ "content": "<|reserved_special_token_144|>",
1221
+ "lstrip": false,
1222
+ "normalized": false,
1223
+ "rstrip": false,
1224
+ "single_word": false,
1225
+ "special": true
1226
+ },
1227
+ "128153": {
1228
+ "content": "<|reserved_special_token_145|>",
1229
+ "lstrip": false,
1230
+ "normalized": false,
1231
+ "rstrip": false,
1232
+ "single_word": false,
1233
+ "special": true
1234
+ },
1235
+ "128154": {
1236
+ "content": "<|reserved_special_token_146|>",
1237
+ "lstrip": false,
1238
+ "normalized": false,
1239
+ "rstrip": false,
1240
+ "single_word": false,
1241
+ "special": true
1242
+ },
1243
+ "128155": {
1244
+ "content": "<|reserved_special_token_147|>",
1245
+ "lstrip": false,
1246
+ "normalized": false,
1247
+ "rstrip": false,
1248
+ "single_word": false,
1249
+ "special": true
1250
+ },
1251
+ "128156": {
1252
+ "content": "<|reserved_special_token_148|>",
1253
+ "lstrip": false,
1254
+ "normalized": false,
1255
+ "rstrip": false,
1256
+ "single_word": false,
1257
+ "special": true
1258
+ },
1259
+ "128157": {
1260
+ "content": "<|reserved_special_token_149|>",
1261
+ "lstrip": false,
1262
+ "normalized": false,
1263
+ "rstrip": false,
1264
+ "single_word": false,
1265
+ "special": true
1266
+ },
1267
+ "128158": {
1268
+ "content": "<|reserved_special_token_150|>",
1269
+ "lstrip": false,
1270
+ "normalized": false,
1271
+ "rstrip": false,
1272
+ "single_word": false,
1273
+ "special": true
1274
+ },
1275
+ "128159": {
1276
+ "content": "<|reserved_special_token_151|>",
1277
+ "lstrip": false,
1278
+ "normalized": false,
1279
+ "rstrip": false,
1280
+ "single_word": false,
1281
+ "special": true
1282
+ },
1283
+ "128160": {
1284
+ "content": "<|reserved_special_token_152|>",
1285
+ "lstrip": false,
1286
+ "normalized": false,
1287
+ "rstrip": false,
1288
+ "single_word": false,
1289
+ "special": true
1290
+ },
1291
+ "128161": {
1292
+ "content": "<|reserved_special_token_153|>",
1293
+ "lstrip": false,
1294
+ "normalized": false,
1295
+ "rstrip": false,
1296
+ "single_word": false,
1297
+ "special": true
1298
+ },
1299
+ "128162": {
1300
+ "content": "<|reserved_special_token_154|>",
1301
+ "lstrip": false,
1302
+ "normalized": false,
1303
+ "rstrip": false,
1304
+ "single_word": false,
1305
+ "special": true
1306
+ },
1307
+ "128163": {
1308
+ "content": "<|reserved_special_token_155|>",
1309
+ "lstrip": false,
1310
+ "normalized": false,
1311
+ "rstrip": false,
1312
+ "single_word": false,
1313
+ "special": true
1314
+ },
1315
+ "128164": {
1316
+ "content": "<|reserved_special_token_156|>",
1317
+ "lstrip": false,
1318
+ "normalized": false,
1319
+ "rstrip": false,
1320
+ "single_word": false,
1321
+ "special": true
1322
+ },
1323
+ "128165": {
1324
+ "content": "<|reserved_special_token_157|>",
1325
+ "lstrip": false,
1326
+ "normalized": false,
1327
+ "rstrip": false,
1328
+ "single_word": false,
1329
+ "special": true
1330
+ },
1331
+ "128166": {
1332
+ "content": "<|reserved_special_token_158|>",
1333
+ "lstrip": false,
1334
+ "normalized": false,
1335
+ "rstrip": false,
1336
+ "single_word": false,
1337
+ "special": true
1338
+ },
1339
+ "128167": {
1340
+ "content": "<|reserved_special_token_159|>",
1341
+ "lstrip": false,
1342
+ "normalized": false,
1343
+ "rstrip": false,
1344
+ "single_word": false,
1345
+ "special": true
1346
+ },
1347
+ "128168": {
1348
+ "content": "<|reserved_special_token_160|>",
1349
+ "lstrip": false,
1350
+ "normalized": false,
1351
+ "rstrip": false,
1352
+ "single_word": false,
1353
+ "special": true
1354
+ },
1355
+ "128169": {
1356
+ "content": "<|reserved_special_token_161|>",
1357
+ "lstrip": false,
1358
+ "normalized": false,
1359
+ "rstrip": false,
1360
+ "single_word": false,
1361
+ "special": true
1362
+ },
1363
+ "128170": {
1364
+ "content": "<|reserved_special_token_162|>",
1365
+ "lstrip": false,
1366
+ "normalized": false,
1367
+ "rstrip": false,
1368
+ "single_word": false,
1369
+ "special": true
1370
+ },
1371
+ "128171": {
1372
+ "content": "<|reserved_special_token_163|>",
1373
+ "lstrip": false,
1374
+ "normalized": false,
1375
+ "rstrip": false,
1376
+ "single_word": false,
1377
+ "special": true
1378
+ },
1379
+ "128172": {
1380
+ "content": "<|reserved_special_token_164|>",
1381
+ "lstrip": false,
1382
+ "normalized": false,
1383
+ "rstrip": false,
1384
+ "single_word": false,
1385
+ "special": true
1386
+ },
1387
+ "128173": {
1388
+ "content": "<|reserved_special_token_165|>",
1389
+ "lstrip": false,
1390
+ "normalized": false,
1391
+ "rstrip": false,
1392
+ "single_word": false,
1393
+ "special": true
1394
+ },
1395
+ "128174": {
1396
+ "content": "<|reserved_special_token_166|>",
1397
+ "lstrip": false,
1398
+ "normalized": false,
1399
+ "rstrip": false,
1400
+ "single_word": false,
1401
+ "special": true
1402
+ },
1403
+ "128175": {
1404
+ "content": "<|reserved_special_token_167|>",
1405
+ "lstrip": false,
1406
+ "normalized": false,
1407
+ "rstrip": false,
1408
+ "single_word": false,
1409
+ "special": true
1410
+ },
1411
+ "128176": {
1412
+ "content": "<|reserved_special_token_168|>",
1413
+ "lstrip": false,
1414
+ "normalized": false,
1415
+ "rstrip": false,
1416
+ "single_word": false,
1417
+ "special": true
1418
+ },
1419
+ "128177": {
1420
+ "content": "<|reserved_special_token_169|>",
1421
+ "lstrip": false,
1422
+ "normalized": false,
1423
+ "rstrip": false,
1424
+ "single_word": false,
1425
+ "special": true
1426
+ },
1427
+ "128178": {
1428
+ "content": "<|reserved_special_token_170|>",
1429
+ "lstrip": false,
1430
+ "normalized": false,
1431
+ "rstrip": false,
1432
+ "single_word": false,
1433
+ "special": true
1434
+ },
1435
+ "128179": {
1436
+ "content": "<|reserved_special_token_171|>",
1437
+ "lstrip": false,
1438
+ "normalized": false,
1439
+ "rstrip": false,
1440
+ "single_word": false,
1441
+ "special": true
1442
+ },
1443
+ "128180": {
1444
+ "content": "<|reserved_special_token_172|>",
1445
+ "lstrip": false,
1446
+ "normalized": false,
1447
+ "rstrip": false,
1448
+ "single_word": false,
1449
+ "special": true
1450
+ },
1451
+ "128181": {
1452
+ "content": "<|reserved_special_token_173|>",
1453
+ "lstrip": false,
1454
+ "normalized": false,
1455
+ "rstrip": false,
1456
+ "single_word": false,
1457
+ "special": true
1458
+ },
1459
+ "128182": {
1460
+ "content": "<|reserved_special_token_174|>",
1461
+ "lstrip": false,
1462
+ "normalized": false,
1463
+ "rstrip": false,
1464
+ "single_word": false,
1465
+ "special": true
1466
+ },
1467
+ "128183": {
1468
+ "content": "<|reserved_special_token_175|>",
1469
+ "lstrip": false,
1470
+ "normalized": false,
1471
+ "rstrip": false,
1472
+ "single_word": false,
1473
+ "special": true
1474
+ },
1475
+ "128184": {
1476
+ "content": "<|reserved_special_token_176|>",
1477
+ "lstrip": false,
1478
+ "normalized": false,
1479
+ "rstrip": false,
1480
+ "single_word": false,
1481
+ "special": true
1482
+ },
1483
+ "128185": {
1484
+ "content": "<|reserved_special_token_177|>",
1485
+ "lstrip": false,
1486
+ "normalized": false,
1487
+ "rstrip": false,
1488
+ "single_word": false,
1489
+ "special": true
1490
+ },
1491
+ "128186": {
1492
+ "content": "<|reserved_special_token_178|>",
1493
+ "lstrip": false,
1494
+ "normalized": false,
1495
+ "rstrip": false,
1496
+ "single_word": false,
1497
+ "special": true
1498
+ },
1499
+ "128187": {
1500
+ "content": "<|reserved_special_token_179|>",
1501
+ "lstrip": false,
1502
+ "normalized": false,
1503
+ "rstrip": false,
1504
+ "single_word": false,
1505
+ "special": true
1506
+ },
1507
+ "128188": {
1508
+ "content": "<|reserved_special_token_180|>",
1509
+ "lstrip": false,
1510
+ "normalized": false,
1511
+ "rstrip": false,
1512
+ "single_word": false,
1513
+ "special": true
1514
+ },
1515
+ "128189": {
1516
+ "content": "<|reserved_special_token_181|>",
1517
+ "lstrip": false,
1518
+ "normalized": false,
1519
+ "rstrip": false,
1520
+ "single_word": false,
1521
+ "special": true
1522
+ },
1523
+ "128190": {
1524
+ "content": "<|reserved_special_token_182|>",
1525
+ "lstrip": false,
1526
+ "normalized": false,
1527
+ "rstrip": false,
1528
+ "single_word": false,
1529
+ "special": true
1530
+ },
1531
+ "128191": {
1532
+ "content": "<|reserved_special_token_183|>",
1533
+ "lstrip": false,
1534
+ "normalized": false,
1535
+ "rstrip": false,
1536
+ "single_word": false,
1537
+ "special": true
1538
+ },
1539
+ "128192": {
1540
+ "content": "<|reserved_special_token_184|>",
1541
+ "lstrip": false,
1542
+ "normalized": false,
1543
+ "rstrip": false,
1544
+ "single_word": false,
1545
+ "special": true
1546
+ },
1547
+ "128193": {
1548
+ "content": "<|reserved_special_token_185|>",
1549
+ "lstrip": false,
1550
+ "normalized": false,
1551
+ "rstrip": false,
1552
+ "single_word": false,
1553
+ "special": true
1554
+ },
1555
+ "128194": {
1556
+ "content": "<|reserved_special_token_186|>",
1557
+ "lstrip": false,
1558
+ "normalized": false,
1559
+ "rstrip": false,
1560
+ "single_word": false,
1561
+ "special": true
1562
+ },
1563
+ "128195": {
1564
+ "content": "<|reserved_special_token_187|>",
1565
+ "lstrip": false,
1566
+ "normalized": false,
1567
+ "rstrip": false,
1568
+ "single_word": false,
1569
+ "special": true
1570
+ },
1571
+ "128196": {
1572
+ "content": "<|reserved_special_token_188|>",
1573
+ "lstrip": false,
1574
+ "normalized": false,
1575
+ "rstrip": false,
1576
+ "single_word": false,
1577
+ "special": true
1578
+ },
1579
+ "128197": {
1580
+ "content": "<|reserved_special_token_189|>",
1581
+ "lstrip": false,
1582
+ "normalized": false,
1583
+ "rstrip": false,
1584
+ "single_word": false,
1585
+ "special": true
1586
+ },
1587
+ "128198": {
1588
+ "content": "<|reserved_special_token_190|>",
1589
+ "lstrip": false,
1590
+ "normalized": false,
1591
+ "rstrip": false,
1592
+ "single_word": false,
1593
+ "special": true
1594
+ },
1595
+ "128199": {
1596
+ "content": "<|reserved_special_token_191|>",
1597
+ "lstrip": false,
1598
+ "normalized": false,
1599
+ "rstrip": false,
1600
+ "single_word": false,
1601
+ "special": true
1602
+ },
1603
+ "128200": {
1604
+ "content": "<|reserved_special_token_192|>",
1605
+ "lstrip": false,
1606
+ "normalized": false,
1607
+ "rstrip": false,
1608
+ "single_word": false,
1609
+ "special": true
1610
+ },
1611
+ "128201": {
1612
+ "content": "<|reserved_special_token_193|>",
1613
+ "lstrip": false,
1614
+ "normalized": false,
1615
+ "rstrip": false,
1616
+ "single_word": false,
1617
+ "special": true
1618
+ },
1619
+ "128202": {
1620
+ "content": "<|reserved_special_token_194|>",
1621
+ "lstrip": false,
1622
+ "normalized": false,
1623
+ "rstrip": false,
1624
+ "single_word": false,
1625
+ "special": true
1626
+ },
1627
+ "128203": {
1628
+ "content": "<|reserved_special_token_195|>",
1629
+ "lstrip": false,
1630
+ "normalized": false,
1631
+ "rstrip": false,
1632
+ "single_word": false,
1633
+ "special": true
1634
+ },
1635
+ "128204": {
1636
+ "content": "<|reserved_special_token_196|>",
1637
+ "lstrip": false,
1638
+ "normalized": false,
1639
+ "rstrip": false,
1640
+ "single_word": false,
1641
+ "special": true
1642
+ },
1643
+ "128205": {
1644
+ "content": "<|reserved_special_token_197|>",
1645
+ "lstrip": false,
1646
+ "normalized": false,
1647
+ "rstrip": false,
1648
+ "single_word": false,
1649
+ "special": true
1650
+ },
1651
+ "128206": {
1652
+ "content": "<|reserved_special_token_198|>",
1653
+ "lstrip": false,
1654
+ "normalized": false,
1655
+ "rstrip": false,
1656
+ "single_word": false,
1657
+ "special": true
1658
+ },
1659
+ "128207": {
1660
+ "content": "<|reserved_special_token_199|>",
1661
+ "lstrip": false,
1662
+ "normalized": false,
1663
+ "rstrip": false,
1664
+ "single_word": false,
1665
+ "special": true
1666
+ },
1667
+ "128208": {
1668
+ "content": "<|reserved_special_token_200|>",
1669
+ "lstrip": false,
1670
+ "normalized": false,
1671
+ "rstrip": false,
1672
+ "single_word": false,
1673
+ "special": true
1674
+ },
1675
+ "128209": {
1676
+ "content": "<|reserved_special_token_201|>",
1677
+ "lstrip": false,
1678
+ "normalized": false,
1679
+ "rstrip": false,
1680
+ "single_word": false,
1681
+ "special": true
1682
+ },
1683
+ "128210": {
1684
+ "content": "<|reserved_special_token_202|>",
1685
+ "lstrip": false,
1686
+ "normalized": false,
1687
+ "rstrip": false,
1688
+ "single_word": false,
1689
+ "special": true
1690
+ },
1691
+ "128211": {
1692
+ "content": "<|reserved_special_token_203|>",
1693
+ "lstrip": false,
1694
+ "normalized": false,
1695
+ "rstrip": false,
1696
+ "single_word": false,
1697
+ "special": true
1698
+ },
1699
+ "128212": {
1700
+ "content": "<|reserved_special_token_204|>",
1701
+ "lstrip": false,
1702
+ "normalized": false,
1703
+ "rstrip": false,
1704
+ "single_word": false,
1705
+ "special": true
1706
+ },
1707
+ "128213": {
1708
+ "content": "<|reserved_special_token_205|>",
1709
+ "lstrip": false,
1710
+ "normalized": false,
1711
+ "rstrip": false,
1712
+ "single_word": false,
1713
+ "special": true
1714
+ },
1715
+ "128214": {
1716
+ "content": "<|reserved_special_token_206|>",
1717
+ "lstrip": false,
1718
+ "normalized": false,
1719
+ "rstrip": false,
1720
+ "single_word": false,
1721
+ "special": true
1722
+ },
1723
+ "128215": {
1724
+ "content": "<|reserved_special_token_207|>",
1725
+ "lstrip": false,
1726
+ "normalized": false,
1727
+ "rstrip": false,
1728
+ "single_word": false,
1729
+ "special": true
1730
+ },
1731
+ "128216": {
1732
+ "content": "<|reserved_special_token_208|>",
1733
+ "lstrip": false,
1734
+ "normalized": false,
1735
+ "rstrip": false,
1736
+ "single_word": false,
1737
+ "special": true
1738
+ },
1739
+ "128217": {
1740
+ "content": "<|reserved_special_token_209|>",
1741
+ "lstrip": false,
1742
+ "normalized": false,
1743
+ "rstrip": false,
1744
+ "single_word": false,
1745
+ "special": true
1746
+ },
1747
+ "128218": {
1748
+ "content": "<|reserved_special_token_210|>",
1749
+ "lstrip": false,
1750
+ "normalized": false,
1751
+ "rstrip": false,
1752
+ "single_word": false,
1753
+ "special": true
1754
+ },
1755
+ "128219": {
1756
+ "content": "<|reserved_special_token_211|>",
1757
+ "lstrip": false,
1758
+ "normalized": false,
1759
+ "rstrip": false,
1760
+ "single_word": false,
1761
+ "special": true
1762
+ },
1763
+ "128220": {
1764
+ "content": "<|reserved_special_token_212|>",
1765
+ "lstrip": false,
1766
+ "normalized": false,
1767
+ "rstrip": false,
1768
+ "single_word": false,
1769
+ "special": true
1770
+ },
1771
+ "128221": {
1772
+ "content": "<|reserved_special_token_213|>",
1773
+ "lstrip": false,
1774
+ "normalized": false,
1775
+ "rstrip": false,
1776
+ "single_word": false,
1777
+ "special": true
1778
+ },
1779
+ "128222": {
1780
+ "content": "<|reserved_special_token_214|>",
1781
+ "lstrip": false,
1782
+ "normalized": false,
1783
+ "rstrip": false,
1784
+ "single_word": false,
1785
+ "special": true
1786
+ },
1787
+ "128223": {
1788
+ "content": "<|reserved_special_token_215|>",
1789
+ "lstrip": false,
1790
+ "normalized": false,
1791
+ "rstrip": false,
1792
+ "single_word": false,
1793
+ "special": true
1794
+ },
1795
+ "128224": {
1796
+ "content": "<|reserved_special_token_216|>",
1797
+ "lstrip": false,
1798
+ "normalized": false,
1799
+ "rstrip": false,
1800
+ "single_word": false,
1801
+ "special": true
1802
+ },
1803
+ "128225": {
1804
+ "content": "<|reserved_special_token_217|>",
1805
+ "lstrip": false,
1806
+ "normalized": false,
1807
+ "rstrip": false,
1808
+ "single_word": false,
1809
+ "special": true
1810
+ },
1811
+ "128226": {
1812
+ "content": "<|reserved_special_token_218|>",
1813
+ "lstrip": false,
1814
+ "normalized": false,
1815
+ "rstrip": false,
1816
+ "single_word": false,
1817
+ "special": true
1818
+ },
1819
+ "128227": {
1820
+ "content": "<|reserved_special_token_219|>",
1821
+ "lstrip": false,
1822
+ "normalized": false,
1823
+ "rstrip": false,
1824
+ "single_word": false,
1825
+ "special": true
1826
+ },
1827
+ "128228": {
1828
+ "content": "<|reserved_special_token_220|>",
1829
+ "lstrip": false,
1830
+ "normalized": false,
1831
+ "rstrip": false,
1832
+ "single_word": false,
1833
+ "special": true
1834
+ },
1835
+ "128229": {
1836
+ "content": "<|reserved_special_token_221|>",
1837
+ "lstrip": false,
1838
+ "normalized": false,
1839
+ "rstrip": false,
1840
+ "single_word": false,
1841
+ "special": true
1842
+ },
1843
+ "128230": {
1844
+ "content": "<|reserved_special_token_222|>",
1845
+ "lstrip": false,
1846
+ "normalized": false,
1847
+ "rstrip": false,
1848
+ "single_word": false,
1849
+ "special": true
1850
+ },
1851
+ "128231": {
1852
+ "content": "<|reserved_special_token_223|>",
1853
+ "lstrip": false,
1854
+ "normalized": false,
1855
+ "rstrip": false,
1856
+ "single_word": false,
1857
+ "special": true
1858
+ },
1859
+ "128232": {
1860
+ "content": "<|reserved_special_token_224|>",
1861
+ "lstrip": false,
1862
+ "normalized": false,
1863
+ "rstrip": false,
1864
+ "single_word": false,
1865
+ "special": true
1866
+ },
1867
+ "128233": {
1868
+ "content": "<|reserved_special_token_225|>",
1869
+ "lstrip": false,
1870
+ "normalized": false,
1871
+ "rstrip": false,
1872
+ "single_word": false,
1873
+ "special": true
1874
+ },
1875
+ "128234": {
1876
+ "content": "<|reserved_special_token_226|>",
1877
+ "lstrip": false,
1878
+ "normalized": false,
1879
+ "rstrip": false,
1880
+ "single_word": false,
1881
+ "special": true
1882
+ },
1883
+ "128235": {
1884
+ "content": "<|reserved_special_token_227|>",
1885
+ "lstrip": false,
1886
+ "normalized": false,
1887
+ "rstrip": false,
1888
+ "single_word": false,
1889
+ "special": true
1890
+ },
1891
+ "128236": {
1892
+ "content": "<|reserved_special_token_228|>",
1893
+ "lstrip": false,
1894
+ "normalized": false,
1895
+ "rstrip": false,
1896
+ "single_word": false,
1897
+ "special": true
1898
+ },
1899
+ "128237": {
1900
+ "content": "<|reserved_special_token_229|>",
1901
+ "lstrip": false,
1902
+ "normalized": false,
1903
+ "rstrip": false,
1904
+ "single_word": false,
1905
+ "special": true
1906
+ },
1907
+ "128238": {
1908
+ "content": "<|reserved_special_token_230|>",
1909
+ "lstrip": false,
1910
+ "normalized": false,
1911
+ "rstrip": false,
1912
+ "single_word": false,
1913
+ "special": true
1914
+ },
1915
+ "128239": {
1916
+ "content": "<|reserved_special_token_231|>",
1917
+ "lstrip": false,
1918
+ "normalized": false,
1919
+ "rstrip": false,
1920
+ "single_word": false,
1921
+ "special": true
1922
+ },
1923
+ "128240": {
1924
+ "content": "<|reserved_special_token_232|>",
1925
+ "lstrip": false,
1926
+ "normalized": false,
1927
+ "rstrip": false,
1928
+ "single_word": false,
1929
+ "special": true
1930
+ },
1931
+ "128241": {
1932
+ "content": "<|reserved_special_token_233|>",
1933
+ "lstrip": false,
1934
+ "normalized": false,
1935
+ "rstrip": false,
1936
+ "single_word": false,
1937
+ "special": true
1938
+ },
1939
+ "128242": {
1940
+ "content": "<|reserved_special_token_234|>",
1941
+ "lstrip": false,
1942
+ "normalized": false,
1943
+ "rstrip": false,
1944
+ "single_word": false,
1945
+ "special": true
1946
+ },
1947
+ "128243": {
1948
+ "content": "<|reserved_special_token_235|>",
1949
+ "lstrip": false,
1950
+ "normalized": false,
1951
+ "rstrip": false,
1952
+ "single_word": false,
1953
+ "special": true
1954
+ },
1955
+ "128244": {
1956
+ "content": "<|reserved_special_token_236|>",
1957
+ "lstrip": false,
1958
+ "normalized": false,
1959
+ "rstrip": false,
1960
+ "single_word": false,
1961
+ "special": true
1962
+ },
1963
+ "128245": {
1964
+ "content": "<|reserved_special_token_237|>",
1965
+ "lstrip": false,
1966
+ "normalized": false,
1967
+ "rstrip": false,
1968
+ "single_word": false,
1969
+ "special": true
1970
+ },
1971
+ "128246": {
1972
+ "content": "<|reserved_special_token_238|>",
1973
+ "lstrip": false,
1974
+ "normalized": false,
1975
+ "rstrip": false,
1976
+ "single_word": false,
1977
+ "special": true
1978
+ },
1979
+ "128247": {
1980
+ "content": "<|reserved_special_token_239|>",
1981
+ "lstrip": false,
1982
+ "normalized": false,
1983
+ "rstrip": false,
1984
+ "single_word": false,
1985
+ "special": true
1986
+ },
1987
+ "128248": {
1988
+ "content": "<|reserved_special_token_240|>",
1989
+ "lstrip": false,
1990
+ "normalized": false,
1991
+ "rstrip": false,
1992
+ "single_word": false,
1993
+ "special": true
1994
+ },
1995
+ "128249": {
1996
+ "content": "<|reserved_special_token_241|>",
1997
+ "lstrip": false,
1998
+ "normalized": false,
1999
+ "rstrip": false,
2000
+ "single_word": false,
2001
+ "special": true
2002
+ },
2003
+ "128250": {
2004
+ "content": "<|reserved_special_token_242|>",
2005
+ "lstrip": false,
2006
+ "normalized": false,
2007
+ "rstrip": false,
2008
+ "single_word": false,
2009
+ "special": true
2010
+ },
2011
+ "128251": {
2012
+ "content": "<|reserved_special_token_243|>",
2013
+ "lstrip": false,
2014
+ "normalized": false,
2015
+ "rstrip": false,
2016
+ "single_word": false,
2017
+ "special": true
2018
+ },
2019
+ "128252": {
2020
+ "content": "<|reserved_special_token_244|>",
2021
+ "lstrip": false,
2022
+ "normalized": false,
2023
+ "rstrip": false,
2024
+ "single_word": false,
2025
+ "special": true
2026
+ },
2027
+ "128253": {
2028
+ "content": "<|reserved_special_token_245|>",
2029
+ "lstrip": false,
2030
+ "normalized": false,
2031
+ "rstrip": false,
2032
+ "single_word": false,
2033
+ "special": true
2034
+ },
2035
+ "128254": {
2036
+ "content": "<|reserved_special_token_246|>",
2037
+ "lstrip": false,
2038
+ "normalized": false,
2039
+ "rstrip": false,
2040
+ "single_word": false,
2041
+ "special": true
2042
+ },
2043
+ "128255": {
2044
+ "content": "<|reserved_special_token_247|>",
2045
+ "lstrip": false,
2046
+ "normalized": false,
2047
+ "rstrip": false,
2048
+ "single_word": false,
2049
+ "special": true
2050
+ }
2051
+ },
2052
+ "bos_token": "<|begin_of_text|>",
2053
+ "clean_up_tokenization_spaces": true,
2054
+ "eos_token": "<|eot_id|>",
2055
+ "extra_special_tokens": {},
2056
+ "model_input_names": [
2057
+ "input_ids",
2058
+ "attention_mask"
2059
+ ],
2060
+ "model_max_length": 131072,
2061
+ "tokenizer_class": "PreTrainedTokenizer"
2062
+ }