Text Generation
Transformers
Safetensors
qwen3
Generated from Trainer
trl
sft
conversational
text-generation-inference
Instructions to use cs-552-2026-the-transformers/math_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-the-transformers/math_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-the-transformers/math_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-the-transformers/math_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-the-transformers/math_model", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cs-552-2026-the-transformers/math_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-the-transformers/math_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-the-transformers/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-the-transformers/math_model
- SGLang
How to use cs-552-2026-the-transformers/math_model 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 "cs-552-2026-the-transformers/math_model" \ --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": "cs-552-2026-the-transformers/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "cs-552-2026-the-transformers/math_model" \ --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": "cs-552-2026-the-transformers/math_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-the-transformers/math_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-the-transformers/math_model
Automated MNLP evaluation report (2026-05-23)
#1
by zechen-nlp - opened
- EVAL_REPORT.md +87 -0
- README.md +14 -13
- chat_template.jinja +1 -5
- checkpoint-125/chat_template.jinja +89 -0
- checkpoint-125/config.json +63 -0
- checkpoint-125/generation_config.json +12 -0
- checkpoint-125/model.safetensors +3 -0
- checkpoint-125/optimizer.pt +3 -0
- checkpoint-125/rng_state.pth +3 -0
- checkpoint-125/scheduler.pt +3 -0
- checkpoint-125/tokenizer.json +3 -0
- checkpoint-125/tokenizer_config.json +30 -0
- checkpoint-125/trainer_state.json +154 -0
- checkpoint-125/training_args.bin +3 -0
- config.json +1 -1
- generation_config.json +2 -3
- model.safetensors +1 -1
- tokenizer_config.json +1 -1
- training_args.bin +3 -0
EVAL_REPORT.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Automated MNLP evaluation report
|
| 2 |
+
|
| 3 |
+
- **Model repo:** [`cs-552-2026-the-transformers/math_model`](https://huggingface.co/cs-552-2026-the-transformers/math_model)
|
| 4 |
+
- **Owner(s):** group **the-transformers**
|
| 5 |
+
- **Generated at:** 2026-05-23T14:37:35+00:00 (UTC)
|
| 6 |
+
- **Pipeline:** [mnlp-project-ci](https://github.com/eric11eca/mnlp-project-ci)
|
| 7 |
+
|
| 8 |
+
_This PR is opened automatically by the course CI. It is **non-blocking** — you do not need to merge it. The next nightly run will refresh this file._
|
| 9 |
+
|
| 10 |
+
## Summary
|
| 11 |
+
|
| 12 |
+
| Benchmark | Accuracy | Status |
|
| 13 |
+
|---|---:|---|
|
| 14 |
+
| Math | 0.3600 | ok |
|
| 15 |
+
| Knowledge | — | not run |
|
| 16 |
+
| Multilingual | — | not run |
|
| 17 |
+
| Safety | — | not run |
|
| 18 |
+
|
| 19 |
+
## Sample completions
|
| 20 |
+
|
| 21 |
+
_Prompts are intentionally omitted to avoid revealing benchmark contents. For multi-completion problems, only one completion is shown per sample._
|
| 22 |
+
|
| 23 |
+
### Math
|
| 24 |
+
|
| 25 |
+
**Correct** (1 shown)
|
| 26 |
+
|
| 27 |
+
- **reference**: `194`
|
| 28 |
+
- **overall** (3/8 completions correct)
|
| 29 |
+
- **extracted** (✓): `194`
|
| 30 |
+
- **completion**:
|
| 31 |
+
|
| 32 |
+
```text
|
| 33 |
+
<think>
|
| 34 |
+
To solve this problem, we need to understand the conditions under which a \(194 \times 194\) board can be tiled with \(1 \times 2\) and \(2 \times 1\) dominoes, and how marking cells affects this tiling.
|
| 35 |
+
|
| 36 |
+
First, we note that a \(194 \times 194\) board has an area of \(194^2 = 37636\) cells. Each domino covers exactly 2 cells, so the number of dominoes required to tile the board is \(37636
|
| 37 |
+
|
| 38 |
+
... [truncated 147 chars] ...
|
| 39 |
+
|
| 40 |
+
ontains at most one marked cell. This means that the marked cells can be placed in such a way that no two marked cells are in the same domino.
|
| 41 |
+
|
| 42 |
+
To find the minimum number of marked cells, we need to consider the maximum number of dominoes that can be placed such that no two marked cells are in the same domino. This is equivalent to placing the marked cells in such a way that they are not in the same row or column, as dominoes span two rows and two columns.
|
| 43 |
+
|
| 44 |
+
If we place a marked cell in each row and each column, we can ensure that no two marked cells are in the same row or column. This is similar to placing non-attacking rooks on a chessboard, where no two rooks attack each other.
|
| 45 |
+
|
| 46 |
+
For a \(194 \times 194\) board, the maximum number of non-attacking rooks we can place is 194 (one per row and one per column). Therefore, the minimum number of marked cells required to ensure that no two marked cells are in the same row or column is 194.
|
| 47 |
+
|
| 48 |
+
Thus, the least positive integer \(k\) for which one can choose \(k\) cells to mark so that there is exactly one tiling of the board by \(1 \times 2\) and \(2 \times 1\) dominoes in which every domino contains at most one marked cell is \(\boxed{194}\).
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
**Incorrect** (1 shown)
|
| 52 |
+
|
| 53 |
+
- **reference**: `$g(x)=c, g(x)=\lceil x \rceil, g(x)=\lfloor x \rfloor$`
|
| 54 |
+
- **overall** (0/8 completions correct)
|
| 55 |
+
- **extracted** (✗): `h(x) = c \text{ for all } x \in \mathbb{Q} \text{ and some } c \in \mathbb{Z}`
|
| 56 |
+
- **completion**:
|
| 57 |
+
|
| 58 |
+
```text
|
| 59 |
+
<think>
|
| 60 |
+
Given the problem, we need to find all mappings $h:\mathbb{Q}\to\mathbb{Z}$ such that for every $x\in\mathbb{Q}$, every $a\in\mathbb{Z}$, and every positive integer $b$, the following equation holds:
|
| 61 |
+
\[
|
| 62 |
+
h(x)=h\!\left(\frac{h(bx-a)+a}{b}\right).
|
| 63 |
+
\]
|
| 64 |
+
|
| 65 |
+
First, we can simplify the given equation by setting $x=0$. Substituting $x=0$ into the equation, we get:
|
| 66 |
+
\[
|
| 67 |
+
h(0) = h\!\left(\frac{h(0-a)+a}{b}
|
| 68 |
+
|
| 69 |
+
... [truncated 371 chars] ...
|
| 70 |
+
|
| 71 |
+
r all $a$ and $b$. Therefore, $h$ must be constant on the set of all rational numbers. Let's denote this constant value by $c$. So, we have:
|
| 72 |
+
\[
|
| 73 |
+
h(x) = c \quad \text{for all} \quad x \in \mathbb{Q}.
|
| 74 |
+
\]
|
| 75 |
+
Now, we need to check if this constant function satisfies the given equation. Substituting $h(x) = c$ into the original equation, we get:
|
| 76 |
+
\[
|
| 77 |
+
c = c \quad \text{which is true for all} \quad c \in \mathbb{Z}.
|
| 78 |
+
\]
|
| 79 |
+
Thus, the constant function $h(x) = c$ for all $x \in \mathbb{Q}$ is a solution. To confirm that this is the only solution, we need to ensure that no other functions can satisfy the given equation. Suppose there exists a non-constant function $h$ that satisfies the equation. Then, there must exist some $x$ for which $h(x) \neq c$. However, the condition $h(x) = h\!\left(\frac{h(bx-a)+a}{b}\right)$ must hold for all $x$, $a$, and $b$, and since $h$ is constant on all rational numbers, this condition can only be satisfied if $h$ is constant. Therefore, the only possible solution is the constant function $h(x) = c$ for all $x \in \mathbb{Q}$.
|
| 80 |
+
|
| 81 |
+
Hence, the solution to the problem is:
|
| 82 |
+
\[
|
| 83 |
+
</think>
|
| 84 |
+
|
| 85 |
+
\boxed{h(x) = c \text{ for all } x \in \mathbb{Q} \text{ and some } c \in \mathbb{Z}}.
|
| 86 |
+
\]
|
| 87 |
+
```
|
README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
| 1 |
---
|
| 2 |
base_model: Qwen/Qwen3-1.7B
|
| 3 |
library_name: transformers
|
|
|
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
| 6 |
-
- trl
|
| 7 |
- sft
|
|
|
|
| 8 |
licence: license
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
| 12 |
|
| 13 |
This model is a fine-tuned version of [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B).
|
| 14 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
@@ -19,22 +20,23 @@ It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
| 19 |
from transformers import pipeline
|
| 20 |
|
| 21 |
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 22 |
-
generator = pipeline("text-generation", model="
|
| 23 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 24 |
print(output["generated_text"])
|
| 25 |
```
|
| 26 |
|
| 27 |
## Training procedure
|
| 28 |
|
| 29 |
-
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
This model was trained with SFT.
|
| 33 |
|
| 34 |
### Framework versions
|
| 35 |
|
| 36 |
-
- TRL:
|
| 37 |
-
- Transformers: 5.
|
| 38 |
- Pytorch: 2.10.0+cu128
|
| 39 |
- Datasets: 4.8.5
|
| 40 |
- Tokenizers: 0.22.2
|
|
@@ -46,12 +48,11 @@ This model was trained with SFT.
|
|
| 46 |
Cite TRL as:
|
| 47 |
|
| 48 |
```bibtex
|
| 49 |
-
@
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 56 |
}
|
| 57 |
```
|
|
|
|
| 1 |
---
|
| 2 |
base_model: Qwen/Qwen3-1.7B
|
| 3 |
library_name: transformers
|
| 4 |
+
model_name: math_sft_test
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
| 7 |
- sft
|
| 8 |
+
- trl
|
| 9 |
licence: license
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Model Card for math_sft_test
|
| 13 |
|
| 14 |
This model is a fine-tuned version of [Qwen/Qwen3-1.7B](https://huggingface.co/Qwen/Qwen3-1.7B).
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
|
|
| 20 |
from transformers import pipeline
|
| 21 |
|
| 22 |
question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
|
| 23 |
+
generator = pipeline("text-generation", model="None", device="cuda")
|
| 24 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
print(output["generated_text"])
|
| 26 |
```
|
| 27 |
|
| 28 |
## Training procedure
|
| 29 |
|
| 30 |
+
|
| 31 |
+
|
| 32 |
|
| 33 |
|
| 34 |
This model was trained with SFT.
|
| 35 |
|
| 36 |
### Framework versions
|
| 37 |
|
| 38 |
+
- TRL: 1.3.0
|
| 39 |
+
- Transformers: 5.7.0
|
| 40 |
- Pytorch: 2.10.0+cu128
|
| 41 |
- Datasets: 4.8.5
|
| 42 |
- Tokenizers: 0.22.2
|
|
|
|
| 48 |
Cite TRL as:
|
| 49 |
|
| 50 |
```bibtex
|
| 51 |
+
@software{vonwerra2020trl,
|
| 52 |
+
title = {{TRL: Transformers Reinforcement Learning}},
|
| 53 |
+
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
|
| 54 |
+
license = {Apache-2.0},
|
| 55 |
+
url = {https://github.com/huggingface/trl},
|
| 56 |
+
year = {2020}
|
|
|
|
| 57 |
}
|
| 58 |
```
|
chat_template.jinja
CHANGED
|
@@ -10,13 +10,9 @@
|
|
| 10 |
{%- endfor %}
|
| 11 |
{{- "\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" }}
|
| 12 |
{%- else %}
|
| 13 |
-
{#- BOXING INSTRUCTION injected so it is present even when the caller (e.g. CI)
|
| 14 |
-
passes no system message. Targets our no-box / multi-box failure mode. #}
|
| 15 |
-
{{- '<|im_start|>system\n' }}
|
| 16 |
{%- if messages[0].role == 'system' %}
|
| 17 |
-
{{- messages[0].content + '\n
|
| 18 |
{%- endif %}
|
| 19 |
-
{{- 'When solving a math problem, work through it step by step and write your final answer inside a \boxed{...}.<|im_end|>\n' }}
|
| 20 |
{%- endif %}
|
| 21 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 22 |
{%- for message in messages[::-1] %}
|
|
|
|
| 10 |
{%- endfor %}
|
| 11 |
{{- "\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" }}
|
| 12 |
{%- else %}
|
|
|
|
|
|
|
|
|
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
{%- endif %}
|
|
|
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
checkpoint-125/chat_template.jinja
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# 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>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\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" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
+
{%- for message in messages %}
|
| 26 |
+
{%- if message.content is string %}
|
| 27 |
+
{%- set content = message.content %}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{%- set content = '' %}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
+
{%- elif message.role == "assistant" %}
|
| 34 |
+
{%- set reasoning_content = '' %}
|
| 35 |
+
{%- if message.reasoning_content is string %}
|
| 36 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
+
{%- else %}
|
| 38 |
+
{%- if '</think>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 44 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 45 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 46 |
+
{%- else %}
|
| 47 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- else %}
|
| 50 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{%- if message.tool_calls %}
|
| 53 |
+
{%- for tool_call in message.tool_calls %}
|
| 54 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 55 |
+
{{- '\n' }}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tool_call.function %}
|
| 58 |
+
{%- set tool_call = tool_call.function %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 61 |
+
{{- tool_call.name }}
|
| 62 |
+
{{- '", "arguments": ' }}
|
| 63 |
+
{%- if tool_call.arguments is string %}
|
| 64 |
+
{{- tool_call.arguments }}
|
| 65 |
+
{%- else %}
|
| 66 |
+
{{- tool_call.arguments | tojson }}
|
| 67 |
+
{%- endif %}
|
| 68 |
+
{{- '}\n</tool_call>' }}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{%- endif %}
|
| 71 |
+
{{- '<|im_end|>\n' }}
|
| 72 |
+
{%- elif message.role == "tool" %}
|
| 73 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
+
{{- '<|im_start|>user' }}
|
| 75 |
+
{%- endif %}
|
| 76 |
+
{{- '\n<tool_response>\n' }}
|
| 77 |
+
{{- content }}
|
| 78 |
+
{{- '\n</tool_response>' }}
|
| 79 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
+
{{- '<|im_end|>\n' }}
|
| 81 |
+
{%- endif %}
|
| 82 |
+
{%- endif %}
|
| 83 |
+
{%- endfor %}
|
| 84 |
+
{%- if add_generation_prompt %}
|
| 85 |
+
{{- '<|im_start|>assistant\n' }}
|
| 86 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 87 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 88 |
+
{%- endif %}
|
| 89 |
+
{%- endif %}
|
checkpoint-125/config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": null,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 151645,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 2048,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 6144,
|
| 15 |
+
"layer_types": [
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention"
|
| 44 |
+
],
|
| 45 |
+
"max_position_embeddings": 40960,
|
| 46 |
+
"max_window_layers": 28,
|
| 47 |
+
"model_type": "qwen3",
|
| 48 |
+
"num_attention_heads": 16,
|
| 49 |
+
"num_hidden_layers": 28,
|
| 50 |
+
"num_key_value_heads": 8,
|
| 51 |
+
"pad_token_id": 151643,
|
| 52 |
+
"rms_norm_eps": 1e-06,
|
| 53 |
+
"rope_parameters": {
|
| 54 |
+
"rope_theta": 1000000,
|
| 55 |
+
"rope_type": "default"
|
| 56 |
+
},
|
| 57 |
+
"sliding_window": null,
|
| 58 |
+
"tie_word_embeddings": true,
|
| 59 |
+
"transformers_version": "5.7.0",
|
| 60 |
+
"use_cache": false,
|
| 61 |
+
"use_sliding_window": false,
|
| 62 |
+
"vocab_size": 151936
|
| 63 |
+
}
|
checkpoint-125/generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_sample": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
151645,
|
| 5 |
+
151643
|
| 6 |
+
],
|
| 7 |
+
"pad_token_id": 151643,
|
| 8 |
+
"temperature": 0.6,
|
| 9 |
+
"top_k": 20,
|
| 10 |
+
"top_p": 0.95,
|
| 11 |
+
"transformers_version": "5.7.0"
|
| 12 |
+
}
|
checkpoint-125/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7074b51b321535051b77436f30720111854403259c583a273488e061c0d23072
|
| 3 |
+
size 3441185608
|
checkpoint-125/optimizer.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b569f0710425a088cc5cd95c2def7bbb89539cdd1c3b41312c8d8fc136d2e186
|
| 3 |
+
size 6882572207
|
checkpoint-125/rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61c19bab1174704a4a4441475683bf1270277af15d2e2c95e964789128e482c4
|
| 3 |
+
size 14645
|
checkpoint-125/scheduler.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:770e85488b2d6f2b41a590e6c2bb599f3a174081e14b8c48d3638681b4a06597
|
| 3 |
+
size 1465
|
checkpoint-125/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
|
| 3 |
+
size 11422650
|
checkpoint-125/tokenizer_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"is_local": false,
|
| 24 |
+
"local_files_only": false,
|
| 25 |
+
"model_max_length": 131072,
|
| 26 |
+
"pad_token": "<|endoftext|>",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null
|
| 30 |
+
}
|
checkpoint-125/trainer_state.json
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_global_step": null,
|
| 3 |
+
"best_metric": null,
|
| 4 |
+
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 1.0,
|
| 6 |
+
"eval_steps": 500,
|
| 7 |
+
"global_step": 125,
|
| 8 |
+
"is_hyper_param_search": false,
|
| 9 |
+
"is_local_process_zero": true,
|
| 10 |
+
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [
|
| 12 |
+
{
|
| 13 |
+
"entropy": 0.2860680317506194,
|
| 14 |
+
"epoch": 0.08,
|
| 15 |
+
"grad_norm": 7.46875,
|
| 16 |
+
"learning_rate": 1.5000000000000002e-05,
|
| 17 |
+
"loss": 0.7724831104278564,
|
| 18 |
+
"mean_token_accuracy": 0.8434554561972618,
|
| 19 |
+
"num_tokens": 94518.0,
|
| 20 |
+
"step": 10
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"entropy": 0.3743372498080134,
|
| 24 |
+
"epoch": 0.16,
|
| 25 |
+
"grad_norm": 2.6875,
|
| 26 |
+
"learning_rate": 1.8761061946902657e-05,
|
| 27 |
+
"loss": 0.4372231483459473,
|
| 28 |
+
"mean_token_accuracy": 0.8732902690768242,
|
| 29 |
+
"num_tokens": 187445.0,
|
| 30 |
+
"step": 20
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"entropy": 0.3575092004612088,
|
| 34 |
+
"epoch": 0.24,
|
| 35 |
+
"grad_norm": 2.625,
|
| 36 |
+
"learning_rate": 1.6991150442477876e-05,
|
| 37 |
+
"loss": 0.3412153959274292,
|
| 38 |
+
"mean_token_accuracy": 0.8936023108661175,
|
| 39 |
+
"num_tokens": 280610.0,
|
| 40 |
+
"step": 30
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"entropy": 0.31294157058000566,
|
| 44 |
+
"epoch": 0.32,
|
| 45 |
+
"grad_norm": 2.421875,
|
| 46 |
+
"learning_rate": 1.5221238938053098e-05,
|
| 47 |
+
"loss": 0.3175334453582764,
|
| 48 |
+
"mean_token_accuracy": 0.8971926532685757,
|
| 49 |
+
"num_tokens": 379577.0,
|
| 50 |
+
"step": 40
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"entropy": 0.30759106744080783,
|
| 54 |
+
"epoch": 0.4,
|
| 55 |
+
"grad_norm": 1.7421875,
|
| 56 |
+
"learning_rate": 1.345132743362832e-05,
|
| 57 |
+
"loss": 0.32603118419647215,
|
| 58 |
+
"mean_token_accuracy": 0.8967837899923324,
|
| 59 |
+
"num_tokens": 477577.0,
|
| 60 |
+
"step": 50
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"entropy": 0.31574366632848977,
|
| 64 |
+
"epoch": 0.48,
|
| 65 |
+
"grad_norm": 1.9921875,
|
| 66 |
+
"learning_rate": 1.1681415929203541e-05,
|
| 67 |
+
"loss": 0.323792552947998,
|
| 68 |
+
"mean_token_accuracy": 0.8988608829677105,
|
| 69 |
+
"num_tokens": 573360.0,
|
| 70 |
+
"step": 60
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"entropy": 0.3065364420413971,
|
| 74 |
+
"epoch": 0.56,
|
| 75 |
+
"grad_norm": 1.6171875,
|
| 76 |
+
"learning_rate": 9.911504424778762e-06,
|
| 77 |
+
"loss": 0.32266840934753416,
|
| 78 |
+
"mean_token_accuracy": 0.8985385209321975,
|
| 79 |
+
"num_tokens": 665761.0,
|
| 80 |
+
"step": 70
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"entropy": 0.27206654362380506,
|
| 84 |
+
"epoch": 0.64,
|
| 85 |
+
"grad_norm": 2.1875,
|
| 86 |
+
"learning_rate": 8.141592920353984e-06,
|
| 87 |
+
"loss": 0.2854612350463867,
|
| 88 |
+
"mean_token_accuracy": 0.9085792370140553,
|
| 89 |
+
"num_tokens": 756921.0,
|
| 90 |
+
"step": 80
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"entropy": 0.28962985165417193,
|
| 94 |
+
"epoch": 0.72,
|
| 95 |
+
"grad_norm": 1.8125,
|
| 96 |
+
"learning_rate": 6.371681415929204e-06,
|
| 97 |
+
"loss": 0.29041600227355957,
|
| 98 |
+
"mean_token_accuracy": 0.9059965394437313,
|
| 99 |
+
"num_tokens": 845171.0,
|
| 100 |
+
"step": 90
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"entropy": 0.2753044681623578,
|
| 104 |
+
"epoch": 0.8,
|
| 105 |
+
"grad_norm": 2.09375,
|
| 106 |
+
"learning_rate": 4.6017699115044254e-06,
|
| 107 |
+
"loss": 0.2797576427459717,
|
| 108 |
+
"mean_token_accuracy": 0.9101039692759514,
|
| 109 |
+
"num_tokens": 939550.0,
|
| 110 |
+
"step": 100
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"entropy": 0.2808386910706758,
|
| 114 |
+
"epoch": 0.88,
|
| 115 |
+
"grad_norm": 1.5859375,
|
| 116 |
+
"learning_rate": 2.831858407079646e-06,
|
| 117 |
+
"loss": 0.2893812894821167,
|
| 118 |
+
"mean_token_accuracy": 0.9063553236424923,
|
| 119 |
+
"num_tokens": 1041441.0,
|
| 120 |
+
"step": 110
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"entropy": 0.2944059643894434,
|
| 124 |
+
"epoch": 0.96,
|
| 125 |
+
"grad_norm": 1.6875,
|
| 126 |
+
"learning_rate": 1.0619469026548673e-06,
|
| 127 |
+
"loss": 0.2996867895126343,
|
| 128 |
+
"mean_token_accuracy": 0.9011975660920143,
|
| 129 |
+
"num_tokens": 1132794.0,
|
| 130 |
+
"step": 120
|
| 131 |
+
}
|
| 132 |
+
],
|
| 133 |
+
"logging_steps": 10,
|
| 134 |
+
"max_steps": 125,
|
| 135 |
+
"num_input_tokens_seen": 0,
|
| 136 |
+
"num_train_epochs": 1,
|
| 137 |
+
"save_steps": 500,
|
| 138 |
+
"stateful_callbacks": {
|
| 139 |
+
"TrainerControl": {
|
| 140 |
+
"args": {
|
| 141 |
+
"should_epoch_stop": false,
|
| 142 |
+
"should_evaluate": false,
|
| 143 |
+
"should_log": false,
|
| 144 |
+
"should_save": true,
|
| 145 |
+
"should_training_stop": true
|
| 146 |
+
},
|
| 147 |
+
"attributes": {}
|
| 148 |
+
}
|
| 149 |
+
},
|
| 150 |
+
"total_flos": 1.2589656731283456e+16,
|
| 151 |
+
"train_batch_size": 2,
|
| 152 |
+
"trial_name": null,
|
| 153 |
+
"trial_params": null
|
| 154 |
+
}
|
checkpoint-125/training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4e0921a533d54992c732b7cf0c8a29ef97e50bbd333d4e4c07ae7183a1feb0f
|
| 3 |
+
size 5713
|
config.json
CHANGED
|
@@ -56,7 +56,7 @@
|
|
| 56 |
},
|
| 57 |
"sliding_window": null,
|
| 58 |
"tie_word_embeddings": true,
|
| 59 |
-
"transformers_version": "5.
|
| 60 |
"use_cache": false,
|
| 61 |
"use_sliding_window": false,
|
| 62 |
"vocab_size": 151936
|
|
|
|
| 56 |
},
|
| 57 |
"sliding_window": null,
|
| 58 |
"tie_word_embeddings": true,
|
| 59 |
+
"transformers_version": "5.7.0",
|
| 60 |
"use_cache": false,
|
| 61 |
"use_sliding_window": false,
|
| 62 |
"vocab_size": 151936
|
generation_config.json
CHANGED
|
@@ -6,9 +6,8 @@
|
|
| 6 |
151643
|
| 7 |
],
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
-
"temperature": 0.
|
| 10 |
-
"top_p": 0.95,
|
| 11 |
"top_k": 20,
|
| 12 |
-
"
|
| 13 |
"transformers_version": "4.51.0"
|
| 14 |
}
|
|
|
|
| 6 |
151643
|
| 7 |
],
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
+
"temperature": 0.6,
|
|
|
|
| 10 |
"top_k": 20,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
"transformers_version": "4.51.0"
|
| 13 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3441185608
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7074b51b321535051b77436f30720111854403259c583a273488e061c0d23072
|
| 3 |
size 3441185608
|
tokenizer_config.json
CHANGED
|
@@ -27,5 +27,5 @@
|
|
| 27 |
"split_special_tokens": false,
|
| 28 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
"unk_token": null,
|
| 30 |
-
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {
|
| 31 |
}
|
|
|
|
| 27 |
"split_special_tokens": false,
|
| 28 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
"unk_token": null,
|
| 30 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}"
|
| 31 |
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4e0921a533d54992c732b7cf0c8a29ef97e50bbd333d4e4c07ae7183a1feb0f
|
| 3 |
+
size 5713
|