Instructions to use MuVeraAI/command-a-plus-05-2026-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MuVeraAI/command-a-plus-05-2026-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MuVeraAI/command-a-plus-05-2026-bf16") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("MuVeraAI/command-a-plus-05-2026-bf16") model = AutoModelForImageTextToText.from_pretrained("MuVeraAI/command-a-plus-05-2026-bf16") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MuVeraAI/command-a-plus-05-2026-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MuVeraAI/command-a-plus-05-2026-bf16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuVeraAI/command-a-plus-05-2026-bf16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/MuVeraAI/command-a-plus-05-2026-bf16
- SGLang
How to use MuVeraAI/command-a-plus-05-2026-bf16 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MuVeraAI/command-a-plus-05-2026-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuVeraAI/command-a-plus-05-2026-bf16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MuVeraAI/command-a-plus-05-2026-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MuVeraAI/command-a-plus-05-2026-bf16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use MuVeraAI/command-a-plus-05-2026-bf16 with Docker Model Runner:
docker model run hf.co/MuVeraAI/command-a-plus-05-2026-bf16
Commit ·
d792999
0
Parent(s):
Duplicate from CohereLabs/command-a-plus-05-2026-bf16
Browse filesCo-authored-by: Alejandro Rodriguez <alexrs@users.noreply.huggingface.co>
- .gitattributes +36 -0
- README.md +289 -0
- chat_template.jinja +249 -0
- config.json +152 -0
- generation_config.json +7 -0
- model-00001-of-00009.safetensors +3 -0
- model-00002-of-00009.safetensors +3 -0
- model-00003-of-00009.safetensors +3 -0
- model-00004-of-00009.safetensors +3 -0
- model-00005-of-00009.safetensors +3 -0
- model-00006-of-00009.safetensors +3 -0
- model-00007-of-00009.safetensors +3 -0
- model-00008-of-00009.safetensors +3 -0
- model-00009-of-00009.safetensors +3 -0
- model.safetensors.index.json +0 -0
- preprocessor_config.json +38 -0
- special_tokens_map.json +34 -0
- tokenizer.json +3 -0
- tokenizer_config.json +338 -0
.gitattributes
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz 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,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
inference: false
|
| 3 |
+
library_name: transformers
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- ar
|
| 7 |
+
- bg
|
| 8 |
+
- bn
|
| 9 |
+
- ca
|
| 10 |
+
- cs
|
| 11 |
+
- da
|
| 12 |
+
- de
|
| 13 |
+
- el
|
| 14 |
+
- es
|
| 15 |
+
- et
|
| 16 |
+
- fa
|
| 17 |
+
- fi
|
| 18 |
+
- fil
|
| 19 |
+
- fr
|
| 20 |
+
- ga
|
| 21 |
+
- he
|
| 22 |
+
- hi
|
| 23 |
+
- hr
|
| 24 |
+
- hu
|
| 25 |
+
- id
|
| 26 |
+
- is
|
| 27 |
+
- it
|
| 28 |
+
- ja
|
| 29 |
+
- ko
|
| 30 |
+
- lt
|
| 31 |
+
- lv
|
| 32 |
+
- ms
|
| 33 |
+
- mt
|
| 34 |
+
- nl
|
| 35 |
+
- 'no'
|
| 36 |
+
- pa
|
| 37 |
+
- pl
|
| 38 |
+
- pt
|
| 39 |
+
- ro
|
| 40 |
+
- ru
|
| 41 |
+
- sk
|
| 42 |
+
- sl
|
| 43 |
+
- sr
|
| 44 |
+
- sv
|
| 45 |
+
- ta
|
| 46 |
+
- te
|
| 47 |
+
- th
|
| 48 |
+
- tr
|
| 49 |
+
- uk
|
| 50 |
+
- ur
|
| 51 |
+
- vi
|
| 52 |
+
- zh
|
| 53 |
+
license: apache-2.0
|
| 54 |
+
pipeline_tag: image-text-to-text
|
| 55 |
+
tags:
|
| 56 |
+
- conversational
|
| 57 |
+
- chat
|
| 58 |
+
---
|
| 59 |
+
|
| 60 |
+
# **Model Card for Command A+**
|
| 61 |
+
|
| 62 |
+
## **Model Summary**
|
| 63 |
+
|
| 64 |
+
Command A+ is an open source model with 25 billion active parameters and 218B total parameters model optimized for agentic, multilingual, and reasoning-heavy tasks with a focus on enterprise performance, while also providing support for vision inputs for processing image inputs.
|
| 65 |
+
|
| 66 |
+
Developed by: [Cohere](https://cohere.com/) and [Cohere Labs](https://cohere.com/research)
|
| 67 |
+
|
| 68 |
+
* Point of Contact: [**Cohere Labs**](https://cohere.com/research)
|
| 69 |
+
* License: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
| 70 |
+
* Model: command-a-plus-05-2026
|
| 71 |
+
* Model Size: 25B active parameters, 218B total parameters
|
| 72 |
+
* Context length: 128K input
|
| 73 |
+
|
| 74 |
+
For more details about this model, please check out our [blog post](http://cohere.com/blog/command-a-plus).
|
| 75 |
+
|
| 76 |
+
You can try out Command A+ before downloading the weights in our hosted [Hugging Face Space](https://huggingface.co/spaces/CohereLabs/command-a-plus-05-2026).
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
**Available quantizations**
|
| 80 |
+
|
| 81 |
+
The following quantizations are available with example minimum GPU requirements
|
| 82 |
+
|
| 83 |
+
| Quantization | Blackwell | Hopper |
|
| 84 |
+
| :---- | :---- | :---- |
|
| 85 |
+
| [BF16 (16-bit)](https://huggingface.co/CohereLabs/command-a-plus-05-2026-bf16) | 4 x B200 | 8 x H100 |
|
| 86 |
+
| [FP8 (8-bit)](https://huggingface.co/CohereLabs/command-a-plus-05-2026-fp8) | 2 x B200 | 4 x H100 |
|
| 87 |
+
| [W4A4 (4-bit)](https://huggingface.co/CohereLabs/command-a-plus-05-2026-w4a4) | 1 x B200 | 2 x H100 |
|
| 88 |
+
|
| 89 |
+
All three quantizations show negligible differences in benchmark quality and performance. **Our recommended quantization for most uses is [W4A4](https://huggingface.co/CohereLabs/command-a-plus-05-2026-w4a4) which boasts superior speed and latency characteristics alongside a smaller hardware footprint.**
|
| 90 |
+
|
| 91 |
+
For more details, please check out our [blog post](http://cohere.com/blog/command-a-plus).
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
**Usage**
|
| 95 |
+
|
| 96 |
+
**Transformers**
|
| 97 |
+
|
| 98 |
+
Please install transformers from the source repository that includes the necessary changes for this model.
|
| 99 |
+
|
| 100 |
+
```py
|
| 101 |
+
# pip install transformers
|
| 102 |
+
from transformers import AutoTokenizer, AutoModelForImageTextToText
|
| 103 |
+
|
| 104 |
+
model_id = "CohereLabs/command-a-plus-05-2026-bf16"
|
| 105 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 106 |
+
model = AutoModelForImageTextToText.from_pretrained(model_id)
|
| 107 |
+
|
| 108 |
+
# Format message with the command-a-plus-05-2026-bf16 chat template
|
| 109 |
+
messages = [{"role": "user", "content": "What has keys but can't open locks?"}]
|
| 110 |
+
input_ids = tokenizer.apply_chat_template(
|
| 111 |
+
messages,
|
| 112 |
+
tokenize=True,
|
| 113 |
+
add_generation_prompt=True,
|
| 114 |
+
return_tensors="pt",
|
| 115 |
+
)
|
| 116 |
+
|
| 117 |
+
gen_tokens = model.generate(
|
| 118 |
+
input_ids,
|
| 119 |
+
max_new_tokens=4096,
|
| 120 |
+
do_sample=True,
|
| 121 |
+
temperature=0.6,
|
| 122 |
+
top_p=0.95
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
gen_text = tokenizer.decode(gen_tokens[0])
|
| 126 |
+
print(gen_text)
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
As a result, you should get an output that looks like this, where the thinking is generated between the `<START_THINKING>` and `<END_THINKING>`:
|
| 130 |
+
|
| 131 |
+
```py
|
| 132 |
+
<|START_THINKING|>The user asks a riddle: "What has keys but can't open locks?" The answer is a piano (or keyboard). So respond with answer.<|END_THINKING|>
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
You can also use the model directly using transformers pipeline abstraction:
|
| 136 |
+
|
| 137 |
+
```py
|
| 138 |
+
from transformers import pipeline
|
| 139 |
+
import torch
|
| 140 |
+
|
| 141 |
+
model_id = "CohereLabs/command-a-plus-05-2026-bf16"
|
| 142 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 143 |
+
|
| 144 |
+
pipe = pipeline(
|
| 145 |
+
"text-generation",
|
| 146 |
+
model=model_id,
|
| 147 |
+
dtype="auto",
|
| 148 |
+
device_map="auto",
|
| 149 |
+
)
|
| 150 |
+
|
| 151 |
+
messages = [
|
| 152 |
+
{"role": "user", "content": "Explain the Transformer architecture"},
|
| 153 |
+
]
|
| 154 |
+
|
| 155 |
+
text = tokenizer.apply_chat_template(
|
| 156 |
+
messages,
|
| 157 |
+
tokenize=False,
|
| 158 |
+
add_generation_prompt=True,
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
+
outputs = pipe(
|
| 162 |
+
messages,
|
| 163 |
+
max_new_tokens=300,
|
| 164 |
+
)
|
| 165 |
+
print(outputs[0]["generated_text"][-1])
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
**vLLM**
|
| 171 |
+
|
| 172 |
+
You can also run the model in vLLM. `vllm>=0.21.0` is required for Command A+ and accurate response parsing also requires installing [Cohere’s `melody` library](https://pypi.org/project/cohere-melody/).
|
| 173 |
+
|
| 174 |
+
```
|
| 175 |
+
uv pip install vllm>=0.21.0
|
| 176 |
+
uv pip install transformers uv pip install cohere_melody>=0.9.0
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
Then the vllm server can be started with the following command:
|
| 180 |
+
|
| 181 |
+
```
|
| 182 |
+
# This is for B200, adjust tp for your device vllm serve CohereLabs/command-a-plus-05-2026-bf16 -tp 4 --tool-call-parser cohere_command4 --reasoning-parser cohere_command4 --enable-auto-tool-choice
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
## **Model Details**
|
| 186 |
+
|
| 187 |
+
**Input**: Text and images.
|
| 188 |
+
|
| 189 |
+
**Output**: Model generates text.
|
| 190 |
+
|
| 191 |
+
**Model Architecture**: Command A+ is a decoder-only Sparse Mixture-of-Experts Transformer Model. With 25B active parameters and 218B total parameters, it has 128 experts, out of which 8 are active per token, and a single shared expert is applied to all tokens. The attention layers interleave sliding-window attention layers with Rotational Positional Embeddings and global attention layers without positional embeddings in a 3:1 ratio, as first introduced in Command A. The sparse MoE layer is trained in a fully dropless manner and uses a token-choice router. We use additive-bias-based load balancing to encourage balanced token load across all experts, and swap out the softmax router activation function with a normalized sigmoid over the topk expert logits per token.
|
| 192 |
+
|
| 193 |
+
**Languages covered:** The model has been trained on 48 languages: English, Arabic, Bulgarian, Bengali, Catalan, Czech, Danish, German, Greek, Spanish, Estonian, Persian, Finnish, Filipino, French, Irish, Hebrew, Hindi, Croatian, Hungarian, Indonesian, Icelandic, Italian, Japanese, Korean, Lithuanian, Latvian, Malay, Maltese, Dutch, Norwegian, Punjabi, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Serbian, Swedish, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Vietnamese, Chinese.
|
| 194 |
+
|
| 195 |
+
**Context Length:** Command A+ supports a context length of 128K & 64K output length.
|
| 196 |
+
|
| 197 |
+
### **Tool Use Capabilities:**
|
| 198 |
+
|
| 199 |
+
Command A+ has been specifically trained with conversational tool use capabilities. This allows the model to interact with external tools like APIs, databases, or search engines.
|
| 200 |
+
|
| 201 |
+
Tool use with Command A+ is supported through [chat templates](https://huggingface.co/docs/transformers/main/en/chat_templating#advanced-tool-use--function-calling) in Transformers. We recommend providing tool descriptions using JSON schema.
|
| 202 |
+
|
| 203 |
+
<details>
|
| 204 |
+
<summary><b>Tool Use Example [CLICK TO EXPAND]</b></summary>
|
| 205 |
+
|
| 206 |
+
```py
|
| 207 |
+
from transformers import AutoTokenizer
|
| 208 |
+
|
| 209 |
+
model_id = "CohereLabs/command-a-plus-05-2026-bf16"
|
| 210 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 211 |
+
|
| 212 |
+
# Define tools
|
| 213 |
+
tools = [{
|
| 214 |
+
"type": "function",
|
| 215 |
+
"function": {
|
| 216 |
+
"name": "query_daily_sales_report",
|
| 217 |
+
"description": "Connects to a database to retrieve overall sales volumes and sales information for a given day.",
|
| 218 |
+
"parameters": {
|
| 219 |
+
"type": "object",
|
| 220 |
+
"properties": {
|
| 221 |
+
"day": {
|
| 222 |
+
"description": "Retrieves sales data for this day, formatted as YYYY-MM-DD.",
|
| 223 |
+
"type": "string",
|
| 224 |
+
}
|
| 225 |
+
},
|
| 226 |
+
"required": ["day"],
|
| 227 |
+
},
|
| 228 |
+
},
|
| 229 |
+
}]
|
| 230 |
+
|
| 231 |
+
# Define conversation input
|
| 232 |
+
conversation = [
|
| 233 |
+
{"role": "user", "content": "Can you provide a sales summary for 29th September 2023?"}
|
| 234 |
+
]
|
| 235 |
+
|
| 236 |
+
# Tokenize the Tool Use prompt directly
|
| 237 |
+
input_ids = tokenizer.apply_chat_template(
|
| 238 |
+
conversation=conversation,
|
| 239 |
+
tools=tools,
|
| 240 |
+
tokenize=True,
|
| 241 |
+
add_generation_prompt=True,
|
| 242 |
+
return_tensors="pt",
|
| 243 |
+
)
|
| 244 |
+
```
|
| 245 |
+
|
| 246 |
+
You can then generate from this input as normal.
|
| 247 |
+
|
| 248 |
+
If the model generates a plan and tool calls, you should add them to the chat history like so:
|
| 249 |
+
|
| 250 |
+
```py
|
| 251 |
+
tool_call = {"name": "query_daily_sales_report", "arguments": {"day": "2023-09-29"}}
|
| 252 |
+
thinking = "I will use the query_daily_sales_report tool to find the sales summary for 29th September 2023."
|
| 253 |
+
conversation.append({"role": "assistant", "tool_calls": [{"id": "0", "type": "function", "function": tool_call}], "thinking": thinking})
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
and then call the tool and append the result, as a dictionary, with the tool role, like so:
|
| 257 |
+
|
| 258 |
+
```py
|
| 259 |
+
api_response_query_daily_sales_report = {"date": "2023-09-29", "summary": "Total Sales Amount: 10000, Total Units Sold: 250"} # this needs to be a dictionary!!
|
| 260 |
+
|
| 261 |
+
# Append tool results
|
| 262 |
+
conversation.append({"role": "tool", "tool_call_id": "0", "content": api_response_query_daily_sales_report})
|
| 263 |
+
```
|
| 264 |
+
|
| 265 |
+
After that, you can generate() again to let the model use the tool result in the chat.
|
| 266 |
+
|
| 267 |
+
Note that this was a very brief introduction to tool calling \- for more information, see the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).
|
| 268 |
+
</details>
|
| 269 |
+
|
| 270 |
+
<details>
|
| 271 |
+
<summary><b>Tool Use With Citations [CLICK TO EXPAND]</b></summary>
|
| 272 |
+
|
| 273 |
+
Optionally, one can ask the model to include grounding spans (citations) in its response to indicate the source of the information, by using `enable_citations=True` in `tokenizer.apply_chat_template(*)`. The generation would look like this:
|
| 274 |
+
|
| 275 |
+
```
|
| 276 |
+
On 29th September 2023, the total sales amount was <co>10000</co: 0:[0]> and the total units sold were <co>250.</co: 0:[0]>
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
When citations are turned on, the model associates pieces of texts (called "spans") with those specific tool results that support them (called "sources"). Command A+ uses a pair of tags `<co>` and `</co>` to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. For example, `<co>span</co: 0:[1,2],1:[0]>` means that "span" is supported by result 1 and 2 from `tool_call_id=0` as well as result 0 from `tool_call_id=1`. Sources from the same tool call are grouped together and listed as `{tool_call_id}:[{list of result indices}]`, before they are joined together by ",".
|
| 280 |
+
</details>
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
## **Model Card Contact**
|
| 284 |
+
|
| 285 |
+
For errors or additional questions about details in this model card, contact \[[labs@cohere.com](mailto:labs@cohere.com)\].
|
| 286 |
+
|
| 287 |
+
**Try it now:**
|
| 288 |
+
|
| 289 |
+
You can try Command A+ in the [playground](https://dashboard.cohere.com/playground/chat?model=command-a-plus-05-2026). You can also use it in our dedicated [Hugging Face Space](https://huggingface.co/spaces/CohereLabs/command-a-plus-05-2026).
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- set reasoning = reasoning if reasoning is not undefined else (false if reasoning_effort is defined and reasoning_effort | lower == "none" else true) -%}
|
| 2 |
+
{%- set grounding = grounding | default("disabled") | upper %}
|
| 3 |
+
{%- set grounding_enabled = grounding == "ENABLED" %}
|
| 4 |
+
{%- set tools_or_docs_exist = tools or documents %}
|
| 5 |
+
{%- set render_tools_section = true %}
|
| 6 |
+
{%- set render_grounding = grounding_enabled and tools_or_docs_exist %}
|
| 7 |
+
{%- set render_platform_instruction_override = true if platform_instruction_override else false %}
|
| 8 |
+
{%- set has_developer_instruction = developer_instruction or developer_instruction == "" %}
|
| 9 |
+
{%- set render_developer_instruction = true if developer_instruction else false %}
|
| 10 |
+
{%- set convert_first_system_msg = convert_first_system_msg | default(true) -%}
|
| 11 |
+
{%- set skip_thinking = skip_thinking | default(false) -%}
|
| 12 |
+
{{ bos_token }}
|
| 13 |
+
{%- macro document_turn(documents) -%}
|
| 14 |
+
{# format documents into chat turn -#}
|
| 15 |
+
<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{%- if not skip_thinking -%}<|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|>{%- endif -%}<|START_ACTION|>[
|
| 16 |
+
{"tool_call_id": "0", "tool_name": "direct-injected-document", "parameters": {}}
|
| 17 |
+
]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[
|
| 18 |
+
{
|
| 19 |
+
"tool_call_id": "0",
|
| 20 |
+
"results": {
|
| 21 |
+
{%- for doc in documents %}
|
| 22 |
+
{%- set doc_val = doc.data if doc.data else doc %}
|
| 23 |
+
|
| 24 |
+
"{{ loop.index0 }}": {{ doc_val|tojson }}{% if not loop.last %},
|
| 25 |
+
{%- endif %}
|
| 26 |
+
{%- endfor %}
|
| 27 |
+
|
| 28 |
+
},
|
| 29 |
+
"is_error": null
|
| 30 |
+
}
|
| 31 |
+
]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}
|
| 32 |
+
{%- macro tool_call_id_to_int(messages, tool_call_id) %}
|
| 33 |
+
{%- if regen_tool_call_ids -%}
|
| 34 |
+
{%- set counter = namespace(value=0) %}
|
| 35 |
+
{%- set tool_call_id_seen = namespace(value=false) %}
|
| 36 |
+
{%- for msg in messages %}
|
| 37 |
+
{%- if msg.tool_calls %}
|
| 38 |
+
{%- for tool_call in msg.tool_calls %}
|
| 39 |
+
{%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}
|
| 40 |
+
{{ counter.value }}
|
| 41 |
+
{%- set tool_call_id_seen.value = true %}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
{%- set counter.value = counter.value + 1 %}
|
| 44 |
+
{%- endfor %}
|
| 45 |
+
{%- endif %}
|
| 46 |
+
{%- endfor %}
|
| 47 |
+
{%- else -%}
|
| 48 |
+
{{ tool_call_id }}
|
| 49 |
+
{%- endif -%}
|
| 50 |
+
{%- endmacro %}
|
| 51 |
+
{%- macro format_tool_message(messages, tool_msg) -%}
|
| 52 |
+
{#- format tool message #}{
|
| 53 |
+
"tool_call_id": "{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}",
|
| 54 |
+
"results": {
|
| 55 |
+
{%- if tool_msg.content is mapping or tool_msg.content is string %}
|
| 56 |
+
|
| 57 |
+
{% if tool_msg.content is string -%}
|
| 58 |
+
{%- set text_wrapper = {"content": tool_msg.content} -%}
|
| 59 |
+
{%- else -%}
|
| 60 |
+
{%- set text_wrapper = tool_msg.content -%}
|
| 61 |
+
{%- endif %}
|
| 62 |
+
"0": {{ text_wrapper|tojson }}
|
| 63 |
+
{%- else %}
|
| 64 |
+
{%- for content in tool_msg.content %}
|
| 65 |
+
|
| 66 |
+
"{{ loop.index0 }}": {{ print_tool_content(content) }}{% if not loop.last %},{% endif %}
|
| 67 |
+
{%- endfor %}
|
| 68 |
+
{%- endif %}
|
| 69 |
+
|
| 70 |
+
},
|
| 71 |
+
"is_error": null
|
| 72 |
+
}
|
| 73 |
+
{%- endmacro -%}
|
| 74 |
+
{%- macro print_tool_content(item) %}
|
| 75 |
+
{%- if item.type|lower == "text" -%}
|
| 76 |
+
{%- set text_wrapper = {"content": item.text} -%}
|
| 77 |
+
{{ text_wrapper|tojson }}
|
| 78 |
+
{%- elif item.type|lower == "document" and item.document and "data" in item.document -%}
|
| 79 |
+
{{ item.document.data|tojson }}
|
| 80 |
+
{%- else -%}
|
| 81 |
+
{{ item|tojson }}
|
| 82 |
+
{%- endif -%}
|
| 83 |
+
{%- endmacro %}
|
| 84 |
+
{%- macro print_msg(msg) %}
|
| 85 |
+
{%- if msg is string -%}
|
| 86 |
+
<|START_TEXT|>{{ msg }}<|END_TEXT|>
|
| 87 |
+
{%- elif msg.content is string -%}
|
| 88 |
+
<|START_TEXT|>{{ msg.content }}<|END_TEXT|>
|
| 89 |
+
{%- else %}
|
| 90 |
+
{%- set last_was_text = namespace(value=false) %}
|
| 91 |
+
{%- for content in msg.content %}
|
| 92 |
+
{%- if content.type|lower == "text" -%}
|
| 93 |
+
{%- if not last_was_text.value -%}
|
| 94 |
+
<|START_TEXT|>
|
| 95 |
+
{%- endif -%}
|
| 96 |
+
{{ content.text }}
|
| 97 |
+
{%- if loop.last -%}
|
| 98 |
+
<|END_TEXT|>
|
| 99 |
+
{%- endif %}
|
| 100 |
+
{%- set last_was_text.value = true -%}
|
| 101 |
+
{%- else -%}
|
| 102 |
+
{%- if last_was_text.value -%}
|
| 103 |
+
<|END_TEXT|>
|
| 104 |
+
{%- endif -%}
|
| 105 |
+
{%- set last_was_text.value = false -%}
|
| 106 |
+
{%- endif -%}
|
| 107 |
+
{%- if content.type|lower == "image" -%}
|
| 108 |
+
{%- if content.data -%}
|
| 109 |
+
{{ content.data }}
|
| 110 |
+
{%- else -%}
|
| 111 |
+
<|IMG_PATCH|>
|
| 112 |
+
{%- endif -%}
|
| 113 |
+
{%- endif -%}
|
| 114 |
+
{%- endfor %}
|
| 115 |
+
{%- endif %}
|
| 116 |
+
{%- endmacro %}
|
| 117 |
+
{%- macro print_thinking(msg) %}
|
| 118 |
+
{%- if msg.thinking -%}
|
| 119 |
+
{{ msg.thinking }}
|
| 120 |
+
{%- elif msg.content and msg.content[0].thinking -%}
|
| 121 |
+
{{ msg.content[0].thinking }}
|
| 122 |
+
{%- endif %}
|
| 123 |
+
{%- endmacro %}
|
| 124 |
+
{%- if messages and messages[0]['role']|lower == 'system' and not has_developer_instruction and convert_first_system_msg %}{%- set developer_instruction = messages[0] %}{%- set render_developer_instruction = true %}{%- set initial_instruction_message = true %}{% endif %}
|
| 125 |
+
{%- set json_object = true if response_format and response_format.type == "json_object" else false %}
|
| 126 |
+
{%- set json_schema = (response_format.json_schema or response_format.schema) if response_format %}
|
| 127 |
+
{%- set json_mode = json_object or json_schema %}
|
| 128 |
+
{%- set tool_idx = namespace(value=0) %}
|
| 129 |
+
{%- set tool_ids_seen = namespace(value=[]) %}
|
| 130 |
+
{%- set regen_tool_call_ids = regen_tool_call_ids | default(true) -%}
|
| 131 |
+
{%- set sent_documents = namespace(value=false) -%}
|
| 132 |
+
|
| 133 |
+
{%- if render_tools_section or render_platform_instruction_override or render_grounding or json_mode -%}
|
| 134 |
+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TEXT|>
|
| 135 |
+
{%- elif not render_developer_instruction -%}
|
| 136 |
+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>
|
| 137 |
+
{%- endif %}
|
| 138 |
+
|
| 139 |
+
{%- set rendered_platform_turn_chunk = false %}
|
| 140 |
+
|
| 141 |
+
{%- if render_platform_instruction_override -%}
|
| 142 |
+
{{ platform_instruction_override }}
|
| 143 |
+
{% set rendered_platform_turn_chunk = true %}
|
| 144 |
+
{%- else %}
|
| 145 |
+
{%- endif %}
|
| 146 |
+
|
| 147 |
+
{%- if render_grounding -%}
|
| 148 |
+
{%- if rendered_platform_turn_chunk %}
|
| 149 |
+
|
| 150 |
+
{% endif -%}
|
| 151 |
+
Note that both your responses and reflections can be grounded. Grounding means you associate pieces of texts (called "spans") with those specific tool results that support them (called "sources"). And you use a pair of tags "<co>" and "</co>" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as "{tool_call_id}:[{list of result indices}]", before they are joined together by ",". E.g., "<co>span</co: 0:[1,2],1:[0]>" means that "span" is supported by result 1 and 2 from "tool_call_id=0" as well as result 0 from "tool_call_id=1".
|
| 152 |
+
{% set rendered_platform_turn_chunk = true %}
|
| 153 |
+
{%- endif %}
|
| 154 |
+
|
| 155 |
+
{%- if render_tools_section %}
|
| 156 |
+
{%- if rendered_platform_turn_chunk %}
|
| 157 |
+
|
| 158 |
+
{% endif %}
|
| 159 |
+
# Available Tools
|
| 160 |
+
```json
|
| 161 |
+
[
|
| 162 |
+
{% if tools_or_docs_exist %}
|
| 163 |
+
{%- if documents %}
|
| 164 |
+
{"name": "direct-injected-document", "description": "This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!", "parameters": {"type": "object", "properties": {}, "required": []}, "responses": {"200": {"description": "Successfully returned a list of chunked text snippets from the directly uploaded documents.", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "required": ["url", "snippet"], "properties": {"url": {"type": "string", "description": "The url of the uploaded document."}, "snippet": {"type": "string", "description": "The text snippet for the returned document chunk."}}}}}}}}}
|
| 165 |
+
{%- if tools %},
|
| 166 |
+
{% else %}
|
| 167 |
+
|
| 168 |
+
{% endif %}
|
| 169 |
+
{%- endif %}
|
| 170 |
+
{%- for tool in tools %}
|
| 171 |
+
{"name": "{{ tool['function']['name'] }}", "description": "{{ tool['function']['description'] }}", "parameters": {{ tool['function']['parameters']|tojson }}, "responses": null}
|
| 172 |
+
{%- if not loop.last %},{% endif %}
|
| 173 |
+
|
| 174 |
+
{% endfor %}
|
| 175 |
+
{%- else %}
|
| 176 |
+
|
| 177 |
+
{% endif %}
|
| 178 |
+
]
|
| 179 |
+
```
|
| 180 |
+
{%- set rendered_platform_turn_chunk = true %}
|
| 181 |
+
{%- endif -%}
|
| 182 |
+
|
| 183 |
+
{%- if json_mode -%}
|
| 184 |
+
{%- if rendered_platform_turn_chunk %}
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
{% endif -%}
|
| 188 |
+
When generating JSON objects, do not generate block markers. Generate an object directly without prefixing with ```json. Return only the JSON and nothing else.
|
| 189 |
+
{%- if json_schema %}
|
| 190 |
+
|
| 191 |
+
Your output should adhere to the following json schema:
|
| 192 |
+
{{ json_schema }}
|
| 193 |
+
{%- endif -%}
|
| 194 |
+
{%- set rendered_platform_turn_chunk = true %}
|
| 195 |
+
{%- endif %}
|
| 196 |
+
{%- if rendered_platform_turn_chunk -%}
|
| 197 |
+
<|END_TEXT|><|END_OF_TURN_TOKEN|>
|
| 198 |
+
{%- elif not render_developer_instruction -%}
|
| 199 |
+
<|END_OF_TURN_TOKEN|>
|
| 200 |
+
{%- endif %}
|
| 201 |
+
{%- if render_developer_instruction -%}
|
| 202 |
+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ print_msg(developer_instruction) }}<|END_OF_TURN_TOKEN|>
|
| 203 |
+
{%- endif %}
|
| 204 |
+
{%- for message in messages %}
|
| 205 |
+
{%- set msg_role_downcased = message.role | lower %}
|
| 206 |
+
{%- if msg_role_downcased == 'system' and (not (loop.first and initial_instruction_message)) -%}
|
| 207 |
+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ print_msg(message) }}<|END_OF_TURN_TOKEN|>
|
| 208 |
+
{%- elif msg_role_downcased == 'user' -%}
|
| 209 |
+
<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ print_msg(message) }}<|END_OF_TURN_TOKEN|>
|
| 210 |
+
{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}
|
| 211 |
+
{%- elif msg_role_downcased == 'assistant' or msg_role_downcased == 'chatbot' -%}
|
| 212 |
+
<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>
|
| 213 |
+
{%- if message.tool_calls %}
|
| 214 |
+
{% if not skip_thinking %}
|
| 215 |
+
{% if message.tool_plan -%}
|
| 216 |
+
<|START_THINKING|>{{ message.tool_plan }}<|END_THINKING|>
|
| 217 |
+
{%- elif message.thinking or (message.content and message.content[0].type == "thinking") -%}
|
| 218 |
+
<|START_THINKING|>{{ print_thinking(message) }}<|END_THINKING|>
|
| 219 |
+
{%- endif %}
|
| 220 |
+
{%- endif %}<|START_ACTION|>[
|
| 221 |
+
{%- for tc in message.tool_calls %}
|
| 222 |
+
|
| 223 |
+
{"tool_call_id": "{%- if regen_tool_call_ids -%}{{ tool_idx.value }}{%- else -%}{{ tc.id }}{%- endif -%}", "tool_name": "{{ tc['function']['name'] }}", "parameters": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}
|
| 224 |
+
{%- set tool_idx.value = tool_idx.value + 1 %}
|
| 225 |
+
{%- endfor %}
|
| 226 |
+
|
| 227 |
+
]<|END_ACTION|><|END_OF_TURN_TOKEN|>
|
| 228 |
+
{%- else -%}
|
| 229 |
+
{% if (message.thinking or (message.content and message.content[0].type == "thinking")) and not skip_thinking -%}
|
| 230 |
+
<|START_THINKING|>{{ print_thinking(message) }}<|END_THINKING|>
|
| 231 |
+
{%- endif -%}
|
| 232 |
+
{{ print_msg(message) }}<|END_OF_TURN_TOKEN|>
|
| 233 |
+
{%- endif %}
|
| 234 |
+
{%- elif msg_role_downcased == 'tool' and message.tool_call_id not in tool_ids_seen.value -%}
|
| 235 |
+
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[
|
| 236 |
+
{{ format_tool_message(messages, message) }}
|
| 237 |
+
{%- for msg in messages[loop.index0 + 1:] %}
|
| 238 |
+
|
| 239 |
+
{%- if msg.role | lower == 'tool' %},
|
| 240 |
+
{{ format_tool_message(messages, msg) }}
|
| 241 |
+
{%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}
|
| 242 |
+
{%- else %}
|
| 243 |
+
{%- break %}
|
| 244 |
+
{%- endif %}
|
| 245 |
+
{%- endfor %}
|
| 246 |
+
|
| 247 |
+
]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>
|
| 248 |
+
{%- endif %}
|
| 249 |
+
{%- endfor %}{%- if add_generation_prompt -%}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if reasoning %}<|START_THINKING|>{% else %}<|START_THINKING|><|END_THINKING|>{% endif %}{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"adapter_layer_norm_eps": 1e-06,
|
| 3 |
+
"alignment_activation_fn": "swiglu",
|
| 4 |
+
"alignment_intermediate_size": 12288,
|
| 5 |
+
"architectures": [
|
| 6 |
+
"Cohere2VisionForConditionalGeneration"
|
| 7 |
+
],
|
| 8 |
+
"downsample_factor": 2,
|
| 9 |
+
"dtype": "bfloat16",
|
| 10 |
+
"enable_adapter_layer_norm": false,
|
| 11 |
+
"image_token": 255031,
|
| 12 |
+
"image_token_id": 255031,
|
| 13 |
+
"max_splits_per_img": 12,
|
| 14 |
+
"model_type": "cohere2_vision",
|
| 15 |
+
"text_config": {
|
| 16 |
+
"_sliding_window_pattern": 4,
|
| 17 |
+
"add_cross_attention": false,
|
| 18 |
+
"architectures": [
|
| 19 |
+
"Cohere2MoeForCausalLM"
|
| 20 |
+
],
|
| 21 |
+
"attention_bias": false,
|
| 22 |
+
"attention_dropout": 0.0,
|
| 23 |
+
"bos_token_id": 2,
|
| 24 |
+
"cross_attention_hidden_size": null,
|
| 25 |
+
"decoder_start_token_id": null,
|
| 26 |
+
"dtype": "bfloat16",
|
| 27 |
+
"eos_token_id": 255001,
|
| 28 |
+
"expert_selection_fn": "sigmoid",
|
| 29 |
+
"finetuning_task": null,
|
| 30 |
+
"first_k_dense_replace": 0,
|
| 31 |
+
"head_dim": 128,
|
| 32 |
+
"hidden_act": "silu",
|
| 33 |
+
"hidden_size": 4096,
|
| 34 |
+
"initializer_range": 0.02,
|
| 35 |
+
"intermediate_size": 4096,
|
| 36 |
+
"is_decoder": false,
|
| 37 |
+
"layer_norm_eps": 1e-05,
|
| 38 |
+
"layer_switch": 4,
|
| 39 |
+
"layer_types": [
|
| 40 |
+
"sliding_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"sliding_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"sliding_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"sliding_attention",
|
| 53 |
+
"sliding_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"full_attention",
|
| 56 |
+
"sliding_attention",
|
| 57 |
+
"sliding_attention",
|
| 58 |
+
"sliding_attention",
|
| 59 |
+
"full_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"full_attention",
|
| 64 |
+
"sliding_attention",
|
| 65 |
+
"sliding_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"full_attention",
|
| 68 |
+
"sliding_attention",
|
| 69 |
+
"sliding_attention",
|
| 70 |
+
"sliding_attention",
|
| 71 |
+
"full_attention"
|
| 72 |
+
],
|
| 73 |
+
"logit_scale": 1.0,
|
| 74 |
+
"max_position_embeddings": 5000000,
|
| 75 |
+
"model_type": "cohere2_moe",
|
| 76 |
+
"norm_topk_prob": true,
|
| 77 |
+
"num_attention_heads": 128,
|
| 78 |
+
"num_experts": 128,
|
| 79 |
+
"num_experts_per_tok": 8,
|
| 80 |
+
"num_hidden_layers": 32,
|
| 81 |
+
"num_key_value_heads": 8,
|
| 82 |
+
"num_shared_experts": 4,
|
| 83 |
+
"order_of_interleaved_layers": "local_attn_first",
|
| 84 |
+
"pad_token_id": 0,
|
| 85 |
+
"position_embedding_type": "rope_gptj",
|
| 86 |
+
"prefix": null,
|
| 87 |
+
"prefix_dense_intermediate_size": 16384,
|
| 88 |
+
"prefix_dense_sliding_window_pattern": 1,
|
| 89 |
+
"pruned_heads": {},
|
| 90 |
+
"rms_norm_eps": null,
|
| 91 |
+
"rope_parameters": {
|
| 92 |
+
"rope_theta": 50000,
|
| 93 |
+
"rope_type": "default"
|
| 94 |
+
},
|
| 95 |
+
"rope_theta": 50000,
|
| 96 |
+
"rotary_pct": 1.0,
|
| 97 |
+
"sep_token_id": null,
|
| 98 |
+
"shared_expert_combination_strategy": "average",
|
| 99 |
+
"sliding_window": 4096,
|
| 100 |
+
"task_specific_params": null,
|
| 101 |
+
"tf_legacy_loss": false,
|
| 102 |
+
"tie_encoder_decoder": false,
|
| 103 |
+
"tie_word_embeddings": true,
|
| 104 |
+
"tokenizer_class": null,
|
| 105 |
+
"torchscript": false,
|
| 106 |
+
"use_bfloat16": false,
|
| 107 |
+
"use_cache": true,
|
| 108 |
+
"use_embedding_sharing": true,
|
| 109 |
+
"use_gated_activation": true,
|
| 110 |
+
"use_parallel_block": true,
|
| 111 |
+
"use_parallel_embedding": false,
|
| 112 |
+
"use_qk_norm": false,
|
| 113 |
+
"vocab_size": 262144
|
| 114 |
+
},
|
| 115 |
+
"tie_word_embeddings": true,
|
| 116 |
+
"transformers_version": "5.8.0.dev0",
|
| 117 |
+
"vision_config": {
|
| 118 |
+
"add_cross_attention": false,
|
| 119 |
+
"attention_dropout": 0.0,
|
| 120 |
+
"bos_token_id": null,
|
| 121 |
+
"cross_attention_hidden_size": null,
|
| 122 |
+
"decoder_start_token_id": null,
|
| 123 |
+
"dtype": "bfloat16",
|
| 124 |
+
"eos_token_id": null,
|
| 125 |
+
"finetuning_task": null,
|
| 126 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 127 |
+
"hidden_size": 1152,
|
| 128 |
+
"image_size": 512,
|
| 129 |
+
"intermediate_size": 4304,
|
| 130 |
+
"is_decoder": false,
|
| 131 |
+
"layer_norm_eps": 1e-06,
|
| 132 |
+
"model_type": "siglip_vision_model",
|
| 133 |
+
"num_attention_heads": 16,
|
| 134 |
+
"num_channels": 3,
|
| 135 |
+
"num_hidden_layers": 27,
|
| 136 |
+
"pad_token_id": null,
|
| 137 |
+
"patch_size": 16,
|
| 138 |
+
"prefix": null,
|
| 139 |
+
"pruned_heads": {},
|
| 140 |
+
"sep_token_id": null,
|
| 141 |
+
"task_specific_params": null,
|
| 142 |
+
"tf_legacy_loss": false,
|
| 143 |
+
"tie_encoder_decoder": false,
|
| 144 |
+
"tie_word_embeddings": true,
|
| 145 |
+
"tokenizer_class": null,
|
| 146 |
+
"torchscript": false,
|
| 147 |
+
"use_bfloat16": false,
|
| 148 |
+
"vision_use_head": false
|
| 149 |
+
},
|
| 150 |
+
"vision_feature_layer": -1,
|
| 151 |
+
"vision_feature_select_strategy": "full"
|
| 152 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"eos_token_id": 255001,
|
| 5 |
+
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "5.8.0"
|
| 7 |
+
}
|
model-00001-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8104785b72701dbebfd4cf50691d998da7d3a6a8757666b47c9c4d747a413bde
|
| 3 |
+
size 49982701376
|
model-00002-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4548a1a47be61af36fae06b3572e5c5efaf20ba816435de5d3c2ff1b0b9cac3
|
| 3 |
+
size 49966979712
|
model-00003-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75957e8c80f80d67aabad02bc67118ffbc20f67fe1588e3459d0cdb9edf1b7fc
|
| 3 |
+
size 49982702224
|
model-00004-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14e3e1a578d56c93c301b53f0a31004446bcc65c99d7570e1847415aa35faba1
|
| 3 |
+
size 49966981096
|
model-00005-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8142af76771184e5342fef370f26c8d3dbfc27f43ee5041b90948e134b795193
|
| 3 |
+
size 49966981152
|
model-00006-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ba03d8c186a2fdc30fa5ec97324c615074ee3aa2416834ab4b9aaae21cf9c92
|
| 3 |
+
size 49982703368
|
model-00007-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14ac1d58ace034a5884c0d05e31c15e7d75422bed21cce3142d501820ad23396
|
| 3 |
+
size 49966981096
|
model-00008-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6df845e42298c68d80910f8398d899a7197089079f80bd552e544bd0da25955
|
| 3 |
+
size 49966981152
|
model-00009-of-00009.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3e7fed37fb8d17cfde2b09e4379b104770c78a7bf595f94145e04778ea51f6c
|
| 3 |
+
size 37719390320
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"crop_to_patches": true,
|
| 4 |
+
"data_format": "channels_first",
|
| 5 |
+
"default_to_square": true,
|
| 6 |
+
"do_convert_rgb": true,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
+
"do_resize": true,
|
| 10 |
+
"downsample_factor": 2,
|
| 11 |
+
"end_of_img_token": "<|END_OF_IMG|>",
|
| 12 |
+
"image_mean": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"image_processor_type": "Cohere2VisionImageProcessor",
|
| 18 |
+
"image_std": [
|
| 19 |
+
0.5,
|
| 20 |
+
0.5,
|
| 21 |
+
0.5
|
| 22 |
+
],
|
| 23 |
+
"img_line_break_token": "<|IMG_LINE_BREAK|>",
|
| 24 |
+
"img_patch_token": "<|IMG_PATCH|>",
|
| 25 |
+
"img_size": 512,
|
| 26 |
+
"max_patches": 12,
|
| 27 |
+
"min_patches": 1,
|
| 28 |
+
"patch_size": 16,
|
| 29 |
+
"resample": 3,
|
| 30 |
+
"rescale_factor": 0.00392156862745098,
|
| 31 |
+
"size": {
|
| 32 |
+
"height": 512,
|
| 33 |
+
"width": 512
|
| 34 |
+
},
|
| 35 |
+
"start_of_img_token": "<|START_OF_IMG|>"
|
| 36 |
+
},
|
| 37 |
+
"processor_class": "Cohere2VisionProcessor"
|
| 38 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<BOS_TOKEN>",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"eos_token": {
|
| 10 |
+
"content": "<|END_OF_TURN_TOKEN|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "<PAD>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<UNK>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"boi_token": "<|START_OF_IMG|>",
|
| 31 |
+
"eoi_token": "<|END_OF_IMG|>",
|
| 32 |
+
"image_token": "<|IMG_PATCH|>",
|
| 33 |
+
"img_line_break_token": "<|IMG_LINE_BREAK|>"
|
| 34 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14bd1c49d7d11874921d324986713df4be21cd06060530c497dacef99919b7a5
|
| 3 |
+
size 28217141
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": false,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"legacy": true,
|
| 7 |
+
"spaces_between_special_tokens": false,
|
| 8 |
+
"use_default_system_prompt": false,
|
| 9 |
+
"bos_token": "<BOS_TOKEN>",
|
| 10 |
+
"eos_token": "<|END_OF_TURN_TOKEN|>",
|
| 11 |
+
"pad_token": "<PAD>",
|
| 12 |
+
"unk_token": "<UNK>",
|
| 13 |
+
"tokenizer_class": "TokenizersBackend",
|
| 14 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 15 |
+
"sp_model_kwargs": {},
|
| 16 |
+
"chat_template": [
|
| 17 |
+
{
|
| 18 |
+
"name": "default",
|
| 19 |
+
"template": "{{ bos_token }}{% if documents %}\n{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"<co>\" and \"</co>\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"<co>span</co: 0:[1,2],1:[0]>\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>\n{%- else -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\n{% if safety_mode|upper == 'STRICT' -%}\nYou are in strict safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will reject requests to generate content related to violence, hate, misinformation or sex to any amount. You will avoid using profanity. You will not provide users with instructions to perform regulated, controlled or illegal activities.\n{%- else -%}\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n{%- endif %}\n\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{%- if add_generation_prompt -%}<|START_RESPONSE|>{%- endif %}\n{% endif %}"
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"name": "tool_use",
|
| 23 |
+
"template": "{{ bos_token }}{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"<co>\" and \"</co>\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"<co>span</co: 0:[1,2],1:[0]>\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"name": "rag",
|
| 27 |
+
"template": "{{ bos_token }}{% set tools = [] %}\n{%- macro document_turn(documents) -%}\n{# format documents into chat turn #}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|><|START_THINKING|>I will look through the document to address the users needs.<|END_THINKING|><|START_ACTION|>[\n {\"tool_call_id\": \"0\", \"tool_name\": \"direct-injected-document\", \"parameters\": {}}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n {\n \"tool_call_id\": \"0\",\n \"results\": {\n{% for doc in documents %}\n \"{{ loop.index0 }}\": {{doc|tojson}}{% if not loop.last %},\n {% endif %}\n{% endfor %}\n\n },\n \"is_error\": null\n }\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>{%- endmacro %}\n{%- macro tool_call_id_to_int(messages, tool_call_id) %}\n{%- set counter = namespace(value=0) %}\n{%- set tool_call_id_seen = namespace(value=false) %}\n{%- for msg in messages %}\n {%- if msg.tool_calls %}\n {%- for tool_call in msg.tool_calls %}\n {%- if tool_call.id == tool_call_id and not tool_call_id_seen.value -%}\n {{ counter.value }}\n {%- set tool_call_id_seen.value = true %}\n {%- endif %}\n {%- set counter.value = counter.value + 1 %}\n {%- endfor %}\n {%- endif %}\n{%- endfor %}\n{%- endmacro %}\n{%- macro format_tool_message(messages, tool_msg) -%}\n{# format tool message #}\n {\n \"tool_call_id\": \"{{ tool_call_id_to_int(messages, tool_msg.tool_call_id) }}\",\n \"results\": {\n \"0\": {{ tool_msg.content|tojson }}\n },\n \"is_error\": null\n }\n{%- endmacro -%}\n{%- if messages and messages[0]['role']|lower == 'system' %}{%- set developer_preamble = messages[0]['content'] %}{% endif %}\n{%- set tool_idx = namespace(value=0) %}\n{%- set tool_ids_seen = namespace(value=[]) %}\n{%- set sent_documents = namespace(value=false) %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># System Preamble\nYou are in contextual safety mode. You will reject requests to generate child sexual abuse material and child exploitation material in your responses. You will accept to provide information and creative content related to violence, hate, misinformation or sex, but you will not provide any content that could directly or indirectly lead to harmful outcomes.\n\nYour information cutoff date is June 2024.\n\nYou have been trained on data in English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Modern Standard Arabic, Mandarin, Russian, Indonesian, Turkish, Dutch, Polish, Persian, Vietnamese, Czech, Hindi, Ukrainian, Romanian, Greek and Hebrew but have the ability to speak many more languages.\n{% if tools or documents %}\n\nYou have been trained to have advanced reasoning and tool-use capabilities and you should make best use of these skills to serve user's requests.\n\n## Tool Use\nThink about how you can make best use of the provided tools to help with the task and come up with a high level plan that you will execute first.\n\n0. Start by writing <|START_THINKING|> followed by a detailed step by step plan of how you will solve the problem. For each step explain your thinking fully and give details of required tool calls (if needed). Unless specified otherwise, you write your plan in natural language. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when the user request is so straightforward to address that only a trivial plan would be needed.\n NOTE: You MUST skip this step when you are directly responding to the user's request without using any tools.\n\nThen carry out your plan by repeatedly executing the following steps.\n1. Action: write <|START_ACTION|> followed by a list of JSON-formatted tool calls, with each one containing \"tool_name\" and \"parameters\" fields.\n When there are multiple tool calls which are completely independent of each other (i.e. they can be executed in parallel), you should list them out all together in one step. When you finish, close it out with <|END_ACTION|>.\n2. Observation: you will then receive results of those tool calls in JSON format in the very next turn, wrapped around by <|START_TOOL_RESULT|> and <|END_TOOL_RESULT|>. Carefully observe those results and think about what to do next. Note that these results will be provided to you in a separate turn. NEVER hallucinate results.\n Every tool call produces a list of results (when a tool call produces no result or a single result, it'll still get wrapped inside a list). Each result is clearly linked to its originating tool call via its \"tool_call_id\".\n3. Reflection: start the next turn by writing <|START_THINKING|> followed by what you've figured out so far, any changes you need to make to your plan, and what you will do next. When you finish, close it out with <|END_THINKING|>.\n You can optionally choose to skip this step when everything is going according to plan and no special pieces of information or reasoning chains need to be recorded.\n NOTE: You MUST skip this step when you are done with tool-use actions and are ready to respond to the user.\n\nYou can repeat the above 3 steps multiple times (could be 0 times too if no suitable tool calls are available or needed), until you decide it's time to finally respond to the user.\n\n4. Response: then break out of the loop and write <|START_RESPONSE|> followed by a piece of text which serves as a response to the user's last request. Use all previous tool calls and results to help you when formulating your response. When you finish, close it out with <|END_RESPONSE|>.\n{% if enable_citations %}\n\n## Grounding\nImportantly, note that \"Reflection\" and \"Response\" above can be grounded.\nGrounding means you associate pieces of texts (called \"spans\") with those specific tool results that support them (called \"sources\"). And you use a pair of tags \"<co>\" and \"</co>\" to indicate when a span can be grounded onto a list of sources, listing them out in the closing tag. Sources from the same tool call are grouped together and listed as \"{tool_call_id}:[{list of result indices}]\", before they are joined together by \",\". E.g., \"<co>span</co: 0:[1,2],1:[0]>\" means that \"span\" is supported by result 1 and 2 from \"tool_call_id=0\" as well as result 0 from \"tool_call_id=1\".\n{% endif %}\n\n## Available Tools\nHere is the list of tools that you have available to you.\nYou can ONLY use the tools listed here. When a tool is not listed below, it is NOT available and you should NEVER attempt to use it.\nEach tool is represented as a JSON object with fields like \"name\", \"description\", \"parameters\" (per JSON Schema), and optionally, \"responses\" (per JSON Schema).\n\n```json\n[\n{% if documents %}\n {\"name\": \"direct-injected-document\", \"description\": \"This is a special tool to directly inject user-uploaded documents into the chat as additional context. DO NOT use this tool by yourself!\", \"parameters\": {\"type\": \"object\", \"properties\": {}, \"required\": []}, \"responses\": {\"200\": {\"description\": \"Successfully returned a list of chunked text snippets from the directly uploaded documents.\", \"content\": {\"application/json\": {\"schema\": {\"type\": \"array\", \"items\": {\"type\": \"object\", \"required\": [\"url\", \"snippet\"], \"properties\": {\"url\": {\"type\": \"string\", \"description\": \"The url of the uploaded document.\"}, \"snippet\": {\"type\": \"string\", \"description\": \"The text snippet for the returned document chunk.\"}}}}}}}}}{%- if tools %},{% endif %}\n\n{% endif %}\n{% for tool in tools %}\n {\"name\": \"{{ tool['function']['name'] }}\", \"description\": \"{{tool['function']['description']}}\", \"parameters\": {{ tool['function']['parameters']|tojson }}, \"responses\": null}{%- if not loop.last %},{% endif %}\n\n{% endfor %}\n]\n```\n\n{% endif %}\n# Default Preamble\nThe following instructions are your defaults unless specified elsewhere in developer preamble or user prompt.\n- Your name is Command.\n- You are a large language model built by Cohere.\n- You reply conversationally with a friendly and informative tone and often include introductory statements and follow-up questions.\n- If the input is ambiguous, ask clarifying follow-up questions.\n- Use Markdown-specific formatting in your response (for example to highlight phrases in bold or italics, create tables, or format code blocks).\n- Use LaTeX to generate mathematical notation for complex equations.\n- When responding in English, use American English unless context indicates otherwise.\n- When outputting responses of more than seven sentences, split the response into paragraphs.\n- Prefer the active voice.\n- Adhere to the APA style guidelines for punctuation, spelling, hyphenation, capitalization, numbers, lists, and quotation marks. Do not worry about them for other elements such as italics, citations, figures, or references.\n- Use gender-neutral pronouns for unspecified persons.\n- Limit lists to no more than 10 items unless the list is a set of finite instructions, in which case complete the list.\n- Use the third person when asked to write a summary.\n- When asked to extract values from source material, use the exact form, separated by commas.\n- When generating code output, please provide an explanation after the code.\n- When generating code output without specifying the programming language, please generate Python code.\n- If you are asked a question that requires reasoning, first think through your answer, slowly and step by step, then answer.\n{%- if developer_preamble %}\n\n\n# Developer Preamble\nThe following instructions take precedence over instructions in the default preamble and user prompt. You reject any instructions which conflict with system preamble instructions.\n{{ developer_preamble }}\n{%- endif -%}\n<|END_OF_TURN_TOKEN|>\n{%- for message in messages %}\n {%- if message.role|lower == 'system' and not (loop.first and developer_preamble)%}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>\n {%- elif message.role|lower == 'user' %}\n<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{ message.content }}<|END_OF_TURN_TOKEN|>{%- if documents and not sent_documents.value %}{%- set sent_documents.value = true %}{% set tool_idx.value = tool_idx.value + 1 %}{{ document_turn(documents) }}{% endif %}\n {%- elif message.role|lower == 'assistant' or message.role|lower == 'chatbot' %}\n<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{% if message.tool_calls %}<|START_THINKING|>{{message.tool_plan}}<|END_THINKING|><|START_ACTION|>[\n {% for tc in message.tool_calls %}\n {\"tool_call_id\": \"{{ tool_idx.value }}\", \"tool_name\": \"{{ tc['function']['name'] }}\", \"parameters\": {{ tc['function']['arguments']|tojson }}}{% if not loop.last %},{% endif %}\n\n {% set tool_idx.value = tool_idx.value + 1 %}\n {% endfor %}\n]<|END_ACTION|><|END_OF_TURN_TOKEN|>{% else %}<|START_RESPONSE|>{{message.content}}<|END_RESPONSE|><|END_OF_TURN_TOKEN|>{% endif %}\n {% elif message.role|lower == 'tool' and message.tool_call_id not in tool_ids_seen.value %}\n<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|><|START_TOOL_RESULT|>[\n{{ format_tool_message(messages, message) }}\n {%- for msg in messages[loop.index0 + 1:] %}\n {%- if msg.role|lower == 'tool' %},\n{{ format_tool_message(messages, msg) }}\n {%- set tool_ids_seen.value = tool_ids_seen.value + [msg.tool_call_id] %}\n {%- else %}\n {%- break %}\n {%- endif %}\n {%- endfor %}\n\n]<|END_TOOL_RESULT|><|END_OF_TURN_TOKEN|>\n {%- endif %}\n{%- endfor %}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"
|
| 28 |
+
}
|
| 29 |
+
],
|
| 30 |
+
"added_tokens_decoder": {
|
| 31 |
+
"0": {
|
| 32 |
+
"content": "<PAD>",
|
| 33 |
+
"lstrip": false,
|
| 34 |
+
"normalized": false,
|
| 35 |
+
"rstrip": false,
|
| 36 |
+
"single_word": false,
|
| 37 |
+
"special": true
|
| 38 |
+
},
|
| 39 |
+
"1": {
|
| 40 |
+
"content": "<MASK_TOKEN>",
|
| 41 |
+
"lstrip": false,
|
| 42 |
+
"normalized": false,
|
| 43 |
+
"rstrip": false,
|
| 44 |
+
"single_word": false,
|
| 45 |
+
"special": true
|
| 46 |
+
},
|
| 47 |
+
"2": {
|
| 48 |
+
"content": "<BOS_TOKEN>",
|
| 49 |
+
"lstrip": false,
|
| 50 |
+
"normalized": false,
|
| 51 |
+
"rstrip": false,
|
| 52 |
+
"single_word": false,
|
| 53 |
+
"special": true
|
| 54 |
+
},
|
| 55 |
+
"3": {
|
| 56 |
+
"content": "<EOS_TOKEN>",
|
| 57 |
+
"lstrip": false,
|
| 58 |
+
"normalized": false,
|
| 59 |
+
"rstrip": false,
|
| 60 |
+
"single_word": false,
|
| 61 |
+
"special": true
|
| 62 |
+
},
|
| 63 |
+
"4": {
|
| 64 |
+
"content": "<UNK>",
|
| 65 |
+
"lstrip": false,
|
| 66 |
+
"normalized": false,
|
| 67 |
+
"rstrip": false,
|
| 68 |
+
"single_word": false,
|
| 69 |
+
"special": true
|
| 70 |
+
},
|
| 71 |
+
"255000": {
|
| 72 |
+
"content": "<|START_OF_TURN_TOKEN|>",
|
| 73 |
+
"lstrip": false,
|
| 74 |
+
"normalized": false,
|
| 75 |
+
"rstrip": false,
|
| 76 |
+
"single_word": false,
|
| 77 |
+
"special": false
|
| 78 |
+
},
|
| 79 |
+
"255001": {
|
| 80 |
+
"content": "<|END_OF_TURN_TOKEN|>",
|
| 81 |
+
"lstrip": false,
|
| 82 |
+
"normalized": false,
|
| 83 |
+
"rstrip": false,
|
| 84 |
+
"single_word": false,
|
| 85 |
+
"special": false
|
| 86 |
+
},
|
| 87 |
+
"255002": {
|
| 88 |
+
"content": "<|USER_TOKEN|>",
|
| 89 |
+
"lstrip": false,
|
| 90 |
+
"normalized": false,
|
| 91 |
+
"rstrip": false,
|
| 92 |
+
"single_word": false,
|
| 93 |
+
"special": false
|
| 94 |
+
},
|
| 95 |
+
"255003": {
|
| 96 |
+
"content": "<|CHATBOT_TOKEN|>",
|
| 97 |
+
"lstrip": false,
|
| 98 |
+
"normalized": false,
|
| 99 |
+
"rstrip": false,
|
| 100 |
+
"single_word": false,
|
| 101 |
+
"special": false
|
| 102 |
+
},
|
| 103 |
+
"255004": {
|
| 104 |
+
"content": "<|SYSTEM_TOKEN|>",
|
| 105 |
+
"lstrip": false,
|
| 106 |
+
"normalized": false,
|
| 107 |
+
"rstrip": false,
|
| 108 |
+
"single_word": false,
|
| 109 |
+
"special": false
|
| 110 |
+
},
|
| 111 |
+
"255005": {
|
| 112 |
+
"content": "<|NEW_FILE|>",
|
| 113 |
+
"lstrip": false,
|
| 114 |
+
"normalized": false,
|
| 115 |
+
"rstrip": false,
|
| 116 |
+
"single_word": false,
|
| 117 |
+
"special": true
|
| 118 |
+
},
|
| 119 |
+
"255006": {
|
| 120 |
+
"content": "<|BEGINNING_OF_PREFIX_FIM_TOKEN|>",
|
| 121 |
+
"lstrip": false,
|
| 122 |
+
"normalized": false,
|
| 123 |
+
"rstrip": false,
|
| 124 |
+
"single_word": false,
|
| 125 |
+
"special": true
|
| 126 |
+
},
|
| 127 |
+
"255007": {
|
| 128 |
+
"content": "<|BEGINNING_OF_MIDDLE_FIM_TOKEN|>",
|
| 129 |
+
"lstrip": false,
|
| 130 |
+
"normalized": false,
|
| 131 |
+
"rstrip": false,
|
| 132 |
+
"single_word": false,
|
| 133 |
+
"special": true
|
| 134 |
+
},
|
| 135 |
+
"255008": {
|
| 136 |
+
"content": "<|BEGINNING_OF_SUFFIX_FIM_TOKEN|>",
|
| 137 |
+
"lstrip": false,
|
| 138 |
+
"normalized": false,
|
| 139 |
+
"rstrip": false,
|
| 140 |
+
"single_word": false,
|
| 141 |
+
"special": true
|
| 142 |
+
},
|
| 143 |
+
"255009": {
|
| 144 |
+
"content": "<|END_OF_MIDDLE_FIM_TOKEN|>",
|
| 145 |
+
"lstrip": false,
|
| 146 |
+
"normalized": false,
|
| 147 |
+
"rstrip": false,
|
| 148 |
+
"single_word": false,
|
| 149 |
+
"special": true
|
| 150 |
+
},
|
| 151 |
+
"255010": {
|
| 152 |
+
"content": "<|START_THINKING|>",
|
| 153 |
+
"lstrip": false,
|
| 154 |
+
"normalized": false,
|
| 155 |
+
"rstrip": false,
|
| 156 |
+
"single_word": false,
|
| 157 |
+
"special": false
|
| 158 |
+
},
|
| 159 |
+
"255011": {
|
| 160 |
+
"content": "<|END_THINKING|>",
|
| 161 |
+
"lstrip": false,
|
| 162 |
+
"normalized": false,
|
| 163 |
+
"rstrip": false,
|
| 164 |
+
"single_word": false,
|
| 165 |
+
"special": false
|
| 166 |
+
},
|
| 167 |
+
"255012": {
|
| 168 |
+
"content": "<|START_TEXT|>",
|
| 169 |
+
"lstrip": false,
|
| 170 |
+
"normalized": false,
|
| 171 |
+
"rstrip": false,
|
| 172 |
+
"single_word": false,
|
| 173 |
+
"special": false
|
| 174 |
+
},
|
| 175 |
+
"255013": {
|
| 176 |
+
"content": "<|END_TEXT|>",
|
| 177 |
+
"lstrip": false,
|
| 178 |
+
"normalized": false,
|
| 179 |
+
"rstrip": false,
|
| 180 |
+
"single_word": false,
|
| 181 |
+
"special": false
|
| 182 |
+
},
|
| 183 |
+
"255014": {
|
| 184 |
+
"content": "<|START_ACTION|>",
|
| 185 |
+
"lstrip": false,
|
| 186 |
+
"normalized": false,
|
| 187 |
+
"rstrip": false,
|
| 188 |
+
"single_word": false,
|
| 189 |
+
"special": false
|
| 190 |
+
},
|
| 191 |
+
"255015": {
|
| 192 |
+
"content": "<|END_ACTION|>",
|
| 193 |
+
"lstrip": false,
|
| 194 |
+
"normalized": false,
|
| 195 |
+
"rstrip": false,
|
| 196 |
+
"single_word": false,
|
| 197 |
+
"special": false
|
| 198 |
+
},
|
| 199 |
+
"255016": {
|
| 200 |
+
"content": "<|START_TOOL_RESULT|>",
|
| 201 |
+
"lstrip": false,
|
| 202 |
+
"normalized": false,
|
| 203 |
+
"rstrip": false,
|
| 204 |
+
"single_word": false,
|
| 205 |
+
"special": false
|
| 206 |
+
},
|
| 207 |
+
"255017": {
|
| 208 |
+
"content": "<|END_TOOL_RESULT|>",
|
| 209 |
+
"lstrip": false,
|
| 210 |
+
"normalized": false,
|
| 211 |
+
"rstrip": false,
|
| 212 |
+
"single_word": false,
|
| 213 |
+
"special": false
|
| 214 |
+
},
|
| 215 |
+
"255018": {
|
| 216 |
+
"content": "<|USER_0_TOKEN|>",
|
| 217 |
+
"lstrip": false,
|
| 218 |
+
"normalized": false,
|
| 219 |
+
"rstrip": false,
|
| 220 |
+
"single_word": false,
|
| 221 |
+
"special": false
|
| 222 |
+
},
|
| 223 |
+
"255019": {
|
| 224 |
+
"content": "<|USER_1_TOKEN|>",
|
| 225 |
+
"lstrip": false,
|
| 226 |
+
"normalized": false,
|
| 227 |
+
"rstrip": false,
|
| 228 |
+
"single_word": false,
|
| 229 |
+
"special": false
|
| 230 |
+
},
|
| 231 |
+
"255020": {
|
| 232 |
+
"content": "<|USER_2_TOKEN|>",
|
| 233 |
+
"lstrip": false,
|
| 234 |
+
"normalized": false,
|
| 235 |
+
"rstrip": false,
|
| 236 |
+
"single_word": false,
|
| 237 |
+
"special": false
|
| 238 |
+
},
|
| 239 |
+
"255021": {
|
| 240 |
+
"content": "<|USER_3_TOKEN|>",
|
| 241 |
+
"lstrip": false,
|
| 242 |
+
"normalized": false,
|
| 243 |
+
"rstrip": false,
|
| 244 |
+
"single_word": false,
|
| 245 |
+
"special": false
|
| 246 |
+
},
|
| 247 |
+
"255022": {
|
| 248 |
+
"content": "<|USER_4_TOKEN|>",
|
| 249 |
+
"lstrip": false,
|
| 250 |
+
"normalized": false,
|
| 251 |
+
"rstrip": false,
|
| 252 |
+
"single_word": false,
|
| 253 |
+
"special": false
|
| 254 |
+
},
|
| 255 |
+
"255023": {
|
| 256 |
+
"content": "<|USER_5_TOKEN|>",
|
| 257 |
+
"lstrip": false,
|
| 258 |
+
"normalized": false,
|
| 259 |
+
"rstrip": false,
|
| 260 |
+
"single_word": false,
|
| 261 |
+
"special": false
|
| 262 |
+
},
|
| 263 |
+
"255024": {
|
| 264 |
+
"content": "<|USER_6_TOKEN|>",
|
| 265 |
+
"lstrip": false,
|
| 266 |
+
"normalized": false,
|
| 267 |
+
"rstrip": false,
|
| 268 |
+
"single_word": false,
|
| 269 |
+
"special": false
|
| 270 |
+
},
|
| 271 |
+
"255025": {
|
| 272 |
+
"content": "<|USER_7_TOKEN|>",
|
| 273 |
+
"lstrip": false,
|
| 274 |
+
"normalized": false,
|
| 275 |
+
"rstrip": false,
|
| 276 |
+
"single_word": false,
|
| 277 |
+
"special": false
|
| 278 |
+
},
|
| 279 |
+
"255026": {
|
| 280 |
+
"content": "<|USER_8_TOKEN|>",
|
| 281 |
+
"lstrip": false,
|
| 282 |
+
"normalized": false,
|
| 283 |
+
"rstrip": false,
|
| 284 |
+
"single_word": false,
|
| 285 |
+
"special": false
|
| 286 |
+
},
|
| 287 |
+
"255027": {
|
| 288 |
+
"content": "<|USER_9_TOKEN|>",
|
| 289 |
+
"lstrip": false,
|
| 290 |
+
"normalized": false,
|
| 291 |
+
"rstrip": false,
|
| 292 |
+
"single_word": false,
|
| 293 |
+
"special": false
|
| 294 |
+
},
|
| 295 |
+
"255028": {
|
| 296 |
+
"content": "<|START_OF_IMG|>",
|
| 297 |
+
"lstrip": false,
|
| 298 |
+
"normalized": false,
|
| 299 |
+
"rstrip": false,
|
| 300 |
+
"single_word": false,
|
| 301 |
+
"special": true
|
| 302 |
+
},
|
| 303 |
+
"255029": {
|
| 304 |
+
"content": "<|END_OF_IMG|>",
|
| 305 |
+
"lstrip": false,
|
| 306 |
+
"normalized": false,
|
| 307 |
+
"rstrip": false,
|
| 308 |
+
"single_word": false,
|
| 309 |
+
"special": true
|
| 310 |
+
},
|
| 311 |
+
"255030": {
|
| 312 |
+
"content": "<|IMG_LINE_BREAK|>",
|
| 313 |
+
"lstrip": false,
|
| 314 |
+
"normalized": false,
|
| 315 |
+
"rstrip": false,
|
| 316 |
+
"single_word": false,
|
| 317 |
+
"special": true
|
| 318 |
+
},
|
| 319 |
+
"255031": {
|
| 320 |
+
"content": "<|IMG_PATCH|>",
|
| 321 |
+
"lstrip": false,
|
| 322 |
+
"normalized": false,
|
| 323 |
+
"rstrip": false,
|
| 324 |
+
"single_word": false,
|
| 325 |
+
"special": true
|
| 326 |
+
}
|
| 327 |
+
},
|
| 328 |
+
"boi_token": "<|START_OF_IMG|>",
|
| 329 |
+
"eoi_token": "<|END_OF_IMG|>",
|
| 330 |
+
"image_token": "<|IMG_PATCH|>",
|
| 331 |
+
"img_line_break_token": "<|IMG_LINE_BREAK|>",
|
| 332 |
+
"extra_special_tokens": {
|
| 333 |
+
"boi_token": "<|START_OF_IMG|>",
|
| 334 |
+
"eoi_token": "<|END_OF_IMG|>",
|
| 335 |
+
"image_token": "<|IMG_PATCH|>",
|
| 336 |
+
"img_line_break_token": "<|IMG_LINE_BREAK|>"
|
| 337 |
+
}
|
| 338 |
+
}
|