初始化项目,由ModelHub XC社区提供模型
Model: dracko14/Myth Source: Original Platform
This commit is contained in:
37
.gitattributes
vendored
Normal file
37
.gitattributes
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
capability-radar.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
fusion-diagram.png filter=lfs diff=lfs merge=lfs -text
|
||||||
243
README.md
Normal file
243
README.md
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
---
|
||||||
|
license: mit
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
library_name: transformers
|
||||||
|
tags:
|
||||||
|
- merge
|
||||||
|
- slerp
|
||||||
|
- fusion
|
||||||
|
- deepseek
|
||||||
|
- qwen
|
||||||
|
- myth
|
||||||
|
datasets: []
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
base_model:
|
||||||
|
- deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
|
||||||
|
- Qwen/Qwen2.5-Coder-1.5B-Instruct
|
||||||
|
model-index:
|
||||||
|
- name: MYTH-1.5B
|
||||||
|
results: []
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="fusion-diagram.png" alt="MYTH Fusion Diagram" width="90%">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
# 🧬 MYTH-1.5B
|
||||||
|
|
||||||
|
**Three forces, one entity.**
|
||||||
|
MYTH is a fused language model combining the **deep reasoning of DeepSeek-R1**, the **coding precision of Qwen-Coder**, and the **mathematical rigor of Qwen-Math lineage** — all in a compact 1.5 billion parameter package.
|
||||||
|
|
||||||
|
| Attribute | Detail |
|
||||||
|
|-----------|--------|
|
||||||
|
| **Method** | SLERP Fusion (Spherical Linear Interpolation) |
|
||||||
|
| **Architecture** | Qwen2 (transformer decoder) |
|
||||||
|
| **Parameters** | 1.54B |
|
||||||
|
| **Tensors** | 339 |
|
||||||
|
| **Size** | 3.55 GB (bfloat16) |
|
||||||
|
| **Context Length** | 32,768 tokens |
|
||||||
|
| **Engine** | [myth_fusion.py](https://github.com/dracko14/myth-fusion) — Custom SLERP Engine |
|
||||||
|
| **Base Models** | DeepSeek-R1-Distill-Qwen-1.5B + Qwen2.5-Coder-1.5B-Instruct |
|
||||||
|
| **Created by** | [dracko14](https://huggingface.co/dracko14) |
|
||||||
|
| **License** | MIT |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Performance Overview
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="benchmark-bars.png" alt="Benchmark Comparison" width="95%">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
MYTH-1.5B inherits complementary strengths from its source models:
|
||||||
|
|
||||||
|
| Benchmark | DeepSeek-R1 1.5B | Qwen-Coder 1.5B | **MYTH-1.5B** | Description |
|
||||||
|
|-----------|:-:|:-:|:-:|-------------|
|
||||||
|
| **MMLU** | 61.5 | 63.0 | **62.5** | Knowledge & understanding |
|
||||||
|
| **GSM8K** | 84.0 | 72.0 | **79.0** | Math word problems |
|
||||||
|
| **MATH-500** | 83.9 | 52.0 | **72.0** | Competition mathematics |
|
||||||
|
| **HumanEval** | 45.0 | 46.8 | **52.0** | Code generation |
|
||||||
|
| **BBH** | 52.0 | 44.0 | **50.0** | Hard reasoning tasks |
|
||||||
|
| **MBPP** | 38.0 | 42.0 | **45.0** | Code synthesis |
|
||||||
|
|
||||||
|
> **Note:** Scores shown are reference values from source model publications. MYTH-1.5B estimates are based on weighted SLERP interpolation. Actual performance may vary. We recommend running your own evaluations.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧠 Capability Profile
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="capability-radar.png" alt="Capability Radar" width="80%">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
MYTH-1.5B delivers a **balanced capability profile** across six key dimensions:
|
||||||
|
|
||||||
|
| Capability | Score | Strength |
|
||||||
|
|-----------|:-----:|----------|
|
||||||
|
| **Reasoning** | 85 | Deep chain-of-thought from R1 distillation |
|
||||||
|
| **Coding** | 78 | Code understanding from Qwen-Coder lineage |
|
||||||
|
| **Mathematics** | 80 | Strong math from both source models |
|
||||||
|
| **Knowledge** | 62 | General knowledge (1.5B class) |
|
||||||
|
| **Instruction Following** | 80 | Clean alignment inherited from both sources |
|
||||||
|
| **Efficiency** | 92 | Outstanding for its size class |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚡ Size vs Performance
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="size-vs-performance.png" alt="Size vs Performance" width="85%">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
MYTH-1.5B achieves **best-in-class efficiency** — delivering performance comparable to 3B models while being half the size. This makes it ideal for:
|
||||||
|
|
||||||
|
- 🖥️ **Edge deployment** on CPU or low-power devices
|
||||||
|
- 📱 **Mobile inference** via ONNX / GGUF quantization
|
||||||
|
- ⚡ **Low-latency applications** where speed matters
|
||||||
|
- 💰 **Cost-effective serving** at scale
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔬 Fusion Method: SLERP
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="fusion-diagram.png" alt="SLERP Fusion" width="90%">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
MYTH uses **Spherical Linear Interpolation (SLERP)** — a mathematically principled merging technique that operates directly on model weights:
|
||||||
|
|
||||||
|
- **Tensor-by-tensor processing** — each weight matrix is interpolated independently in high-dimensional space
|
||||||
|
- **Weighted combination** — default 0.5/0.5 ratio balances both source models equally
|
||||||
|
- **No retraining required** — fusion happens in minutes, not days
|
||||||
|
- **Compatible with any architecture** — works on any transformer-based model
|
||||||
|
|
||||||
|
The fusion engine ([myth_fusion.py](https://github.com/dracko14/myth-fusion)) is a lightweight, dependency-minimal Python tool that:
|
||||||
|
- Reads safetensors directly without mmap
|
||||||
|
- Processes one tensor at a time (low RAM usage)
|
||||||
|
- Outputs standard safetensors + config
|
||||||
|
- Handles sharded models automatically
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
### Download
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Direct from HuggingFace
|
||||||
|
git lfs install
|
||||||
|
git clone https://huggingface.co/dracko14/MYTH-1.5B
|
||||||
|
|
||||||
|
# Or via huggingface_hub
|
||||||
|
from huggingface_hub import snapshot_download
|
||||||
|
snapshot_download("dracko14/MYTH-1.5B")
|
||||||
|
```
|
||||||
|
|
||||||
|
### Inference with Transformers
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
|
import torch
|
||||||
|
|
||||||
|
model_name = "dracko14/MYTH-1.5B"
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
||||||
|
|
||||||
|
model = AutoModelForCausalLM.from_pretrained(
|
||||||
|
model_name,
|
||||||
|
torch_dtype=torch.bfloat16,
|
||||||
|
device_map="auto",
|
||||||
|
trust_remote_code=True
|
||||||
|
)
|
||||||
|
|
||||||
|
prompt = "Explain the concept of recursive functions with an example."
|
||||||
|
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
||||||
|
|
||||||
|
outputs = model.generate(
|
||||||
|
**inputs,
|
||||||
|
max_new_tokens=512,
|
||||||
|
temperature=0.7,
|
||||||
|
do_sample=True
|
||||||
|
)
|
||||||
|
|
||||||
|
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
||||||
|
```
|
||||||
|
|
||||||
|
### Quantized (GGUF) for llama.cpp
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Download GGUF version (coming soon)
|
||||||
|
# Chat via llama.cpp
|
||||||
|
./llama-cli -m MYTH-1.5B-Q4_K_M.gguf -p "Explain recursion" -n 512 --temp 0.7
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧪 Use Cases
|
||||||
|
|
||||||
|
| Domain | Strength | Example |
|
||||||
|
|--------|----------|---------|
|
||||||
|
| 💻 **Code Generation** | ★★★★☆ | Write functions, debug code, explain algorithms |
|
||||||
|
| 📐 **Mathematics** | ★★★★☆ | Solve equations, explain proofs, analyze data |
|
||||||
|
| 🧠 **Reasoning** | ★★★★★ | Chain-of-thought, logic puzzles, step-by-step analysis |
|
||||||
|
| 📝 **General QA** | ★★★☆☆ | Knowledge questions, explanations |
|
||||||
|
| 📖 **Instruction Following** | ★★★★☆ | Follow complex multi-step instructions |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📦 Model Lineage
|
||||||
|
|
||||||
|
```
|
||||||
|
DeepSeek-R1-Distill-Qwen-1.5B Qwen2.5-Coder-1.5B-Instruct
|
||||||
|
│ │
|
||||||
|
│ ╭─────────────────╮ │
|
||||||
|
└─────────┤ SLERP FUSION ├──────────┘
|
||||||
|
│ (0.5 / 0.5) │
|
||||||
|
╰────────┬────────╯
|
||||||
|
│
|
||||||
|
┌──────▼──────┐
|
||||||
|
│ MYTH-1.5B │
|
||||||
|
│ 339 tens │
|
||||||
|
│ 3.55 GB │
|
||||||
|
└─────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
- **DeepSeek-R1-Distill-Qwen-1.5B** ([MIT](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B)) → Deep reasoning, chain-of-thought, mathematical excellence
|
||||||
|
- **Qwen2.5-Coder-1.5B-Instruct** ([Apache 2.0](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct)) → Code generation, instruction following, structured output
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ Limitations
|
||||||
|
|
||||||
|
- **1.5B parameter scale** — not competitive with 7B+ models on knowledge-heavy tasks
|
||||||
|
- **Knowledge cutoff** — inherits limitations from source model training data
|
||||||
|
- **No multimodal** — text-only model
|
||||||
|
- **Evaluations pending** — benchmark scores shown are estimates based on source model performance; independent evaluation is recommended
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Citation
|
||||||
|
|
||||||
|
```bibtex
|
||||||
|
@software{myth-1.5b,
|
||||||
|
author = {dracko14},
|
||||||
|
title = {MYTH-1.5B: A SLERP-Fused Reasoning and Coding Model},
|
||||||
|
year = {2026},
|
||||||
|
url = {https://huggingface.co/dracko14/MYTH-1.5B}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🙏 Acknowledgements
|
||||||
|
|
||||||
|
- [DeepSeek](https://deepseek.com/) for the R1 distillation models
|
||||||
|
- [Qwen Team (Alibaba)](https://qwenlm.github.io/) for the Qwen2.5-Coder models
|
||||||
|
- Anthropic's Claude for the system prompt design philosophy
|
||||||
|
- The open-source ML community for safetensors, transformers, and llama.cpp
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<i>"Three forces, one entity — Myth"</i>
|
||||||
|
</div>
|
||||||
BIN
benchmark-bars.png
Normal file
BIN
benchmark-bars.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
3
capability-radar.png
Normal file
3
capability-radar.png
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:191c76ae09c594de7915e63e21757a9a24063a675532fb0c376a4fdf23ba7639
|
||||||
|
size 252200
|
||||||
59
config.json
Normal file
59
config.json
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"Qwen2ForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 151643,
|
||||||
|
"dtype": "bfloat16",
|
||||||
|
"eos_token_id": 151643,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 1536,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 8960,
|
||||||
|
"layer_types": [
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention",
|
||||||
|
"full_attention"
|
||||||
|
],
|
||||||
|
"max_position_embeddings": 131072,
|
||||||
|
"max_window_layers": 21,
|
||||||
|
"model_type": "qwen2",
|
||||||
|
"num_attention_heads": 12,
|
||||||
|
"num_hidden_layers": 28,
|
||||||
|
"num_key_value_heads": 2,
|
||||||
|
"rms_norm_eps": 1e-06,
|
||||||
|
"rope_scaling": null,
|
||||||
|
"rope_theta": 10000,
|
||||||
|
"sliding_window": null,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"transformers_version": "4.57.6",
|
||||||
|
"use_cache": true,
|
||||||
|
"use_mrope": false,
|
||||||
|
"use_sliding_window": false,
|
||||||
|
"vocab_size": 151936
|
||||||
|
}
|
||||||
3
fusion-diagram.png
Normal file
3
fusion-diagram.png
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:62feb28831272184ccec8759f7fe3a68ef534aa2f684d5bfb489caa7cf105d03
|
||||||
|
size 106816
|
||||||
14
mergekit_config.yml
Normal file
14
mergekit_config.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
slices:
|
||||||
|
- sources:
|
||||||
|
- model: /root/model-step1
|
||||||
|
layer_range: [0, 28]
|
||||||
|
- model: Qwen/Qwen2.5-Math-1.5B-Instruct
|
||||||
|
layer_range: [0, 28]
|
||||||
|
merge_method: slerp
|
||||||
|
base_model: /root/model-step1
|
||||||
|
dtype: bfloat16
|
||||||
|
parameters:
|
||||||
|
t:
|
||||||
|
- filter: self_attn
|
||||||
|
value: [0.6, 0.4]
|
||||||
|
- value: [0.5, 0.5]
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:d63cf27f4546bb3dbc62d98b8f4f6c32da2a384473df9e98083889f08a7e5529
|
||||||
|
size 3554214752
|
||||||
BIN
size-vs-performance.png
Normal file
BIN
size-vs-performance.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
303282
tokenizer.json
Normal file
303282
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
35
tokenizer_config.json
Normal file
35
tokenizer_config.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"add_bos_token": true,
|
||||||
|
"add_eos_token": false,
|
||||||
|
"bos_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<|begin▁of▁sentence|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<|end▁of▁sentence|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"legacy": true,
|
||||||
|
"model_max_length": 16384,
|
||||||
|
"pad_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<|end▁of▁sentence|>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"unk_token": null,
|
||||||
|
"tokenizer_class": "LlamaTokenizerFast",
|
||||||
|
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user