vonkaiser commited on
Commit
1cc5dbd
·
verified ·
1 Parent(s): 33e6469

Replace duplicated F32 weights with the local FP8_DYNAMIC checkpoint

Browse files
README.md CHANGED
@@ -1,48 +1,33 @@
1
  ---
2
  license: mit
 
3
  language:
4
  - en
5
  tags:
6
  - agent
7
  - biology
8
  - code
9
- base_model:
10
- - Qwen/Qwen3-32B
11
  ---
12
 
13
- # Biomni-R0-32B-Preview
14
- This repo contains the weights of **Biomni-R0-32B-Preview**, a research preview of the series of biomedical AI agents trained by the [Biomni](https://biomni.stanford.edu/) team.
15
 
16
- Biomni-R0-Preview is a 32B model trained with end-to-end reinforcement learning using the Biomni-E1 environment scaffolding. It has achieved state-of-the-art performance across ten evaluated biomedical benchmarks spanning diverse tasks including crispr delivery, rare disease diagnosis, gwas variant prioritization, etc.
17
 
18
- Read more about how the model is trained and evaluted in our [technical report](https://biomni.stanford.edu/blog/biomni-r0-technical-report).
 
 
 
19
 
20
- <p align="center">
21
- <img src="https://cdn-uploads.huggingface.co/production/uploads/651d0bf7e4025a389cd24c7a/WMcdZj35W1Bbr-m9Cffw1.png" width="800"/>
22
- </p>
23
 
24
-
25
- <p align="center">
26
- <img src="https://cdn-uploads.huggingface.co/production/uploads/651d0bf7e4025a389cd24c7a/JeZIg7DJIxc8YLfyOVV0t.png" width="800"/>
27
- </p>
28
-
29
- # Usage: Serve with SGLang
30
  ```bash
31
- python -m sglang.launch_server --model-path biomni/Biomni-R0-32B-Preview --port 30000 --host 0.0.0.0 --mem-fraction-static 0.8 --tp 2 --trust-remote-code --json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":1.0,"original_max_position_embeddings":32768}, "max_position_embeddings": 131072}'
 
 
 
32
  ```
33
- This would require two GPUs with 80G VRAM. Alternatively, you may serve with 4 GPUs with 40G VRAM via `--tp 4`.
34
 
35
- Note, if your task would take significantly longer than the original 32768 context length, you may set `rope_scaling` factor to a number `>1.0` and `<=4.0` for smoother context window extension. However, `rope_scaling` might degrade performance on tasks with shorter trajectories. Please tune the rope scaling factor according to your usage.
36
 
37
- To run inference with the Biomni-E1 environment, please follow the instructions in our [official repo](https://github.com/snap-stanford/biomni).
38
-
39
- # Citation
40
- ```
41
- @misc{biomnir0,
42
- title = {Biomni-R0: Using RL to Hill-Climb Biomedical Reasoning Agents to Expert-Level},
43
- author = {Ryan Li and Kexin Huang and Shiyi Cao and Yuanhao Qu and Jure Leskovec},
44
- year = {2025},
45
- month = {September},
46
- note = {Technical Report}
47
- }
48
- ```
 
1
  ---
2
  license: mit
3
+ base_model: biomni/Biomni-R0-32B-Preview
4
  language:
5
  - en
6
  tags:
7
  - agent
8
  - biology
9
  - code
10
+ - fp8
 
11
  ---
12
 
13
+ # Biomni-R0-32B-Preview FP8 Dynamic
 
14
 
15
+ Local FP8_DYNAMIC compression of [biomni/Biomni-R0-32B-Preview](https://huggingface.co/biomni/Biomni-R0-32B-Preview) revision `71432eb3d5e583bee757e0f9437a17e711e8e3d1`. This is not an official Biomni release. The original F32 weights stay on that repo.
16
 
17
+ - Scheme: compressed-tensors FP8, per-channel weights, dynamic per-token activations
18
+ - `lm_head` left dense
19
+ - No calibration dataset
20
+ - Weights about 35GB
21
 
22
+ vLLM reads the scheme from `config.json`. Do not pass `--quantization`.
 
 
23
 
 
 
 
 
 
 
24
  ```bash
25
+ vllm serve vonkaiser/Biomni-R0-32B-Preview-FP8-Dynamic \
26
+ --gpu-memory-utilization 0.90 \
27
+ --kv-cache-dtype fp8 \
28
+ --max-model-len 32768
29
  ```
 
30
 
31
+ The chat template asks for a JSON object inside `<tool_call>` tags. Use a tool parser that reads that format (`qwen` or `hermes`). `qwen3_coder` expects a different XML shape and will leave the call in `content`.
32
 
33
+ Base architecture is Qwen/Qwen3-32B. License MIT, same as the source model.
 
 
 
 
 
 
 
 
 
 
 
config.json CHANGED
@@ -17,6 +17,56 @@
17
  "num_attention_heads": 64,
18
  "num_hidden_layers": 64,
19
  "num_key_value_heads": 8,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  "rms_norm_eps": 1e-06,
21
  "rope_scaling": null,
22
  "rope_theta": 1000000,
@@ -27,4 +77,4 @@
27
  "use_cache": true,
28
  "use_sliding_window": false,
29
  "vocab_size": 151936
30
- }
 
17
  "num_attention_heads": 64,
18
  "num_hidden_layers": 64,
19
  "num_key_value_heads": 8,
20
+ "quantization_config": {
21
+ "config_groups": {
22
+ "group_0": {
23
+ "format": "float-quantized",
24
+ "input_activations": {
25
+ "actorder": null,
26
+ "block_structure": null,
27
+ "dynamic": true,
28
+ "group_size": null,
29
+ "num_bits": 8,
30
+ "observer": null,
31
+ "observer_kwargs": {},
32
+ "scale_dtype": null,
33
+ "strategy": "token",
34
+ "symmetric": true,
35
+ "type": "float",
36
+ "zp_dtype": null
37
+ },
38
+ "output_activations": null,
39
+ "targets": [
40
+ "Linear"
41
+ ],
42
+ "weights": {
43
+ "actorder": null,
44
+ "block_structure": null,
45
+ "dynamic": false,
46
+ "group_size": null,
47
+ "num_bits": 8,
48
+ "observer": "memoryless_minmax",
49
+ "observer_kwargs": {},
50
+ "scale_dtype": null,
51
+ "strategy": "channel",
52
+ "symmetric": true,
53
+ "type": "float",
54
+ "zp_dtype": null
55
+ }
56
+ }
57
+ },
58
+ "format": "float-quantized",
59
+ "global_compression_ratio": null,
60
+ "ignore": [
61
+ "lm_head"
62
+ ],
63
+ "kv_cache_scheme": null,
64
+ "quant_method": "compressed-tensors",
65
+ "quantization_status": "compressed",
66
+ "sparsity_config": {},
67
+ "transform_config": {},
68
+ "version": "0.19.0"
69
+ },
70
  "rms_norm_eps": 1e-06,
71
  "rope_scaling": null,
72
  "rope_theta": 1000000,
 
77
  "use_cache": true,
78
  "use_sliding_window": false,
79
  "vocab_size": 151936
80
+ }
generation_config.json CHANGED
@@ -2,5 +2,5 @@
2
  "_from_model_config": true,
3
  "bos_token_id": 151643,
4
  "eos_token_id": 151645,
5
- "transformers_version": "4.51.1"
6
  }
 
2
  "_from_model_config": true,
3
  "bos_token_id": 151643,
4
  "eos_token_id": 151645,
5
+ "transformers_version": "5.17.0"
6
  }
model-00001-of-00027.safetensors → model-00001-of-00002.safetensors RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:eb0fdb2eb92ca45f8f56ee26b78e9497a9cc44c64f85bfbe2de9dde4fc8d35b9
3
- size 4537714712
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0ca2c41b339e333543b14b74447acb9e2a662e3ab5c0ef8fbd39ee9b38f7586
3
+ size 19926596848
model-00002-of-00027.safetensors → model-00002-of-00002.safetensors RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e423bb607ece73151c45ba4c53fb8c8ab5ff67a268f590652936e8217a66a8cb
3
- size 4802607584
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fde030a562aa0dfb50cc943691e0236560fa3829af24a859c0925152363a20f4
3
+ size 17523517568
model-00003-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cfaefe833b2e31d58abcb5102be8a3341a10922cde1b9293fcd9eb18948e9d77
3
- size 4949365440
 
 
 
 
model-00004-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3cdf3b896771f843bc235639ccb81b8abe288686c66acb3e38105fa8e4d96ba3
3
- size 4802607584
 
 
 
 
model-00005-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d27b839e8279f79ccef160d5e0bbad797503c84fbb572ea7b1f6d388047db05e
3
- size 4949365464
 
 
 
 
model-00006-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4bf1258b86ceafd8e4917368eb57ad3fa3e38913642b04c6fa7161768a38db5b
3
- size 4802607616
 
 
 
 
model-00007-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:866f427d5983a9913d8c03877db8a296353dc913fd3687feba8a069d02298008
3
- size 4949365464
 
 
 
 
model-00008-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a154e2962b152b19b0fc3e59bd497449b7498abd8f7c1a4302b41628784b4dd8
3
- size 4802607616
 
 
 
 
model-00009-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:bf040aa0e54e324e248ab3d6f201999775013bd9c05f0346c6c6d9c80bdcc571
3
- size 4949365464
 
 
 
 
model-00010-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:85047b88fa702d8b8c4c71f8d31ad9d8a401593f1613faeeb72b3562d779d68b
3
- size 4802607616
 
 
 
 
model-00011-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:21a385961750fe76836b3395c9b2dd2d3d65e440f3fe10dc182490acb6f5f618
3
- size 4949365464
 
 
 
 
model-00012-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:fe57a68504589dcec269b5d430809ada9a67e9fb1632061196df3a0e469c149a
3
- size 4802607616
 
 
 
 
model-00013-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:eaa7aa485d12ffa44c24066cef385e202f51441b05deb3a31428cfd2096a8475
3
- size 4949365464
 
 
 
 
model-00014-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:09e0fc2c00d3524ebf15f3a94b38ae4431a123d077b5f3c18275940e2522025a
3
- size 4802607616
 
 
 
 
model-00015-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:273f54a8ccc670bc858d1282381ee115424acbdb071ed3b73cf6076b883852e3
3
- size 4949365464
 
 
 
 
model-00016-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2a6ac934f24dfe776ccc8f72b829e955128b49083f528e103706a4a8e387c98b
3
- size 4802607616
 
 
 
 
model-00017-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:12bfb813502c2cfaf5f963261bb3739a935f24926263dc85cefa6be3fa22f44b
3
- size 4949365464
 
 
 
 
model-00018-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f08d7b69d559d0eaa61259218d5f386c2d311d36cca5941e159abef4ffc272dc
3
- size 4802607616
 
 
 
 
model-00019-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:bc8d13880a0e19369a23f02c07d05963dc0e4c2772cf8129911f48e68065a979
3
- size 4949365464
 
 
 
 
model-00020-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a899b98563556b3eff6203c1c8e7283edb01ab83614aa6b6efe173d5c0295c5a
3
- size 4802607616
 
 
 
 
model-00021-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:3db2b4af17b29a8212e64eba84ed2bc44fb6d3eca93bed149b32e6b7a1dca12a
3
- size 4949365464
 
 
 
 
model-00022-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:24c83a27baec7bd1612a93e801711fb7f2ca2e40def9c4537d0c25bba5d12e38
3
- size 4802607616
 
 
 
 
model-00023-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a289d21ec2a1285be7f856de74adaa05ece75b818df47bb0cea451e79dfcfe26
3
- size 4949365464
 
 
 
 
model-00024-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ae4d227bed27f03b1437cacdc740927ca4826a2902e45ae8ac1e5243bde53fb1
3
- size 4802607616
 
 
 
 
model-00025-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7d613bea16f760d4e6ab722ef87918ce56fef9556040b9fdd429bfa3533794cd
3
- size 4949365464
 
 
 
 
model-00026-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0ba38ab22634bbd8b5fd594f1f2f085c536f18ef66d20d8791fd96ad0cc2dc47
3
- size 4802607616
 
 
 
 
model-00027-of-00027.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f688df35a5987ecc3588ed42e452869e689fcfec2cee43d1a27913cf6dddd11e
3
- size 4684575512
 
 
 
 
model.safetensors.index.json CHANGED
The diff for this file is too large to render. See raw diff
 
recipe.yaml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ default_stage:
2
+ default_modifiers:
3
+ QuantizationModifier:
4
+ targets: [Linear]
5
+ ignore: [lm_head]
6
+ scheme: FP8_DYNAMIC
7
+ bypass_divisibility_checks: false
8
+ requires_calibration_data: false
tokenizer.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
3
- size 11422654
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
+ size 11422650
tokenizer_config.json CHANGED
@@ -1,237 +1,12 @@
1
  {
2
- "add_bos_token": false,
3
  "add_prefix_space": false,
4
- "added_tokens_decoder": {
5
- "151643": {
6
- "content": "<|endoftext|>",
7
- "lstrip": false,
8
- "normalized": false,
9
- "rstrip": false,
10
- "single_word": false,
11
- "special": true
12
- },
13
- "151644": {
14
- "content": "<|im_start|>",
15
- "lstrip": false,
16
- "normalized": false,
17
- "rstrip": false,
18
- "single_word": false,
19
- "special": true
20
- },
21
- "151645": {
22
- "content": "<|im_end|>",
23
- "lstrip": false,
24
- "normalized": false,
25
- "rstrip": false,
26
- "single_word": false,
27
- "special": true
28
- },
29
- "151646": {
30
- "content": "<|object_ref_start|>",
31
- "lstrip": false,
32
- "normalized": false,
33
- "rstrip": false,
34
- "single_word": false,
35
- "special": true
36
- },
37
- "151647": {
38
- "content": "<|object_ref_end|>",
39
- "lstrip": false,
40
- "normalized": false,
41
- "rstrip": false,
42
- "single_word": false,
43
- "special": true
44
- },
45
- "151648": {
46
- "content": "<|box_start|>",
47
- "lstrip": false,
48
- "normalized": false,
49
- "rstrip": false,
50
- "single_word": false,
51
- "special": true
52
- },
53
- "151649": {
54
- "content": "<|box_end|>",
55
- "lstrip": false,
56
- "normalized": false,
57
- "rstrip": false,
58
- "single_word": false,
59
- "special": true
60
- },
61
- "151650": {
62
- "content": "<|quad_start|>",
63
- "lstrip": false,
64
- "normalized": false,
65
- "rstrip": false,
66
- "single_word": false,
67
- "special": true
68
- },
69
- "151651": {
70
- "content": "<|quad_end|>",
71
- "lstrip": false,
72
- "normalized": false,
73
- "rstrip": false,
74
- "single_word": false,
75
- "special": true
76
- },
77
- "151652": {
78
- "content": "<|vision_start|>",
79
- "lstrip": false,
80
- "normalized": false,
81
- "rstrip": false,
82
- "single_word": false,
83
- "special": true
84
- },
85
- "151653": {
86
- "content": "<|vision_end|>",
87
- "lstrip": false,
88
- "normalized": false,
89
- "rstrip": false,
90
- "single_word": false,
91
- "special": true
92
- },
93
- "151654": {
94
- "content": "<|vision_pad|>",
95
- "lstrip": false,
96
- "normalized": false,
97
- "rstrip": false,
98
- "single_word": false,
99
- "special": true
100
- },
101
- "151655": {
102
- "content": "<|image_pad|>",
103
- "lstrip": false,
104
- "normalized": false,
105
- "rstrip": false,
106
- "single_word": false,
107
- "special": true
108
- },
109
- "151656": {
110
- "content": "<|video_pad|>",
111
- "lstrip": false,
112
- "normalized": false,
113
- "rstrip": false,
114
- "single_word": false,
115
- "special": true
116
- },
117
- "151657": {
118
- "content": "<tool_call>",
119
- "lstrip": false,
120
- "normalized": false,
121
- "rstrip": false,
122
- "single_word": false,
123
- "special": false
124
- },
125
- "151658": {
126
- "content": "</tool_call>",
127
- "lstrip": false,
128
- "normalized": false,
129
- "rstrip": false,
130
- "single_word": false,
131
- "special": false
132
- },
133
- "151659": {
134
- "content": "<|fim_prefix|>",
135
- "lstrip": false,
136
- "normalized": false,
137
- "rstrip": false,
138
- "single_word": false,
139
- "special": false
140
- },
141
- "151660": {
142
- "content": "<|fim_middle|>",
143
- "lstrip": false,
144
- "normalized": false,
145
- "rstrip": false,
146
- "single_word": false,
147
- "special": false
148
- },
149
- "151661": {
150
- "content": "<|fim_suffix|>",
151
- "lstrip": false,
152
- "normalized": false,
153
- "rstrip": false,
154
- "single_word": false,
155
- "special": false
156
- },
157
- "151662": {
158
- "content": "<|fim_pad|>",
159
- "lstrip": false,
160
- "normalized": false,
161
- "rstrip": false,
162
- "single_word": false,
163
- "special": false
164
- },
165
- "151663": {
166
- "content": "<|repo_name|>",
167
- "lstrip": false,
168
- "normalized": false,
169
- "rstrip": false,
170
- "single_word": false,
171
- "special": false
172
- },
173
- "151664": {
174
- "content": "<|file_sep|>",
175
- "lstrip": false,
176
- "normalized": false,
177
- "rstrip": false,
178
- "single_word": false,
179
- "special": false
180
- },
181
- "151665": {
182
- "content": "<tool_response>",
183
- "lstrip": false,
184
- "normalized": false,
185
- "rstrip": false,
186
- "single_word": false,
187
- "special": false
188
- },
189
- "151666": {
190
- "content": "</tool_response>",
191
- "lstrip": false,
192
- "normalized": false,
193
- "rstrip": false,
194
- "single_word": false,
195
- "special": false
196
- },
197
- "151667": {
198
- "content": "<think>",
199
- "lstrip": false,
200
- "normalized": false,
201
- "rstrip": false,
202
- "single_word": false,
203
- "special": false
204
- },
205
- "151668": {
206
- "content": "</think>",
207
- "lstrip": false,
208
- "normalized": false,
209
- "rstrip": false,
210
- "single_word": false,
211
- "special": false
212
- }
213
- },
214
- "additional_special_tokens": [
215
- "<|im_start|>",
216
- "<|im_end|>",
217
- "<|object_ref_start|>",
218
- "<|object_ref_end|>",
219
- "<|box_start|>",
220
- "<|box_end|>",
221
- "<|quad_start|>",
222
- "<|quad_end|>",
223
- "<|vision_start|>",
224
- "<|vision_end|>",
225
- "<|vision_pad|>",
226
- "<|image_pad|>",
227
- "<|video_pad|>"
228
- ],
229
  "bos_token": null,
230
- "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
231
  "clean_up_tokenization_spaces": false,
232
  "eos_token": "<|im_end|>",
233
  "errors": "replace",
234
- "extra_special_tokens": {},
 
235
  "model_max_length": 131072,
236
  "pad_token": "<|endoftext|>",
237
  "split_special_tokens": false,
 
1
  {
 
2
  "add_prefix_space": false,
3
+ "backend": "tokenizers",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  "bos_token": null,
 
5
  "clean_up_tokenization_spaces": false,
6
  "eos_token": "<|im_end|>",
7
  "errors": "replace",
8
+ "is_local": false,
9
+ "local_files_only": false,
10
  "model_max_length": 131072,
11
  "pad_token": "<|endoftext|>",
12
  "split_special_tokens": false,