Add Stage 2 audit/Long-CoT LoRA + comprehensive model card
Browse files- .gitattributes +1 -0
- README.md +132 -0
- adapter_config.json +53 -0
- adapter_model.safetensors +3 -0
- chat_template.jinja +88 -0
- tokenizer.json +3 -0
- tokenizer_config.json +307 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* 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
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: samscrack/Qwopus3.6-27B-solidity-sft-stage1B
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: peft
|
| 7 |
+
tags:
|
| 8 |
+
- solidity
|
| 9 |
+
- smart-contracts
|
| 10 |
+
- security-audit
|
| 11 |
+
- long-cot
|
| 12 |
+
- reasoning
|
| 13 |
+
- chain-of-thought
|
| 14 |
+
- lora
|
| 15 |
+
- qlora
|
| 16 |
+
- peft
|
| 17 |
+
- blockchain
|
| 18 |
+
- ethereum
|
| 19 |
+
- sft
|
| 20 |
+
datasets:
|
| 21 |
+
- samscrack/solidity-audit-cot
|
| 22 |
+
pipeline_tag: text-generation
|
| 23 |
+
inference: false
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Qwopus3.6-27B-solidity-audit-stage2
|
| 27 |
+
|
| 28 |
+
> ⚠️ **Intermediate checkpoint — Stage 2 of 5.** This is the audit / Long-CoT reasoning LoRA, layered on top of the Stage 1B SFT base. **Not yet RFT-tuned** — Stage 3 (rejection-sampling fine-tuning against `forge test`) and the optional Stage 4 (GSPO RL with executor reward) come next.
|
| 29 |
+
|
| 30 |
+
A LoRA r=16 adapter on top of `Qwopus3.6-27B-solidity-sft1B-merged` (Stage 1B merged into bf16 base) that teaches the model to:
|
| 31 |
+
- read a Solidity contract end-to-end
|
| 32 |
+
- emit a long chain-of-thought (8-15 substantive paragraphs) in `<think>...</think>`
|
| 33 |
+
- output a structured finding (severity, category, location, description, impact, fix, confidence)
|
| 34 |
+
|
| 35 |
+
## Pipeline context
|
| 36 |
+
|
| 37 |
+
| # | Stage | Status | Output |
|
| 38 |
+
|---|---|---|---|
|
| 39 |
+
| 0 | Continued pretrain (DoRA on Solidity corpus) | ✅ done | [`Qwopus3.6-27B-solidity-cpt-stageA`](https://huggingface.co/samscrack/Qwopus3.6-27B-solidity-cpt-stageA) |
|
| 40 |
+
| 1 | SFT (instruction): spec → contract | ✅ done | [`Qwopus3.6-27B-solidity-sft-stage1B`](https://huggingface.co/samscrack/Qwopus3.6-27B-solidity-sft-stage1B) |
|
| 41 |
+
| **2** | **SFT (audit / Long-CoT reasoning)** | **✅ done — this repo** | this repo |
|
| 42 |
+
| 3 | RFT (rejection-sampling FT against `forge test`) | ⬜ planned | TBD |
|
| 43 |
+
| 4 | GSPO (sequence-level RL with executor reward) | ⬜ optional | TBD |
|
| 44 |
+
|
| 45 |
+
## Training data
|
| 46 |
+
|
| 47 |
+
- **Corpus**: [`samscrack/solidity-audit-cot`](https://huggingface.co/datasets/samscrack/solidity-audit-cot) — Long-CoT audit traces generated by Claude Opus 4.7 (adaptive thinking, xhigh effort) over real Solidity contracts.
|
| 48 |
+
- **Strict-quality cleaned**: 7,707 rows. **8K-friendly subset for this stage**: 6,140 rows (filtered to ≤30,000 chars total → fits in 8K ctx). The remaining 1,567 long-tail rows are preserved at [`audit_cot_clean_long_tailed.jsonl`] for a future longer-context Stage 2 re-run.
|
| 49 |
+
- **After ctx-filter at training time**: 6,106 rows (34 marginal rows dropped).
|
| 50 |
+
- **Severity distribution (full clean corpus)**: 33% high · 25% medium · 14% low · 14% informational · 14% none. The `none` rows are deliberate — they teach the model not to fabricate vulnerabilities.
|
| 51 |
+
|
| 52 |
+
Each row's user turn is the contract code with an "Audit this contract" instruction. The assistant turn is `<think>{12 reasoning paragraphs joined}</think>` followed by a structured finding rendered as markdown.
|
| 53 |
+
|
| 54 |
+
## Recipe (Stage 2 specifics, per SOTA-plan §2)
|
| 55 |
+
|
| 56 |
+
- **LoRA**: r=16, α=16, dropout=0 (smaller than Stage 1B's r=64 — layered on, not replacing)
|
| 57 |
+
- **Target modules**: `q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj, out_proj`
|
| 58 |
+
- **Trainable parameters**: 88,342,528 (~0.60% of effective 14.8B param count)
|
| 59 |
+
- **Quantization**: base loaded in 4-bit (BnB NF4); adapter weights bf16
|
| 60 |
+
- **Effective batch size**: 72 (4 per device × 9 grad accum × 2 GPUs)
|
| 61 |
+
- **Sequence length**: 8,192
|
| 62 |
+
- **Optimizer**: 8-bit AdamW, weight decay 0.001
|
| 63 |
+
- **Learning rate**: 1e-4 (half of Stage 1B's 2e-4 — finer adjustment on top of trained base)
|
| 64 |
+
- **Epochs**: 1
|
| 65 |
+
- **Total steps**: 85
|
| 66 |
+
- **Chat template**: `qwen3-thinking` (with `<think>` filled by real Opus-derived reasoning)
|
| 67 |
+
- **Loss masking**: `train_on_responses_only` (loss only on assistant tokens after `<|im_start|>assistant\n<think>`)
|
| 68 |
+
|
| 69 |
+
## Training metrics
|
| 70 |
+
|
| 71 |
+
- **Wall time**: 3h 48m
|
| 72 |
+
- **Train loss**: 1.21 (start) → ~0.99 (min) → 1.026 (final under linear decay)
|
| 73 |
+
- **Hardware**: 2× NVIDIA RTX PRO 6000 Blackwell Workstation Edition (96 GB each)
|
| 74 |
+
- **Distributed**: DDP via `torchrun --nproc-per-node=2`
|
| 75 |
+
- **Framework**: [Unsloth](https://github.com/unslothai/unsloth) 2026.4.7 with TRL 0.22.2
|
| 76 |
+
|
| 77 |
+
## Usage
|
| 78 |
+
|
| 79 |
+
```python
|
| 80 |
+
from peft import PeftModel
|
| 81 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 82 |
+
|
| 83 |
+
# Load the Stage-1B-merged base, then layer the Stage 2 LoRA
|
| 84 |
+
base = AutoModelForCausalLM.from_pretrained(
|
| 85 |
+
"samscrack/Qwopus3.6-27B-solidity-sft-stage1B", # merge with the CPT base first locally
|
| 86 |
+
torch_dtype="bfloat16", device_map="auto",
|
| 87 |
+
)
|
| 88 |
+
model = PeftModel.from_pretrained(base, "samscrack/Qwopus3.6-27B-solidity-audit-stage2")
|
| 89 |
+
tokenizer = AutoTokenizer.from_pretrained("samscrack/Qwopus3.6-27B-solidity-audit-stage2")
|
| 90 |
+
|
| 91 |
+
contract = open("MyContract.sol").read()
|
| 92 |
+
messages = [{"role": "user", "content":
|
| 93 |
+
"Audit the following Solidity contract for security issues. Identify the most "
|
| 94 |
+
"impactful vulnerability (or 'none' if the contract is clean), reason step-by-step "
|
| 95 |
+
"about your analysis, then output a structured finding with severity, category, "
|
| 96 |
+
"location, description, impact, and a concrete fix.\n\n"
|
| 97 |
+
f"```solidity\n{contract}\n```"}]
|
| 98 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 99 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 100 |
+
out = model.generate(**inputs, max_new_tokens=4096, do_sample=False)
|
| 101 |
+
print(tokenizer.decode(out[0], skip_special_tokens=False))
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
The output will contain a `<think>` block with multi-paragraph reasoning followed by a markdown audit report.
|
| 105 |
+
|
| 106 |
+
## Limitations
|
| 107 |
+
|
| 108 |
+
- **Single-finding output by design.** Each response identifies the one most-impactful issue. Multi-finding audits would require either prompting it to "find all issues" or running it with different temperatures and aggregating.
|
| 109 |
+
- **Synthetic teacher.** Reasoning style and breadth reflect Claude Opus 4.7's idiom. The model has been pushed in that direction; output quality is bounded by Opus's audit ceiling.
|
| 110 |
+
- **No `forge test` validation in the loss.** This stage uses next-token cross-entropy on Opus traces. Stage 3 RFT introduces test-pass as a reward signal — that's where functional correctness gets enforced.
|
| 111 |
+
- **Long contracts truncated.** Training set was filtered to contracts that fit in 8K tokens. Contracts >~7,500 tokens may produce shorter or less coherent reasoning at inference time.
|
| 112 |
+
- **Solidity ≥ 0.7 bias** (inherited from Stage 1B's strict pragma filter).
|
| 113 |
+
- **Findings can be wrong.** Like any synthetic-teacher SFT, this model can produce confident-sounding false positives (flagging non-bugs) or miss real issues. Use as a triage assistant, not a substitute for human audit review.
|
| 114 |
+
|
| 115 |
+
## Related artifacts
|
| 116 |
+
|
| 117 |
+
- **Stage 0 CPT**: [`samscrack/Qwopus3.6-27B-solidity-cpt-stageA`](https://huggingface.co/samscrack/Qwopus3.6-27B-solidity-cpt-stageA)
|
| 118 |
+
- **Stage 1 SFT**: [`samscrack/Qwopus3.6-27B-solidity-sft-stage1B`](https://huggingface.co/samscrack/Qwopus3.6-27B-solidity-sft-stage1B)
|
| 119 |
+
- **Training data**: [`samscrack/solidity-audit-cot`](https://huggingface.co/datasets/samscrack/solidity-audit-cot)
|
| 120 |
+
- **Eval set (held-out, must not train on)**: [`samscrack/solidity-eval-2026`](https://huggingface.co/datasets/samscrack/solidity-eval-2026)
|
| 121 |
+
|
| 122 |
+
## Citation
|
| 123 |
+
|
| 124 |
+
```bibtex
|
| 125 |
+
@misc{qwopus3-6-27b-solidity-audit-stage2-2026,
|
| 126 |
+
author = {samscrack},
|
| 127 |
+
title = {Qwopus3.6-27B-solidity-audit-stage2: Stage 2 audit/Long-CoT LoRA},
|
| 128 |
+
year = {2026},
|
| 129 |
+
publisher = {Hugging Face},
|
| 130 |
+
howpublished = {\url{https://huggingface.co/samscrack/Qwopus3.6-27B-solidity-audit-stage2}},
|
| 131 |
+
}
|
| 132 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": {
|
| 6 |
+
"base_model_class": "Qwen3_5ForCausalLM",
|
| 7 |
+
"parent_library": "transformers.models.qwen3_5.modeling_qwen3_5",
|
| 8 |
+
"unsloth_fixed": true
|
| 9 |
+
},
|
| 10 |
+
"base_model_name_or_path": "/home/sam/models/Qwopus3.6-27B-solidity-sft1B-merged",
|
| 11 |
+
"bias": "none",
|
| 12 |
+
"corda_config": null,
|
| 13 |
+
"ensure_weight_tying": false,
|
| 14 |
+
"eva_config": null,
|
| 15 |
+
"exclude_modules": null,
|
| 16 |
+
"fan_in_fan_out": false,
|
| 17 |
+
"inference_mode": true,
|
| 18 |
+
"init_lora_weights": true,
|
| 19 |
+
"layer_replication": null,
|
| 20 |
+
"layers_pattern": null,
|
| 21 |
+
"layers_to_transform": null,
|
| 22 |
+
"loftq_config": {},
|
| 23 |
+
"lora_alpha": 16,
|
| 24 |
+
"lora_bias": false,
|
| 25 |
+
"lora_dropout": 0,
|
| 26 |
+
"lora_ga_config": null,
|
| 27 |
+
"megatron_config": null,
|
| 28 |
+
"megatron_core": "megatron.core",
|
| 29 |
+
"modules_to_save": null,
|
| 30 |
+
"peft_type": "LORA",
|
| 31 |
+
"peft_version": "0.19.1",
|
| 32 |
+
"qalora_group_size": 16,
|
| 33 |
+
"r": 16,
|
| 34 |
+
"rank_pattern": {},
|
| 35 |
+
"revision": null,
|
| 36 |
+
"target_modules": [
|
| 37 |
+
"q_proj",
|
| 38 |
+
"up_proj",
|
| 39 |
+
"o_proj",
|
| 40 |
+
"down_proj",
|
| 41 |
+
"out_proj",
|
| 42 |
+
"k_proj",
|
| 43 |
+
"gate_proj",
|
| 44 |
+
"v_proj"
|
| 45 |
+
],
|
| 46 |
+
"target_parameters": null,
|
| 47 |
+
"task_type": "CAUSAL_LM",
|
| 48 |
+
"trainable_token_indices": null,
|
| 49 |
+
"use_bdlora": null,
|
| 50 |
+
"use_dora": false,
|
| 51 |
+
"use_qalora": false,
|
| 52 |
+
"use_rslora": false
|
| 53 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7db1175126b360e3d52ee60cf4850af52d6aa23fc2cc3bf599d124cea820f68c
|
| 3 |
+
size 353452160
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 86 |
+
<think>
|
| 87 |
+
' }}
|
| 88 |
+
{%- endif %}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61fe6e68b24ec2f38f237945aef10539c224fd626670c34273b66114ce707575
|
| 3 |
+
size 19989533
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"audio_bos_token": "<|audio_start|>",
|
| 4 |
+
"audio_eos_token": "<|audio_end|>",
|
| 5 |
+
"audio_token": "<|audio_pad|>",
|
| 6 |
+
"backend": "tokenizers",
|
| 7 |
+
"bos_token": null,
|
| 8 |
+
"clean_up_tokenization_spaces": false,
|
| 9 |
+
"eos_token": "<|im_end|>",
|
| 10 |
+
"errors": "replace",
|
| 11 |
+
"image_token": "<|image_pad|>",
|
| 12 |
+
"is_local": true,
|
| 13 |
+
"model_max_length": 262144,
|
| 14 |
+
"model_specific_special_tokens": {
|
| 15 |
+
"audio_bos_token": "<|audio_start|>",
|
| 16 |
+
"audio_eos_token": "<|audio_end|>",
|
| 17 |
+
"audio_token": "<|audio_pad|>",
|
| 18 |
+
"image_token": "<|image_pad|>",
|
| 19 |
+
"video_token": "<|video_pad|>",
|
| 20 |
+
"vision_bos_token": "<|vision_start|>",
|
| 21 |
+
"vision_eos_token": "<|vision_end|>"
|
| 22 |
+
},
|
| 23 |
+
"pad_token": "<|PAD_TOKEN|>",
|
| 24 |
+
"padding_side": "left",
|
| 25 |
+
"pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",
|
| 26 |
+
"processor_class": "Qwen3VLProcessor",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "TokenizersBackend",
|
| 29 |
+
"unk_token": null,
|
| 30 |
+
"video_token": "<|video_pad|>",
|
| 31 |
+
"vision_bos_token": "<|vision_start|>",
|
| 32 |
+
"vision_eos_token": "<|vision_end|>",
|
| 33 |
+
"added_tokens_decoder": {
|
| 34 |
+
"248044": {
|
| 35 |
+
"content": "<|endoftext|>",
|
| 36 |
+
"single_word": false,
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"rstrip": false,
|
| 39 |
+
"normalized": false,
|
| 40 |
+
"special": true
|
| 41 |
+
},
|
| 42 |
+
"248045": {
|
| 43 |
+
"content": "<|im_start|>",
|
| 44 |
+
"single_word": false,
|
| 45 |
+
"lstrip": false,
|
| 46 |
+
"rstrip": false,
|
| 47 |
+
"normalized": false,
|
| 48 |
+
"special": true
|
| 49 |
+
},
|
| 50 |
+
"248046": {
|
| 51 |
+
"content": "<|im_end|>",
|
| 52 |
+
"single_word": false,
|
| 53 |
+
"lstrip": false,
|
| 54 |
+
"rstrip": false,
|
| 55 |
+
"normalized": false,
|
| 56 |
+
"special": true
|
| 57 |
+
},
|
| 58 |
+
"248047": {
|
| 59 |
+
"content": "<|object_ref_start|>",
|
| 60 |
+
"single_word": false,
|
| 61 |
+
"lstrip": false,
|
| 62 |
+
"rstrip": false,
|
| 63 |
+
"normalized": false,
|
| 64 |
+
"special": true
|
| 65 |
+
},
|
| 66 |
+
"248048": {
|
| 67 |
+
"content": "<|object_ref_end|>",
|
| 68 |
+
"single_word": false,
|
| 69 |
+
"lstrip": false,
|
| 70 |
+
"rstrip": false,
|
| 71 |
+
"normalized": false,
|
| 72 |
+
"special": true
|
| 73 |
+
},
|
| 74 |
+
"248049": {
|
| 75 |
+
"content": "<|box_start|>",
|
| 76 |
+
"single_word": false,
|
| 77 |
+
"lstrip": false,
|
| 78 |
+
"rstrip": false,
|
| 79 |
+
"normalized": false,
|
| 80 |
+
"special": true
|
| 81 |
+
},
|
| 82 |
+
"248050": {
|
| 83 |
+
"content": "<|box_end|>",
|
| 84 |
+
"single_word": false,
|
| 85 |
+
"lstrip": false,
|
| 86 |
+
"rstrip": false,
|
| 87 |
+
"normalized": false,
|
| 88 |
+
"special": true
|
| 89 |
+
},
|
| 90 |
+
"248051": {
|
| 91 |
+
"content": "<|quad_start|>",
|
| 92 |
+
"single_word": false,
|
| 93 |
+
"lstrip": false,
|
| 94 |
+
"rstrip": false,
|
| 95 |
+
"normalized": false,
|
| 96 |
+
"special": true
|
| 97 |
+
},
|
| 98 |
+
"248052": {
|
| 99 |
+
"content": "<|quad_end|>",
|
| 100 |
+
"single_word": false,
|
| 101 |
+
"lstrip": false,
|
| 102 |
+
"rstrip": false,
|
| 103 |
+
"normalized": false,
|
| 104 |
+
"special": true
|
| 105 |
+
},
|
| 106 |
+
"248053": {
|
| 107 |
+
"content": "<|vision_start|>",
|
| 108 |
+
"single_word": false,
|
| 109 |
+
"lstrip": false,
|
| 110 |
+
"rstrip": false,
|
| 111 |
+
"normalized": false,
|
| 112 |
+
"special": true
|
| 113 |
+
},
|
| 114 |
+
"248054": {
|
| 115 |
+
"content": "<|vision_end|>",
|
| 116 |
+
"single_word": false,
|
| 117 |
+
"lstrip": false,
|
| 118 |
+
"rstrip": false,
|
| 119 |
+
"normalized": false,
|
| 120 |
+
"special": true
|
| 121 |
+
},
|
| 122 |
+
"248055": {
|
| 123 |
+
"content": "<|vision_pad|>",
|
| 124 |
+
"single_word": false,
|
| 125 |
+
"lstrip": false,
|
| 126 |
+
"rstrip": false,
|
| 127 |
+
"normalized": false,
|
| 128 |
+
"special": true
|
| 129 |
+
},
|
| 130 |
+
"248056": {
|
| 131 |
+
"content": "<|image_pad|>",
|
| 132 |
+
"single_word": false,
|
| 133 |
+
"lstrip": false,
|
| 134 |
+
"rstrip": false,
|
| 135 |
+
"normalized": false,
|
| 136 |
+
"special": true
|
| 137 |
+
},
|
| 138 |
+
"248057": {
|
| 139 |
+
"content": "<|video_pad|>",
|
| 140 |
+
"single_word": false,
|
| 141 |
+
"lstrip": false,
|
| 142 |
+
"rstrip": false,
|
| 143 |
+
"normalized": false,
|
| 144 |
+
"special": true
|
| 145 |
+
},
|
| 146 |
+
"248058": {
|
| 147 |
+
"content": "<tool_call>",
|
| 148 |
+
"single_word": false,
|
| 149 |
+
"lstrip": false,
|
| 150 |
+
"rstrip": false,
|
| 151 |
+
"normalized": false,
|
| 152 |
+
"special": false
|
| 153 |
+
},
|
| 154 |
+
"248059": {
|
| 155 |
+
"content": "</tool_call>",
|
| 156 |
+
"single_word": false,
|
| 157 |
+
"lstrip": false,
|
| 158 |
+
"rstrip": false,
|
| 159 |
+
"normalized": false,
|
| 160 |
+
"special": false
|
| 161 |
+
},
|
| 162 |
+
"248060": {
|
| 163 |
+
"content": "<|fim_prefix|>",
|
| 164 |
+
"single_word": false,
|
| 165 |
+
"lstrip": false,
|
| 166 |
+
"rstrip": false,
|
| 167 |
+
"normalized": false,
|
| 168 |
+
"special": false
|
| 169 |
+
},
|
| 170 |
+
"248061": {
|
| 171 |
+
"content": "<|fim_middle|>",
|
| 172 |
+
"single_word": false,
|
| 173 |
+
"lstrip": false,
|
| 174 |
+
"rstrip": false,
|
| 175 |
+
"normalized": false,
|
| 176 |
+
"special": false
|
| 177 |
+
},
|
| 178 |
+
"248062": {
|
| 179 |
+
"content": "<|fim_suffix|>",
|
| 180 |
+
"single_word": false,
|
| 181 |
+
"lstrip": false,
|
| 182 |
+
"rstrip": false,
|
| 183 |
+
"normalized": false,
|
| 184 |
+
"special": false
|
| 185 |
+
},
|
| 186 |
+
"248063": {
|
| 187 |
+
"content": "<|fim_pad|>",
|
| 188 |
+
"single_word": false,
|
| 189 |
+
"lstrip": false,
|
| 190 |
+
"rstrip": false,
|
| 191 |
+
"normalized": false,
|
| 192 |
+
"special": false
|
| 193 |
+
},
|
| 194 |
+
"248064": {
|
| 195 |
+
"content": "<|repo_name|>",
|
| 196 |
+
"single_word": false,
|
| 197 |
+
"lstrip": false,
|
| 198 |
+
"rstrip": false,
|
| 199 |
+
"normalized": false,
|
| 200 |
+
"special": false
|
| 201 |
+
},
|
| 202 |
+
"248065": {
|
| 203 |
+
"content": "<|file_sep|>",
|
| 204 |
+
"single_word": false,
|
| 205 |
+
"lstrip": false,
|
| 206 |
+
"rstrip": false,
|
| 207 |
+
"normalized": false,
|
| 208 |
+
"special": false
|
| 209 |
+
},
|
| 210 |
+
"248066": {
|
| 211 |
+
"content": "<tool_response>",
|
| 212 |
+
"single_word": false,
|
| 213 |
+
"lstrip": false,
|
| 214 |
+
"rstrip": false,
|
| 215 |
+
"normalized": false,
|
| 216 |
+
"special": false
|
| 217 |
+
},
|
| 218 |
+
"248067": {
|
| 219 |
+
"content": "</tool_response>",
|
| 220 |
+
"single_word": false,
|
| 221 |
+
"lstrip": false,
|
| 222 |
+
"rstrip": false,
|
| 223 |
+
"normalized": false,
|
| 224 |
+
"special": false
|
| 225 |
+
},
|
| 226 |
+
"248068": {
|
| 227 |
+
"content": "<think>",
|
| 228 |
+
"single_word": false,
|
| 229 |
+
"lstrip": false,
|
| 230 |
+
"rstrip": false,
|
| 231 |
+
"normalized": false,
|
| 232 |
+
"special": false
|
| 233 |
+
},
|
| 234 |
+
"248069": {
|
| 235 |
+
"content": "</think>",
|
| 236 |
+
"single_word": false,
|
| 237 |
+
"lstrip": false,
|
| 238 |
+
"rstrip": false,
|
| 239 |
+
"normalized": false,
|
| 240 |
+
"special": false
|
| 241 |
+
},
|
| 242 |
+
"248070": {
|
| 243 |
+
"content": "<|audio_start|>",
|
| 244 |
+
"single_word": false,
|
| 245 |
+
"lstrip": false,
|
| 246 |
+
"rstrip": false,
|
| 247 |
+
"normalized": false,
|
| 248 |
+
"special": true
|
| 249 |
+
},
|
| 250 |
+
"248071": {
|
| 251 |
+
"content": "<|audio_end|>",
|
| 252 |
+
"single_word": false,
|
| 253 |
+
"lstrip": false,
|
| 254 |
+
"rstrip": false,
|
| 255 |
+
"normalized": false,
|
| 256 |
+
"special": true
|
| 257 |
+
},
|
| 258 |
+
"248072": {
|
| 259 |
+
"content": "<tts_pad>",
|
| 260 |
+
"single_word": false,
|
| 261 |
+
"lstrip": false,
|
| 262 |
+
"rstrip": false,
|
| 263 |
+
"normalized": false,
|
| 264 |
+
"special": true
|
| 265 |
+
},
|
| 266 |
+
"248073": {
|
| 267 |
+
"content": "<tts_text_bos>",
|
| 268 |
+
"single_word": false,
|
| 269 |
+
"lstrip": false,
|
| 270 |
+
"rstrip": false,
|
| 271 |
+
"normalized": false,
|
| 272 |
+
"special": true
|
| 273 |
+
},
|
| 274 |
+
"248074": {
|
| 275 |
+
"content": "<tts_text_eod>",
|
| 276 |
+
"single_word": false,
|
| 277 |
+
"lstrip": false,
|
| 278 |
+
"rstrip": false,
|
| 279 |
+
"normalized": false,
|
| 280 |
+
"special": true
|
| 281 |
+
},
|
| 282 |
+
"248075": {
|
| 283 |
+
"content": "<tts_text_bos_single>",
|
| 284 |
+
"single_word": false,
|
| 285 |
+
"lstrip": false,
|
| 286 |
+
"rstrip": false,
|
| 287 |
+
"normalized": false,
|
| 288 |
+
"special": true
|
| 289 |
+
},
|
| 290 |
+
"248076": {
|
| 291 |
+
"content": "<|audio_pad|>",
|
| 292 |
+
"single_word": false,
|
| 293 |
+
"lstrip": false,
|
| 294 |
+
"rstrip": false,
|
| 295 |
+
"normalized": false,
|
| 296 |
+
"special": true
|
| 297 |
+
},
|
| 298 |
+
"248077": {
|
| 299 |
+
"content": "<|PAD_TOKEN|>",
|
| 300 |
+
"single_word": false,
|
| 301 |
+
"lstrip": false,
|
| 302 |
+
"rstrip": false,
|
| 303 |
+
"normalized": false,
|
| 304 |
+
"special": true
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
}
|