初始化项目,由ModelHub XC社区提供模型

Model: fableforge-ai/ShellWhisperer-1.5B
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-14 09:43:09 +08:00
commit 975462289f
22 changed files with 555 additions and 0 deletions

48
.gitattributes vendored Normal file
View File

@@ -0,0 +1,48 @@
*.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
tokenizer.json filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-f16.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-IQ4_XS.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-IQ2_XXS.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-IQ3_XXS.gguf filter=lfs diff=lfs merge=lfs -text
shellwhisperer-1.5b-IQ1_S.gguf filter=lfs diff=lfs merge=lfs -text

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 FableForge Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

102
README.md Normal file
View File

@@ -0,0 +1,102 @@
---
license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- 1.5b
- commands
- devops
- fableforge
- gguf
- imatrix
- llama.cpp
- lm-studio
- ollama
- shell
- sysadmin
- terminal
- text-generation
- uncensored
---
# ShellWhisperer-1.5B
> **Natural language → precise bash commands. Tiny, fast, uncensored.**
[![Downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhuggingface.co%2Fapi%2Fmodels%2Ffableforge-ai%2FShellWhisperer-1.5B&query=downloads&label=downloads&color=blue)](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B) [![Demos](https://img.shields.io/badge/🤗-Live%20Demos-orange)](https://huggingface.co/spaces/fableforge-ai/fableforge-nexus)
Base model: [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) · Part of the **FableForge** ecosystem.
---
## ⚡ Quickest start — Ollama (these pulls credit the source, not a mirror)
```bash
ollama run hf.co/fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
```
## 🦙 llama.cpp
```bash
llama-cli -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M -p "Hello!"
```
## 💠 LM Studio
Search **`fableforge-ai/ShellWhisperer-1.5B`** and pick a quant below.
---
## 📦 Provided quants (download one file, not the whole repo)
| File | Quant | Size | Notes |
| ---- | ----- | ---- | ----- |
| [shellwhisperer-1.5b-f16.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-f16.gguf) | `F16` | 3.09 GB | Full precision (unquantized). Reference / conversion. |
| [shellwhisperer-1.5b-Q8_0.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q8_0.gguf) | `Q8_0` | 1.65 GB | Extremely high quality — usually overkill. |
| [shellwhisperer-1.5b-Q6_K.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q6_K.gguf) | `Q6_K` | 1.27 GB | Very high quality, near-perfect. **Recommended** if you have the RAM. |
| [shellwhisperer-1.5b-Q5_K_M.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q5_K_M.gguf) | `Q5_K_M` | 1.13 GB | High quality. **Recommended.** |
| [shellwhisperer-1.5b-Q4_K_M.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q4_K_M.gguf) | `Q4_K_M` | 0.99 GB | ⭐ **Best size/quality balance — default pick for most users.** |
| [shellwhisperer-1.5b-IQ4_XS.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-IQ4_XS.gguf) | `IQ4_XS` | 0.90 GB | imatrix — great quality, smaller than Q4_K_S. **Recommended for low RAM.** |
| [shellwhisperer-1.5b-Q4_0.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q4_0.gguf) | `Q4_0` | 0.93 GB | Legacy format — prefer Q4_K_M. |
| [shellwhisperer-1.5b-Q3_K_M.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q3_K_M.gguf) | `Q3_K_M` | 0.82 GB | Lower quality; usable when RAM is tight. |
| [shellwhisperer-1.5b-IQ3_XXS.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-IQ3_XXS.gguf) | `IQ3_XXS` | 0.67 GB | imatrix very low quality. |
| [shellwhisperer-1.5b-Q2_K.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-Q2_K.gguf) | `Q2_K` | 0.68 GB | Very low quality — surprisingly usable. |
| [shellwhisperer-1.5b-IQ2_XXS.gguf](https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B/blob/main/shellwhisperer-1.5b-IQ2_XXS.gguf) | `IQ2_XXS` | 0.51 GB | Tiny imatrix — last resort. |
**Not sure?** Take **`Q4_K_M`**. Low RAM → **`IQ4_XS`**. Max quality → **`Q6_K`**.
## 🧠 Prompt format (ChatML)
```
<|im_start|>system
{system_prompt}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
```
## 🌌 See it live — the FableForge demos
This family powers a galaxy of free, interactive HF Spaces:
- 🧭 [FableForge Nexus](https://huggingface.co/spaces/fableforge-ai/fableforge-nexus)
- 🍺 [Infinite NPC](https://huggingface.co/spaces/fableforge-ai/infinite-npc)
- 🎭 [Dual-GM](https://huggingface.co/spaces/King3Djbl/dual-gm-simulator)
- 💻 [ShellWhisperer](https://huggingface.co/spaces/King3Djbl/shellwhisperer-terminal)
- 👻 [Ghost Writer](https://huggingface.co/spaces/fableforge-ai/ghost-writer)
## Citation
```bibtex
@misc{shellwhisperer1.5b2024,
title={ShellWhisperer-1.5B: Agent Orchestration via Fine-Tuned Language Models},
author={FableForge Team},
year={2024},
url={https://huggingface.co/fableforge-ai/ShellWhisperer-1.5B}
}
```
---
*⭐ Like & share — it helps people find the source instead of a mirror.*

54
chat_template.jinja Normal file
View File

@@ -0,0 +1,54 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0]['role'] == 'system' %}
{{- messages[0]['content'] }}
{%- else %}
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
{%- endif %}
{{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
{%- else %}
{%- if messages[0]['role'] == 'system' %}
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
{%- else %}
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- for message in messages %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{{- '<|im_start|>' + message.role }}
{%- if message.content %}
{{- '\n' + message.content }}
{%- endif %}
{%- for tool_call in message.tool_calls %}
{%- if tool_call.function is defined %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '\n<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{{- tool_call.arguments | tojson }}
{{- '}\n</tool_call>' }}
{%- endfor %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- message.content }}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- endif %}

62
config.json Normal file
View File

@@ -0,0 +1,62 @@
{
"architectures": [
"Qwen2ForCausalLM"
],
"attention_dropout": 0.0,
"bos_token_id": null,
"torch_dtype": "float16",
"eos_token_id": 151645,
"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": 32768,
"max_window_layers": 21,
"model_type": "qwen2",
"num_attention_heads": 12,
"num_hidden_layers": 28,
"num_key_value_heads": 2,
"pad_token_id": 151665,
"rms_norm_eps": 1e-06,
"rope_parameters": {
"rope_theta": 1000000.0,
"rope_type": "default"
},
"sliding_window": null,
"tie_word_embeddings": true,
"unsloth_fixed": true,
"unsloth_version": "2026.6.7",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

14
generation_config.json Normal file
View File

@@ -0,0 +1,14 @@
{
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"max_length": 32768,
"pad_token_id": 151665,
"repetition_penalty": 1.1,
"temperature": 0.7,
"top_k": 20,
"top_p": 0.8,
"transformers_version": "5.5.0"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:730af213553ff0766ee13488fa19e9f239008ea047601074eb3156f2b1ac3121
size 3087467144

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ee6b4dcf07ff059c61be7d6e734721301b402253d13c2d7f488a3ec90bab4b5c
size 436527936

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:250e8f4b9f55122fbb0d56aa39c392aec9c3a4efcbff82ba5a3ee9daae2ff010
size 511017760

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3abc97c9fe6d9f19517da7e93695a7432a5b455b46091b0a2a8091dec6d02c1
size 668792608

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cd8247081554b38663c0af623efee9b700a5c9db0cf9fca48a594c4ae9086445
size 902182944

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4e4e5506105c332749227f4be1e123d008f7002a9d87940a238454b0dfefd58b
size 676304928

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bbdd46f907afac021a92dbf8d40ce1387b8267ba1dadaea349f4a755345a4bf3
size 824178720

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d9fd5971e426cf06ad5171c8b292109531dc2e1b3cee4a6251cb86ec7ca5d38d
size 934955040

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:893fd6a6d58eb99b57106edefb5f9f17a388031ac5f95f2f3ce9dd05b7a60f74
size 986048544

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3494d2177148bf3e5421cb6ffc7fc3642fbd051b50efc632738e85c69b08b233
size 1125050400

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b27c44f8dde343880d6b1672908a2e7489a4f6e524f98a7356d95eadf515c780
size 1272739872

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:48286c844bf93bac7dbb010fba32b8593d25c6aebb65b77f1b18715ca5007a8d
size 1646573088

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:54dd382a1add85b8c142c91f0e9977914199eb0c5ad50abab02b7d5378656999
size 3093669408

9
special_tokens_map.json Normal file
View File

@@ -0,0 +1,9 @@
{
"bos_token": "<s>",
"eos_token": "</s>",
"unk_token": "<unk>",
"pad_token": "<pad>",
"sep_token": "</s>",
"cls_token": "<s>",
"mask_token": "<mask>"
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:437cd47f197286ffa5b57e807b77a16970a0fb8befe1be29c56d65d0cd34379e
size 11422181

203
tokenizer_config.json Normal file
View File

@@ -0,0 +1,203 @@
{
"add_prefix_space": false,
"backend": "tokenizers",
"bos_token": null,
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": [],
"is_local": false,
"model_max_length": 32768,
"pad_token": "<|PAD_TOKEN|>",
"padding_side": "right",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": false
},
"151665": {
"content": "<|PAD_TOKEN|>",
"single_word": false,
"lstrip": false,
"rstrip": false,
"normalized": false,
"special": true
}
},
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n"
}