Commit
·
f82b8c4
verified
·
0
Parent(s):
Super-squash branch 'main' using huggingface_hub
Browse filesCo-authored-by: pandora-s <pandora-s@users.noreply.huggingface.co>
Co-authored-by: juliendenize <juliendenize@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +37 -0
- README.md +440 -0
- SYSTEM_PROMPT.txt +29 -0
- chat_template.jinja +121 -0
- consolidated-00001-of-00272.safetensors +3 -0
- consolidated-00002-of-00272.safetensors +3 -0
- consolidated-00003-of-00272.safetensors +3 -0
- consolidated-00004-of-00272.safetensors +3 -0
- consolidated-00005-of-00272.safetensors +3 -0
- consolidated-00006-of-00272.safetensors +3 -0
- consolidated-00007-of-00272.safetensors +3 -0
- consolidated-00008-of-00272.safetensors +3 -0
- consolidated-00009-of-00272.safetensors +3 -0
- consolidated-00010-of-00272.safetensors +3 -0
- consolidated-00011-of-00272.safetensors +3 -0
- consolidated-00012-of-00272.safetensors +3 -0
- consolidated-00013-of-00272.safetensors +3 -0
- consolidated-00014-of-00272.safetensors +3 -0
- consolidated-00015-of-00272.safetensors +3 -0
- consolidated-00016-of-00272.safetensors +3 -0
- consolidated-00017-of-00272.safetensors +3 -0
- consolidated-00018-of-00272.safetensors +3 -0
- consolidated-00019-of-00272.safetensors +3 -0
- consolidated-00020-of-00272.safetensors +3 -0
- consolidated-00021-of-00272.safetensors +3 -0
- consolidated-00022-of-00272.safetensors +3 -0
- consolidated-00023-of-00272.safetensors +3 -0
- consolidated-00024-of-00272.safetensors +3 -0
- consolidated-00025-of-00272.safetensors +3 -0
- consolidated-00026-of-00272.safetensors +3 -0
- consolidated-00027-of-00272.safetensors +3 -0
- consolidated-00028-of-00272.safetensors +3 -0
- consolidated-00029-of-00272.safetensors +3 -0
- consolidated-00030-of-00272.safetensors +3 -0
- consolidated-00031-of-00272.safetensors +3 -0
- consolidated-00032-of-00272.safetensors +3 -0
- consolidated-00033-of-00272.safetensors +3 -0
- consolidated-00034-of-00272.safetensors +3 -0
- consolidated-00035-of-00272.safetensors +3 -0
- consolidated-00036-of-00272.safetensors +3 -0
- consolidated-00037-of-00272.safetensors +3 -0
- consolidated-00038-of-00272.safetensors +3 -0
- consolidated-00039-of-00272.safetensors +3 -0
- consolidated-00040-of-00272.safetensors +3 -0
- consolidated-00041-of-00272.safetensors +3 -0
- consolidated-00042-of-00272.safetensors +3 -0
- consolidated-00043-of-00272.safetensors +3 -0
- consolidated-00044-of-00272.safetensors +3 -0
- consolidated-00045-of-00272.safetensors +3 -0
- consolidated-00046-of-00272.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
tekken.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: vllm
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- fr
|
| 6 |
+
- es
|
| 7 |
+
- de
|
| 8 |
+
- it
|
| 9 |
+
- pt
|
| 10 |
+
- nl
|
| 11 |
+
- zh
|
| 12 |
+
- ja
|
| 13 |
+
- ko
|
| 14 |
+
- ar
|
| 15 |
+
license: apache-2.0
|
| 16 |
+
inference: false
|
| 17 |
+
extra_gated_description: >-
|
| 18 |
+
If you want to learn more about how we process your personal data, please read
|
| 19 |
+
our <a href="https://mistral.ai/terms/">Privacy Policy</a>.
|
| 20 |
+
base_model:
|
| 21 |
+
- mistralai/Mistral-Large-3-675B-Base-2512
|
| 22 |
+
tags:
|
| 23 |
+
- mistral-common
|
| 24 |
+
- compressed-tensors
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
# Mistral Large 3 675B Instruct 2512
|
| 28 |
+
From our family of large models, **Mistral Large 3** is a state-of-the-art general-purpose **Multimodal granular Mixture-of-Experts** model with **41B active parameters** and **675B total parameters** trained from the ground up with 3000 H200s
|
| 29 |
+
|
| 30 |
+
This model is the instruct post-trained version in **FP8**, fine-tuned for instruction tasks, making it ideal for chat, agentic and instruction based use cases.
|
| 31 |
+
Designed for reliability and long-context comprehension - It is engineered for production-grade assistants, retrieval-augmented systems, scientific workloads, and complex enterprise workflows.
|
| 32 |
+
|
| 33 |
+
Learn more in our blog post [here](https://mistral.ai/news/mistral-3).
|
| 34 |
+
|
| 35 |
+
Mistral Large 3 is deployable on-premises in:
|
| 36 |
+
- **FP8** on a single node of B200s or H200s.
|
| 37 |
+
- [NVFP4](https://huggingface.co/mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4) on a single node of H100s or A100s.
|
| 38 |
+
|
| 39 |
+
We provide a [BF16](https://huggingface.co/mistralai/Mistral-Large-3-675B-Instruct-2512-BF16) version if needed.
|
| 40 |
+
|
| 41 |
+
## Key Features
|
| 42 |
+
Mistral Large 3 consists of two main architectural components:
|
| 43 |
+
- **A Granular MoE Language Model with 673B params and 39B active**
|
| 44 |
+
- **A 2.5B Vision Encoder**
|
| 45 |
+
|
| 46 |
+
The Mistral Large 3 Instruct model offers the following capabilities:
|
| 47 |
+
- **Vision**: Enables the model to analyze images and provide insights based on visual content, in addition to text.
|
| 48 |
+
- **Multilingual**: Supports dozens of languages, including English, French, Spanish, German, Italian, Portuguese, Dutch, Chinese, Japanese, Korean, Arabic.
|
| 49 |
+
- **System Prompt**: Maintains strong adherence and support for system prompts.
|
| 50 |
+
- **Agentic**: Offers best-in-class agentic capabilities with native function calling and JSON outputting.
|
| 51 |
+
- **Frontier**: Delivers best-in-class performance.
|
| 52 |
+
- **Apache 2.0 License**: Open-source license allowing usage and modification for both commercial and non-commercial purposes.
|
| 53 |
+
- **Large Context Window**: Supports a 256k context window.
|
| 54 |
+
|
| 55 |
+
## Use Cases
|
| 56 |
+
With powerful long-context performance, stable and consistent cross-domain behavior, Mistral Large 3 is perfect for:
|
| 57 |
+
- Long Document Understanding
|
| 58 |
+
- Powerful Daily-Driver AI Assistants
|
| 59 |
+
- State-of-the-Art Agentic and Tool-Use Capabilities
|
| 60 |
+
- Enterprise Knowledge Work
|
| 61 |
+
- General Coding Assistant
|
| 62 |
+
|
| 63 |
+
And enterprise-grade use cases requiring frontier capabilities.
|
| 64 |
+
|
| 65 |
+
## Recommended Settings
|
| 66 |
+
|
| 67 |
+
We recommend deploying Large 3 in a client-server configuration with the following best practices:
|
| 68 |
+
|
| 69 |
+
- **System Prompt**: Define a clear environment and use case, including guidance on how to effectively leverage tools in agentic systems.
|
| 70 |
+
- **Sampling Parameters**: Use a temperature below 0.1 for daily-driver and production environments ; Higher temperatures may be explored for creative use cases - developers are encouraged to experiment with alternative settings.
|
| 71 |
+
- **Tools**: Keep the set of tools well-defined and limit their number to the minimum required for the use case - Avoiding overloading the model with an excessive number of tools.
|
| 72 |
+
- **Vision**: When deploying with vision capabilities, we recommend maintaining an aspect ratio close to 1:1 (width-to-height) for images. Avoiding the use of overly thin or wide images - crop them as needed to ensure optimal performance.
|
| 73 |
+
|
| 74 |
+
### Known Issues / Limitations
|
| 75 |
+
|
| 76 |
+
- **Not a dedicated reasoning model**: Dedicated reasoning models can outperform Mistral Large 3 in strict reasoning use cases.
|
| 77 |
+
- **Behind vision-first models in multimodal tasks**: Mistral Large 3 can lag behind models optimized for vision tasks and use cases.
|
| 78 |
+
- **Complex deployment**: Due to its large size and architecture, the model can be challenging to deploy efficiently with constrained resources or at scale.
|
| 79 |
+
|
| 80 |
+
## Benchmark Results
|
| 81 |
+
|
| 82 |
+
We compare Mistral Large 3 to similar sized models.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
|
| 90 |
+
## Usage
|
| 91 |
+
|
| 92 |
+
The model can be used with the following frameworks;
|
| 93 |
+
- [`vllm`](https://github.com/vllm-project/vllm): See [here](#vllm)
|
| 94 |
+
|
| 95 |
+
> [!Note]
|
| 96 |
+
> We sadly didn't have enough time to add Mistral Large 3 to transformers, but we would be very happy for a community contribution by opening a PR to [huggingface/transformers](https://github.com/huggingface/transformers).
|
| 97 |
+
|
| 98 |
+
### vLLM
|
| 99 |
+
|
| 100 |
+
We recommend using this model with [vLLM](https://github.com/vllm-project/vllm).
|
| 101 |
+
|
| 102 |
+
#### Installation
|
| 103 |
+
|
| 104 |
+
Make sure to install most recent vllm:
|
| 105 |
+
|
| 106 |
+
```
|
| 107 |
+
uv pip install -U vllm \
|
| 108 |
+
--torch-backend=auto \
|
| 109 |
+
--extra-index-url https://wheels.vllm.ai/nightly
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
Doing so should automatically install [`mistral_common >= 1.8.6`](https://github.com/mistralai/mistral-common/releases/tag/v1.8.6).
|
| 113 |
+
|
| 114 |
+
To check:
|
| 115 |
+
```
|
| 116 |
+
python -c "import mistral_common; print(mistral_common.__version__)"
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
You can also make use of a ready-to-go [docker image](https://github.com/vllm-project/vllm/blob/main/Dockerfile) or on the [docker hub](https://hub.docker.com/layers/vllm/vllm-openai/latest/images/sha256-de9032a92ffea7b5c007dad80b38fd44aac11eddc31c435f8e52f3b7404bbf39).
|
| 120 |
+
|
| 121 |
+
#### Serve
|
| 122 |
+
|
| 123 |
+
The Mistral Large 3 Instruct FP8 format can be used on one 8xH200 node. We recommend to use this format if you plan to fine-tuning as it can be more precise than NVFP4 in some situations.
|
| 124 |
+
|
| 125 |
+
**Simple**
|
| 126 |
+
|
| 127 |
+
A simple launch command is:
|
| 128 |
+
|
| 129 |
+
```bash
|
| 130 |
+
vllm serve mistralai/Mistral-Large-3-675B-Instruct-2512 \
|
| 131 |
+
--tensor-parallel-size 8 \
|
| 132 |
+
--tokenizer_mode mistral --config_format mistral --load_format mistral \
|
| 133 |
+
--enable-auto-tool-choice --tool-call-parser mistral
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
Key parameter notes:
|
| 137 |
+
|
| 138 |
+
* enable-auto-tool-choice: Required when enabling tool usage.
|
| 139 |
+
* tool-call-parser mistral: Required when enabling tool usage.
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
Additional flags:
|
| 143 |
+
|
| 144 |
+
* You can set `--max-model-len` to preserve memory. By default it is set to `262144` which is quite large but not necessary for most scenarios.
|
| 145 |
+
* You can set `--max-num-batched-tokens` to balance throughput and latency, higher means higher throughput but higher latency.
|
| 146 |
+
|
| 147 |
+
**Accelerated with speculative decoding**
|
| 148 |
+
|
| 149 |
+
For maximum performance we recommend serving the checkpoint with its customized draft model (Mistral-Large-3-675B-Instruct-2512-Eagle)[https://huggingface.co/mistralai/Mistral-Large-3-675B-Instruct-2512-Eagle]:
|
| 150 |
+
|
| 151 |
+
```bash
|
| 152 |
+
vllm serve mistralai/Mistral-Large-3-675B-Instruct-2512 \
|
| 153 |
+
--tensor-parallel-size 8 \
|
| 154 |
+
--load-format mistral \
|
| 155 |
+
--tokenizer-mode mistral \
|
| 156 |
+
--config-format mistral \
|
| 157 |
+
--enable-auto-tool-choice \
|
| 158 |
+
--tool-call-parser mistral \
|
| 159 |
+
--limit-mm-per-prompt '{"image": 10}' \
|
| 160 |
+
--speculative_config '{
|
| 161 |
+
"model": "mistralai/Mistral-Large-3-675B-Instruct-2512-Eagle",
|
| 162 |
+
"num_speculative_tokens": 3,
|
| 163 |
+
"method": "eagle",
|
| 164 |
+
"max_model_len": "16384"
|
| 165 |
+
}'
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
For more information on the draft model, please have a look at (Mistral-Large-3-675B-Instruct-2512-Eagle)[https://huggingface.co/mistralai/Mistral-Large-3-675B-Instruct-2512-Eagle].
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
#### Usage of the model
|
| 172 |
+
|
| 173 |
+
Here we asumme that the model `mistralai/Mistral-Large-3-675B-Instruct-2512` is served and you can ping it to the domain `localhost` with the port `8000` which is the default for vLLM.
|
| 174 |
+
|
| 175 |
+
<details>
|
| 176 |
+
<summary>Vision Reasoning</summary>
|
| 177 |
+
|
| 178 |
+
Let's see if Mistral Large 3 knows when to pick a fight !
|
| 179 |
+
|
| 180 |
+
```python
|
| 181 |
+
from datetime import datetime, timedelta
|
| 182 |
+
|
| 183 |
+
from openai import OpenAI
|
| 184 |
+
from huggingface_hub import hf_hub_download
|
| 185 |
+
|
| 186 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
| 187 |
+
openai_api_key = "EMPTY"
|
| 188 |
+
openai_api_base = "http://localhost:8000/v1"
|
| 189 |
+
|
| 190 |
+
TEMP = 0.15
|
| 191 |
+
MAX_TOK = 262144
|
| 192 |
+
|
| 193 |
+
client = OpenAI(
|
| 194 |
+
api_key=openai_api_key,
|
| 195 |
+
base_url=openai_api_base,
|
| 196 |
+
)
|
| 197 |
+
|
| 198 |
+
models = client.models.list()
|
| 199 |
+
model = models.data[0].id
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
| 203 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 204 |
+
with open(file_path, "r") as file:
|
| 205 |
+
system_prompt = file.read()
|
| 206 |
+
today = datetime.today().strftime("%Y-%m-%d")
|
| 207 |
+
yesterday = (datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d")
|
| 208 |
+
model_name = repo_id.split("/")[-1]
|
| 209 |
+
return system_prompt.format(name=model_name, today=today, yesterday=yesterday)
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
|
| 213 |
+
image_url = "https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438"
|
| 214 |
+
|
| 215 |
+
messages = [
|
| 216 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 217 |
+
{
|
| 218 |
+
"role": "user",
|
| 219 |
+
"content": [
|
| 220 |
+
{
|
| 221 |
+
"type": "text",
|
| 222 |
+
"text": "What action do you think I should take in this situation? List all the possible actions and explain why you think they are good or bad.",
|
| 223 |
+
},
|
| 224 |
+
{"type": "image_url", "image_url": {"url": image_url}},
|
| 225 |
+
],
|
| 226 |
+
},
|
| 227 |
+
]
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
response = client.chat.completions.create(
|
| 231 |
+
model=model,
|
| 232 |
+
messages=messages,
|
| 233 |
+
temperature=TEMP,
|
| 234 |
+
max_tokens=MAX_TOK,
|
| 235 |
+
)
|
| 236 |
+
|
| 237 |
+
print(response.choices[0].message.content)
|
| 238 |
+
```
|
| 239 |
+
</details>
|
| 240 |
+
|
| 241 |
+
<details>
|
| 242 |
+
<summary>Function Calling</summary>
|
| 243 |
+
|
| 244 |
+
Let's solve some equations thanks to our simple Python calculator tool.
|
| 245 |
+
|
| 246 |
+
```python
|
| 247 |
+
import json
|
| 248 |
+
from openai import OpenAI
|
| 249 |
+
from huggingface_hub import hf_hub_download
|
| 250 |
+
|
| 251 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
| 252 |
+
openai_api_key = "EMPTY"
|
| 253 |
+
openai_api_base = "http://localhost:8000/v1"
|
| 254 |
+
|
| 255 |
+
TEMP = 0.15
|
| 256 |
+
MAX_TOK = 262144
|
| 257 |
+
|
| 258 |
+
client = OpenAI(
|
| 259 |
+
api_key=openai_api_key,
|
| 260 |
+
base_url=openai_api_base,
|
| 261 |
+
)
|
| 262 |
+
|
| 263 |
+
models = client.models.list()
|
| 264 |
+
model = models.data[0].id
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
| 268 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 269 |
+
with open(file_path, "r") as file:
|
| 270 |
+
system_prompt = file.read()
|
| 271 |
+
return system_prompt
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
|
| 275 |
+
|
| 276 |
+
image_url = "https://math-coaching.com/img/fiche/46/expressions-mathematiques.jpg"
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
def my_calculator(expression: str) -> str:
|
| 280 |
+
return str(eval(expression))
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
tools = [
|
| 284 |
+
{
|
| 285 |
+
"type": "function",
|
| 286 |
+
"function": {
|
| 287 |
+
"name": "my_calculator",
|
| 288 |
+
"description": "A calculator that can evaluate a mathematical equation and compute its results.",
|
| 289 |
+
"parameters": {
|
| 290 |
+
"type": "object",
|
| 291 |
+
"properties": {
|
| 292 |
+
"expression": {
|
| 293 |
+
"type": "string",
|
| 294 |
+
"description": "The mathematical expression to evaluate.",
|
| 295 |
+
},
|
| 296 |
+
},
|
| 297 |
+
"required": ["expression"],
|
| 298 |
+
},
|
| 299 |
+
},
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"type": "function",
|
| 303 |
+
"function": {
|
| 304 |
+
"name": "rewrite",
|
| 305 |
+
"description": "Rewrite a given text for improved clarity",
|
| 306 |
+
"parameters": {
|
| 307 |
+
"type": "object",
|
| 308 |
+
"properties": {
|
| 309 |
+
"text": {
|
| 310 |
+
"type": "string",
|
| 311 |
+
"description": "The input text to rewrite",
|
| 312 |
+
}
|
| 313 |
+
},
|
| 314 |
+
},
|
| 315 |
+
},
|
| 316 |
+
},
|
| 317 |
+
]
|
| 318 |
+
|
| 319 |
+
messages = [
|
| 320 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 321 |
+
{
|
| 322 |
+
"role": "user",
|
| 323 |
+
"content": [
|
| 324 |
+
{
|
| 325 |
+
"type": "text",
|
| 326 |
+
"text": "Thanks to your calculator, compute the results for the equations that involve numbers displayed in the image.",
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
"type": "image_url",
|
| 330 |
+
"image_url": {
|
| 331 |
+
"url": image_url,
|
| 332 |
+
},
|
| 333 |
+
},
|
| 334 |
+
],
|
| 335 |
+
},
|
| 336 |
+
]
|
| 337 |
+
|
| 338 |
+
response = client.chat.completions.create(
|
| 339 |
+
model=model,
|
| 340 |
+
messages=messages,
|
| 341 |
+
temperature=TEMP,
|
| 342 |
+
max_tokens=MAX_TOK,
|
| 343 |
+
tools=tools,
|
| 344 |
+
tool_choice="auto",
|
| 345 |
+
)
|
| 346 |
+
|
| 347 |
+
tool_calls = response.choices[0].message.tool_calls
|
| 348 |
+
|
| 349 |
+
results = []
|
| 350 |
+
for tool_call in tool_calls:
|
| 351 |
+
function_name = tool_call.function.name
|
| 352 |
+
function_args = tool_call.function.arguments
|
| 353 |
+
if function_name == "my_calculator":
|
| 354 |
+
result = my_calculator(**json.loads(function_args))
|
| 355 |
+
results.append(result)
|
| 356 |
+
|
| 357 |
+
messages.append({"role": "assistant", "tool_calls": tool_calls})
|
| 358 |
+
for tool_call, result in zip(tool_calls, results):
|
| 359 |
+
messages.append(
|
| 360 |
+
{
|
| 361 |
+
"role": "tool",
|
| 362 |
+
"tool_call_id": tool_call.id,
|
| 363 |
+
"name": tool_call.function.name,
|
| 364 |
+
"content": result,
|
| 365 |
+
}
|
| 366 |
+
)
|
| 367 |
+
|
| 368 |
+
|
| 369 |
+
response = client.chat.completions.create(
|
| 370 |
+
model=model,
|
| 371 |
+
messages=messages,
|
| 372 |
+
temperature=TEMP,
|
| 373 |
+
max_tokens=MAX_TOK,
|
| 374 |
+
)
|
| 375 |
+
|
| 376 |
+
print(response.choices[0].message.content)
|
| 377 |
+
```
|
| 378 |
+
|
| 379 |
+
</details>
|
| 380 |
+
|
| 381 |
+
<details>
|
| 382 |
+
<summary>Text-Only Request</summary>
|
| 383 |
+
|
| 384 |
+
Mistral Large 3 can follow your instructions down to the letter.
|
| 385 |
+
|
| 386 |
+
```python
|
| 387 |
+
from openai import OpenAI
|
| 388 |
+
from huggingface_hub import hf_hub_download
|
| 389 |
+
|
| 390 |
+
# Modify OpenAI's API key and API base to use vLLM's API server.
|
| 391 |
+
openai_api_key = "EMPTY"
|
| 392 |
+
openai_api_base = "http://localhost:8000/v1"
|
| 393 |
+
|
| 394 |
+
TEMP = 0.15
|
| 395 |
+
MAX_TOK = 262144
|
| 396 |
+
|
| 397 |
+
client = OpenAI(
|
| 398 |
+
api_key=openai_api_key,
|
| 399 |
+
base_url=openai_api_base,
|
| 400 |
+
)
|
| 401 |
+
|
| 402 |
+
models = client.models.list()
|
| 403 |
+
model = models.data[0].id
|
| 404 |
+
|
| 405 |
+
|
| 406 |
+
def load_system_prompt(repo_id: str, filename: str) -> str:
|
| 407 |
+
file_path = hf_hub_download(repo_id=repo_id, filename=filename)
|
| 408 |
+
with open(file_path, "r") as file:
|
| 409 |
+
system_prompt = file.read()
|
| 410 |
+
return system_prompt
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
SYSTEM_PROMPT = load_system_prompt(model, "SYSTEM_PROMPT.txt")
|
| 414 |
+
|
| 415 |
+
messages = [
|
| 416 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 417 |
+
{
|
| 418 |
+
"role": "user",
|
| 419 |
+
"content": "Write me a sentence where every word starts with the next letter in the alphabet - start with 'a' and end with 'z'.",
|
| 420 |
+
},
|
| 421 |
+
]
|
| 422 |
+
|
| 423 |
+
response = client.chat.completions.create(
|
| 424 |
+
model=model,
|
| 425 |
+
messages=messages,
|
| 426 |
+
temperature=TEMP,
|
| 427 |
+
max_tokens=MAX_TOK,
|
| 428 |
+
)
|
| 429 |
+
|
| 430 |
+
assistant_message = response.choices[0].message.content
|
| 431 |
+
print(assistant_message)
|
| 432 |
+
```
|
| 433 |
+
|
| 434 |
+
</details>
|
| 435 |
+
|
| 436 |
+
## License
|
| 437 |
+
|
| 438 |
+
This model is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0.txt).
|
| 439 |
+
|
| 440 |
+
*You must not use this model in a manner that infringes, misappropriates, or otherwise violates any third party’s rights, including intellectual property rights.*
|
SYSTEM_PROMPT.txt
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are Mistral-Large-3-675B-Instruct-2512, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.
|
| 2 |
+
You power an AI assistant called Le Chat.
|
| 3 |
+
Your knowledge base was last updated on 2023-10-01.
|
| 4 |
+
The current date is {today}.
|
| 5 |
+
|
| 6 |
+
When you're not sure about some information or when the user's request requires up-to-date or specific data, you must use the available tools to fetch the information. Do not hesitate to use tools whenever they can provide a more accurate or complete response. If no relevant tools are available, then clearly state that you don't have the information and avoid making up anything.
|
| 7 |
+
If the user's question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. "What are some good restaurants around me?" => "Where are you?" or "When is the next flight to Tokyo" => "Where do you travel from?").
|
| 8 |
+
You are always very attentive to dates, in particular you try to resolve dates (e.g. "yesterday" is {yesterday}) and when asked about information at specific dates, you discard information that is at another date.
|
| 9 |
+
You follow these instructions in all languages, and always respond to the user in the language they use or request.
|
| 10 |
+
Next sections describe the capabilities that you have.
|
| 11 |
+
|
| 12 |
+
# WEB BROWSING INSTRUCTIONS
|
| 13 |
+
|
| 14 |
+
You cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.
|
| 15 |
+
|
| 16 |
+
# MULTI-MODAL INSTRUCTIONS
|
| 17 |
+
|
| 18 |
+
You have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.
|
| 19 |
+
You cannot read nor transcribe audio files or videos.
|
| 20 |
+
|
| 21 |
+
# TOOL CALLING INSTRUCTIONS
|
| 22 |
+
|
| 23 |
+
You may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:
|
| 24 |
+
|
| 25 |
+
1. When the request requires up-to-date information.
|
| 26 |
+
2. When the request requires specific data that you do not have in your knowledge base.
|
| 27 |
+
3. When the request involves actions that you cannot perform without tools.
|
| 28 |
+
|
| 29 |
+
Always prioritize using tools to provide the most accurate and helpful response. If tools are not available, inform the user that you cannot perform the requested action at the moment.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#- Default system message if no system prompt is passed. #}
|
| 2 |
+
{%- set default_system_message = 'You are Mistral-Large-3-675B-Instruct-2512, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\nYou power an AI assistant called Le Chat.\nYour knowledge base was last updated on 2023-10-01.\nThe current date is {today}.\n\nWhen you\'re not sure about some information or when the user\'s request requires up-to-date or specific data, you must use the available tools to fetch the information. Do not hesitate to use tools whenever they can provide a more accurate or complete response. If no relevant tools are available, then clearly state that you don\'t have the information and avoid making up anything.\nIf the user\'s question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. "What are some good restaurants around me?" => "Where are you?" or "When is the next flight to Tokyo" => "Where do you travel from?").\nYou are always very attentive to dates, in particular you try to resolve dates (e.g. "yesterday" is {yesterday}) and when asked about information at specific dates, you discard information that is at another date.\nYou follow these instructions in all languages, and always respond to the user in the language they use or request.\nNext sections describe the capabilities that you have.\n\n# WEB BROWSING INSTRUCTIONS\n\nYou cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.\n\n# MULTI-MODAL INSTRUCTIONS\n\nYou have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.\nYou cannot read nor transcribe audio files or videos.\n\n# TOOL CALLING INSTRUCTIONS\n\nYou may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:\n\n1. When the request requires up-to-date information.\n2. When the request requires specific data that you do not have in your knowledge base.\n3. When the request involves actions that you cannot perform without tools.\n\nAlways prioritize using tools to provide the most accurate and helpful response. If tools are not available, inform the user that you cannot perform the requested action at the moment.' %}
|
| 3 |
+
|
| 4 |
+
{#- Begin of sequence token. #}
|
| 5 |
+
{{- bos_token }}
|
| 6 |
+
|
| 7 |
+
{#- Handle system prompt if it exists. #}
|
| 8 |
+
{#- System prompt supports text content or text chunks. #}
|
| 9 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 10 |
+
{{- '[SYSTEM_PROMPT]' -}}
|
| 11 |
+
{%- if messages[0]['content'] is string %}
|
| 12 |
+
{{- messages[0]['content'] -}}
|
| 13 |
+
{%- else %}
|
| 14 |
+
{%- for block in messages[0]['content'] %}
|
| 15 |
+
{%- if block['type'] == 'text' %}
|
| 16 |
+
{{- block['text'] }}
|
| 17 |
+
{%- else %}
|
| 18 |
+
{{- raise_exception('Only text chunks are supported in system message contents.') }}
|
| 19 |
+
{%- endif %}
|
| 20 |
+
{%- endfor %}
|
| 21 |
+
{%- endif %}
|
| 22 |
+
{{- '[/SYSTEM_PROMPT]' -}}
|
| 23 |
+
{%- set loop_messages = messages[1:] %}
|
| 24 |
+
{%- else %}
|
| 25 |
+
{%- set loop_messages = messages %}
|
| 26 |
+
{%- if default_system_message != '' %}
|
| 27 |
+
{{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- endif %}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
{#- Tools definition #}
|
| 33 |
+
{%- set tools_definition = '' %}
|
| 34 |
+
{%- set has_tools = false %}
|
| 35 |
+
{%- if tools is defined and tools is not none and tools|length > 0 %}
|
| 36 |
+
{%- set has_tools = true %}
|
| 37 |
+
{%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
|
| 38 |
+
{{- tools_definition }}
|
| 39 |
+
{%- endif %}
|
| 40 |
+
|
| 41 |
+
{#- Checks for alternating user/assistant messages. #}
|
| 42 |
+
{%- set ns = namespace(index=0) %}
|
| 43 |
+
{%- for message in loop_messages %}
|
| 44 |
+
{%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}
|
| 45 |
+
{%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}
|
| 46 |
+
{{- raise_exception('After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.') }}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- set ns.index = ns.index + 1 %}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- endfor %}
|
| 51 |
+
|
| 52 |
+
{#- Handle conversation messages. #}
|
| 53 |
+
{%- for message in loop_messages %}
|
| 54 |
+
|
| 55 |
+
{#- User messages supports text content or text and image chunks. #}
|
| 56 |
+
{%- if message['role'] == 'user' %}
|
| 57 |
+
{%- if message['content'] is string %}
|
| 58 |
+
{{- '[INST]' + message['content'] + '[/INST]' }}
|
| 59 |
+
{%- elif message['content'] | length > 0 %}
|
| 60 |
+
{{- '[INST]' }}
|
| 61 |
+
{%- if message['content'] | length == 2 %}
|
| 62 |
+
{%- set blocks = message['content'] | sort(attribute='type') %}
|
| 63 |
+
{%- else %}
|
| 64 |
+
{%- set blocks = message['content'] %}
|
| 65 |
+
{%- endif %}
|
| 66 |
+
{%- for block in blocks %}
|
| 67 |
+
{%- if block['type'] == 'text' %}
|
| 68 |
+
{{- block['text'] }}
|
| 69 |
+
{%- elif block['type'] in ['image', 'image_url'] %}
|
| 70 |
+
{{- '[IMG]' }}
|
| 71 |
+
{%- else %}
|
| 72 |
+
{{- raise_exception('Only text, image and image_url chunks are supported in user message content.') }}
|
| 73 |
+
{%- endif %}
|
| 74 |
+
{%- endfor %}
|
| 75 |
+
{{- '[/INST]' }}
|
| 76 |
+
{%- else %}
|
| 77 |
+
{{- raise_exception('User message must have a string or a list of chunks in content') }}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
|
| 80 |
+
{#- Assistant messages supports text content or text and image chunks. #}
|
| 81 |
+
{%- elif message['role'] == 'assistant' %}
|
| 82 |
+
{%- if (message['content'] is none or message['content'] == '' or message['content']|length == 0) and (message['tool_calls'] is not defined or message['tool_calls'] is none or message['tool_calls']|length == 0) %}
|
| 83 |
+
{{- raise_exception('Assistant message must have a string or a list of chunks in content or a list of tool calls.') }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
|
| 86 |
+
{%- if message['content'] is string %}
|
| 87 |
+
{{- message['content'] }}
|
| 88 |
+
{%- elif message['content'] | length > 0 %}
|
| 89 |
+
{%- for block in message['content'] %}
|
| 90 |
+
{%- if block['type'] == 'text' %}
|
| 91 |
+
{{- block['text'] }}
|
| 92 |
+
{%- else %}
|
| 93 |
+
{{- raise_exception('Only text chunks are supported in assistant message contents.') }}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
{%- endfor %}
|
| 96 |
+
{%- endif %}
|
| 97 |
+
|
| 98 |
+
{%- if message['tool_calls'] is defined and message['tool_calls'] is not none and message['tool_calls']|length > 0 %}
|
| 99 |
+
{%- for tool in message['tool_calls'] %}
|
| 100 |
+
{%- set arguments = tool['function']['arguments'] %}
|
| 101 |
+
{%- if arguments is not string %}
|
| 102 |
+
{%- set arguments = arguments|tojson|safe %}
|
| 103 |
+
{%- elif arguments == '' %}
|
| 104 |
+
{%- set arguments = '{}' %}
|
| 105 |
+
{%- endif %}
|
| 106 |
+
{{- '[TOOL_CALLS]' + tool['function']['name'] + '[ARGS]' + arguments }}
|
| 107 |
+
{%- endfor %}
|
| 108 |
+
{%- endif %}
|
| 109 |
+
|
| 110 |
+
{#- End of sequence token for each assistant messages. #}
|
| 111 |
+
{{- eos_token }}
|
| 112 |
+
|
| 113 |
+
{#- Tool messages only supports text content. #}
|
| 114 |
+
{%- elif message['role'] == 'tool' %}
|
| 115 |
+
{{- '[TOOL_RESULTS]' + message['content']|string + '[/TOOL_RESULTS]' }}
|
| 116 |
+
|
| 117 |
+
{#- Raise exception for unsupported roles. #}
|
| 118 |
+
{%- else %}
|
| 119 |
+
{{- raise_exception('Only user, assistant and tool roles are supported, got ' + message['role'] + '.') }}
|
| 120 |
+
{%- endif %}
|
| 121 |
+
{%- endfor %}
|
consolidated-00001-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:99ccf734ae34f4cd4d8013a89da22823a62ca7e0769f1e7bcb1df532abda5538
|
| 3 |
+
size 2544898528
|
consolidated-00002-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc973bed9d3b0ee0771836692e897eded3d9ef8454f2875a89a56dbc4a122d82
|
| 3 |
+
size 2495933768
|
consolidated-00003-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e271c884a86f58257db2d87105aaf996f9b22ce2b8df528d533a9faa838ec7d1
|
| 3 |
+
size 2495933656
|
consolidated-00004-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:187ed9d560eec49e2a4aa18306f3f9ae383b79c8520f50364b7d2e2eaf22082c
|
| 3 |
+
size 2495933648
|
consolidated-00005-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ac3ad87f939936e32ef5f511099d161d338fdb9b41d256c09e2ff818d47190d
|
| 3 |
+
size 2495933656
|
consolidated-00006-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:046f480aafafd8f714ee60cda82c610db3e7fdd718a9c16f92aa98eb796b6b9f
|
| 3 |
+
size 2494520904
|
consolidated-00007-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:66d486cbdf25c261ac5dc7a8868411e7c30b3c175839c403c9e33b2f7c690c25
|
| 3 |
+
size 2495933704
|
consolidated-00008-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:acb5844c2e41a138dae89e2346b75de73a055b6fd753b52ce387949485052d87
|
| 3 |
+
size 2495933656
|
consolidated-00009-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c9c29bcb9af8c543a9a197c62bbe08a37544d3750a35eb0e69a0c6c75b0ca2b
|
| 3 |
+
size 2495933648
|
consolidated-00010-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e43e71c58fd2a4ec7a02104a378341dc33ad6c0a77943205f9b0035ad2ec439a
|
| 3 |
+
size 2494520536
|
consolidated-00011-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04519642d3de0ecdbc5e28008643132c8e74fd849bfbc899b53999f45bd77127
|
| 3 |
+
size 2495933816
|
consolidated-00012-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0a53dd5eca2eb17d0c5d28d28594f69285ee0b726bab1af783d81b627e065753
|
| 3 |
+
size 2495933648
|
consolidated-00013-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e7fd74ba2a0327416d198e13f43c12fc97945be94d5149b1fa46586050872bb5
|
| 3 |
+
size 2495933656
|
consolidated-00014-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1cfaf1982a92589a79584d68825e5b46c973c112f8e42058b588fe00c37cb36
|
| 3 |
+
size 2495933648
|
consolidated-00015-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0602288a4cde4f42d730fe442c5f01f2b6dfb480b7bc8fa5364196258ed9a8e1
|
| 3 |
+
size 2494520728
|
consolidated-00016-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fbb0af0a5c4921b248a0c8cf3e530921a509fa2e467301656a746be7115861ba
|
| 3 |
+
size 2495933752
|
consolidated-00017-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:965f86f402452f56308cbbf3794e15bedd92c4d1a2fccee14d286a00d2be2683
|
| 3 |
+
size 2495933656
|
consolidated-00018-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:819c3d672ad0c27105101ecc6244a83cc5528e75a89fa2f8f2de4c514276a64a
|
| 3 |
+
size 2495933648
|
consolidated-00019-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11e97d3177e5c0c68c33478f16a665e1ed6dd05a6197a1cb8c24d0d2fb45f0d6
|
| 3 |
+
size 2434732872
|
consolidated-00020-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fe6228fce3d56ac0205202d503d38c1b7831f08c8ee663790c8a54129ed16384
|
| 3 |
+
size 2496993872
|
consolidated-00021-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d43f253d7939316e7414fcfb91b7fb246393012f7f0621705ca75491dfc34140
|
| 3 |
+
size 2495933696
|
consolidated-00022-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73554a27945649bdff1c40f9db540c2c59dcf4f6ef47eb8c4f05e57d8980ad14
|
| 3 |
+
size 2495933656
|
consolidated-00023-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aac94096a2b6f4380fee4f3a1a689ba01bd9532bb95122394c4e9e0b89fa5803
|
| 3 |
+
size 2495933648
|
consolidated-00024-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af6f6c6fedbce5eb6bdf3e8a4d2533cd802b6fd900f2ce8c3e7aa16f08aa4c8a
|
| 3 |
+
size 2494520568
|
consolidated-00025-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4621528782d4b92d97159305e9b605fc44ad641158d36518b7886ac5bbad69e6
|
| 3 |
+
size 2495933800
|
consolidated-00026-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:078f29479d863934bc0392233bd5cb7df64f95c1794382c34441a1f18c525ca9
|
| 3 |
+
size 2495933648
|
consolidated-00027-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f9f1391075dcdefc0d5e8a1f34247155b63be8261eb34cca6538563752244c97
|
| 3 |
+
size 2495933656
|
consolidated-00028-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ab22062f13383bc801d9bb36f7c80c8800c44406798b3654a69018ab9de2a982
|
| 3 |
+
size 2495933648
|
consolidated-00029-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f37e8ebffffc1889cdb6aa1372feb5692b442c65a9ab3f1f8d282a40710e6d0b
|
| 3 |
+
size 2494520776
|
consolidated-00030-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cbc5045c5765851ab90703656bcde70a5483b66b040cf4259f98623d5e9050a3
|
| 3 |
+
size 2495933744
|
consolidated-00031-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11e542b847b4a27cf19079a92528ce45ed5088e5df4e305a850fb3097faf5379
|
| 3 |
+
size 2495933648
|
consolidated-00032-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d5eb4b9b79960ce6abfe005fbf04693a5880a682f83f8190e4937d5e6c3cd73
|
| 3 |
+
size 2495933656
|
consolidated-00033-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:92c9387d401ed5ee0769b8b26252d55393b1eb1d1f4dd23f521be9b4fcba2cbf
|
| 3 |
+
size 2494520448
|
consolidated-00034-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b42e7085249fb541eb1ef3660c59eab10af368817fbdff78df8a7ac9990cb5a0
|
| 3 |
+
size 2495933800
|
consolidated-00035-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54067b8c60d73b81b57d918dfd814bc449193488bef9345dce26c6a9fc722af2
|
| 3 |
+
size 2495933680
|
consolidated-00036-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be99393cb5b14c86db49b4e5778be7825b403a98681e488ec1665ab07f9b5159
|
| 3 |
+
size 2495933648
|
consolidated-00037-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e1b753481c356148d1c9b7a80e2685d84c6e577721254d593f19ddf1ab7f8aaa
|
| 3 |
+
size 2495933656
|
consolidated-00038-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:baa271df72c804cc234e55e759d99d36775fbd6f90aea479fd8078f591304894
|
| 3 |
+
size 2494520616
|
consolidated-00039-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:389b935aa2eaeca539ed04e0cfa8251e6395ad4b494cf8e8ff3376b9831c1491
|
| 3 |
+
size 2495933784
|
consolidated-00040-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9554a0cca5a5e6e6c0f81c4a2710640e0e794ce88676256a1e363c8911e2476d
|
| 3 |
+
size 2495933648
|
consolidated-00041-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:64ec95123f9da378b11ce176a747951f927dafa3362aa7bb298d79827ff18803
|
| 3 |
+
size 2495933648
|
consolidated-00042-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0125ed86144c976f1d07617dd93de23efc8c332cfb5ccc64cf5f9f7fba1c0277
|
| 3 |
+
size 2495933656
|
consolidated-00043-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06e6f16929e9cafa90a50614aa63ca0bfaea2760c9da28994f856ebba96481d7
|
| 3 |
+
size 2494520840
|
consolidated-00044-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c675490f8789cfeabae64800df0122be5db48526002ce1002e476678f97fdaa
|
| 3 |
+
size 2495933728
|
consolidated-00045-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a2c0ec35e95459beedb88472a4222e42491f7cc8c265260d8542b812ad3d3b23
|
| 3 |
+
size 2495933648
|
consolidated-00046-of-00272.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:04ab3b0dacbf2f0bd428db71c11137fe724a6995027d0227757fed302922a81e
|
| 3 |
+
size 2495933656
|