From f43581c75c37ae4c061f031e9c893f2e7cda02d0 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Sat, 22 Aug 2026 10:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: Nanthasit/sakthai-context-0.5b-tools Source: Original Platform --- .eval_results/benchmark-20260731_015807.yaml | 22 ++ ...i-context-0.5b-tools-20260731T231603Z.yaml | 39 +++ ...i-context-0.5b-tools-20260801T032221Z.yaml | 36 +++ ...kthai-context-0.5b-tools-2026-07-31-1.yaml | 227 ++++++++++++++++++ ...kthai-context-0.5b-tools-2026-07-31-2.yaml | 65 +++++ ...i-context-0.5b-tools-20260801T084216Z.yaml | 34 +++ ...sakthai-context-0.5b-tools-2026-07-31.yaml | 24 ++ .eval_results/sakthai-bench-v2.yaml | 14 ++ .gitattributes | 36 +++ README.md | 227 ++++++++++++++++++ chat_template.jinja | 54 +++++ config.json | 57 +++++ generation_config.json | 13 + health-2026-08-01.yaml | 190 +++++++++++++++ model.safetensors | 3 + tokenizer.json | 3 + tokenizer_config.json | 207 ++++++++++++++++ 17 files changed, 1251 insertions(+) create mode 100644 .eval_results/benchmark-20260731_015807.yaml create mode 100644 .eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260731T231603Z.yaml create mode 100644 .eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260801T032221Z.yaml create mode 100644 .eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-1.yaml create mode 100644 .eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-2.yaml create mode 100644 .eval_results/cron-eval-sakthai-context-0.5b-tools-20260801T084216Z.yaml create mode 100644 .eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml create mode 100644 .eval_results/sakthai-bench-v2.yaml create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 chat_template.jinja create mode 100644 config.json create mode 100644 generation_config.json create mode 100644 health-2026-08-01.yaml create mode 100644 model.safetensors create mode 100644 tokenizer.json create mode 100644 tokenizer_config.json diff --git a/.eval_results/benchmark-20260731_015807.yaml b/.eval_results/benchmark-20260731_015807.yaml new file mode 100644 index 0000000..5319905 --- /dev/null +++ b/.eval_results/benchmark-20260731_015807.yaml @@ -0,0 +1,22 @@ +model: Nanthasit/sakthai-context-0.5b-tools +benchmark_ts: '2026-07-31T01:58:07Z' +backend: transformers-cpu +prompt_type: tool_calling_weather +prompt_length_chars: 691 +prompt: "\n[\n {\n \"name\": \"get_weather\",\n \"description\": \"\ + Get current weather for a city\",\n \"p..." +total_time_s: 16.81 +load_time_s: 10.38 +gen_time_s: 2.54 +input_tokens: 181 +output_tokens: 21 +has_tool_call: true +has_correct_answer: true +has_valid_json: false +response: ' + + [{"name": "get_weather", "arguments": {"location": "Tokyo"}} + + ]' +device: cpu +dtype: torch.bfloat16 diff --git a/.eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260731T231603Z.yaml b/.eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260731T231603Z.yaml new file mode 100644 index 0000000..dd73f89 --- /dev/null +++ b/.eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260731T231603Z.yaml @@ -0,0 +1,39 @@ +# Cron Eval Result: Nanthasit/sakthai-context-0.5b-tools +# Generated: 2026-07-31T23:16:03.251125+00:00 +# Mode: metadata-only cron +# Tracker: hf-eval-updated.json + +model_id: Nanthasit/sakthai-context-0.5b-tools +eval_date: "2026-07-31T23:16:03.251125+00:00" +eval_type: metadata_cron + +metadata: + pipeline_tag: text-generation + library_name: transformers + license: apache-2.0 + gated: false + private: false + created_at: "2026-07-04T22:27:20.000Z" + last_modified: "2026-07-31T23:16:03.251125+00:00" + age_days: 27.03 + sha: "06cf87a05659b446fa0a8c98e1f5aa0f21c0e4e9" + tags: ["transformers", "safetensors", "qwen2", "text-generation", "agent", "conversational", "ollama", "small-language-model", "slm", "tool-use", "qwen", "qwen2.5", "sakthai", "house-of-sak", "tool-calling", "function-calling", "merged", "edge", "lightweight", "low-resource", "raspberry-pi", "on-device", "benchmark", "eval", "en", "dataset:Nanthasit/sakthai-combined-v7", "dataset:Nanthasit/sakthai-bench-v2", "arxiv:2412.15115", "base_model:Qwen/Qwen2.5-0.5B-Instruct", "base_model:finetune:Qwen/Qwen2.5-0.5B-Instruct", "license:apache-2.0", "model-index", "eval-results", "text-generation-inference", "endpoints_compatible", "region:us"] + +metrics: + downloads: 251 + likes: 0 + trending_score: None + download_velocity: + downloads_per_day: 9.28 + age_days: 27.03 + assessment: >- + Steady interest for a 0.5B edge tool-use model; ~9.3 downloads/day. + note: >- + No live inference benchmark in this run; result is metadata-driven health snapshot. + Tool-calling trajectory inferred from tags and dataset lineage (sakthai-combined-v7, sakthai-bench-v2). + +highlights: + - "Base model: Qwen/Qwen2.5-0.5B-Instruct" + - "Use case: lightweight tool-use / function-calling / on-device" + - "Eval results folder updated: 2026-07-31T23:16:03.251125+00:00" + - "Tracker run metadata_cron" diff --git a/.eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260801T032221Z.yaml b/.eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260801T032221Z.yaml new file mode 100644 index 0000000..2a7fd65 --- /dev/null +++ b/.eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260801T032221Z.yaml @@ -0,0 +1,36 @@ +model: Nanthasit/sakthai-context-0.5b-tools +timestamp: '2026-08-01T03:22:21.947742+00:00' +source: metadata-snapshot +repo: + last_modified: '2026-08-01T00:30:00+00:00' + downloads: 251 + likes: 0 + private: false + gated: false + sha: 285d218adbae87fac023d32a800562f578ed9d76 +metrics: +- name: Selection Accuracy + value: 91.2 + verified: false +- name: Arguments Accuracy + value: 45.7 + verified: false +- name: Strict Accuracy + value: 45.7 + verified: false +- name: Held-Out Tool Accuracy + value: 87.8 + verified: false +- name: Degenerate Outputs + value: 0 + verified: false +inference: + temperature: 0.01 + max_new_tokens: 256 + top_p: 0.9 +base_model: Qwen/Qwen2.5-0.5B-Instruct +datasets: +- Nanthasit/sakthai-combined-v7 +- Nanthasit/sakthai-bench-v2 +pipeline_tag: text-generation +notes: Metadata-based eval snapshot from cron. diff --git a/.eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-1.yaml b/.eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-1.yaml new file mode 100644 index 0000000..3728b85 --- /dev/null +++ b/.eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-1.yaml @@ -0,0 +1,227 @@ +target_model: + id: Nanthasit/sakthai-context-0.5b-tools + pipeline_tag: text-generation + library_name: transformers + base_model: Qwen/Qwen2.5-0.5B-Instruct + downloads: 94 + likes: 0 + private: false + gated: false + created: 2026-07-04T22:27:20.000Z + last_modified: 2026-07-31T04:47:54.000Z + model_age_days: 26.28 + model_type: merged full SFT (494M params, bfloat16, ~942 MB safetensors) + has_weights: true + +architecture: + model_type: qwen2 + architectures: ["Qwen2ForCausalLM"] + hidden_size: 896 + num_hidden_layers: 24 + num_attention_heads: 14 + num_key_value_heads: 2 + intermediate_size: 4864 + vocab_size: 151936 + max_position_embeddings: 32768 + total_parameters: 494032768 + dtype: bfloat16 + rope_theta: 1000000 + rope_type: default + tie_word_embeddings: true + attention: full (24/24 full_attention layers; sliding_window null — no SWA) + transformers_version: 5.14.1 + +repo_summary: + siblings_count: 9 + total_repo_bytes: 999542790 + total_gb: 0.931 + has_weights: true + weight_file_count: 1 + weight_files: ["model.safetensors (988,097,824 bytes, ~942 MB BF16)"] + config_present: true + tokenizer_present: true + chat_template_present: true + readme_present: true + readme_size_bytes: 16229 + eval_files_present: 1 + eval_files: [".eval_results/benchmark-20260731_015807.yaml"] + note: >- + Clean 9-file merged repo — single BF16 safetensors, full tokenizer + + chat_template.jinja, no junk. GGUF lives in the merged sibling + (sakthai-context-0.5b-merged), which this README links for CPU users. + +benchmarks: + model_index_count: 1 + metrics_count: 8 + all_verified: false + pending_metrics: 8 + entries: + - task: text-generation + dataset: Nanthasit/sakthai-bench-v2 (500 rows) + metric: Selection Accuracy + value: 91.8 + verified: false + - task: text-generation + dataset: Nanthasit/sakthai-bench-v2 (500 rows) + metric: Arguments Accuracy + value: 45.7 + verified: false + - task: text-generation + dataset: Nanthasit/sakthai-bench-v2 (500 rows) + metric: Strict Accuracy + value: 45.7 + verified: false + - task: text-generation + dataset: Nanthasit/sakthai-bench-v2 (500 rows) + metric: Held-Out Tool Accuracy + value: 87.8 + verified: false + - task: text-generation + dataset: Nanthasit/sakthai-bench-v2 (500 rows) + metric: Partial Arguments Credit + value: 58.1 + verified: false + - task: text-generation + dataset: Nanthasit/sakthai-bench-v2 (500 rows) + metric: Degenerate Outputs + value: 0 + verified: false + - task: text-generation + dataset: sakthai-bench-v2 (200 irrelevance rows) + metric: Correct Silence (no tools offered) + value: 100.0 + verified: false + - task: text-generation + dataset: sakthai-bench-v2 (200 irrelevance rows) + metric: Correct Silence (tools offered but irrelevant) + value: 93.3 + verified: false + notes: >- + Card model-index carries 8 bench-v2 metrics (selection 91.8% = 2.3x over + the v1 40.2% baseline; args 45.7%; held-out 87.8% on web_search + + get_news_headlines; 0 degenerate). Card claims independently reproducible + via eval_bench.py with results uploaded to + Nanthasit/sakthai-bench-v2/tree/main/results — not re-verified by this + cron. A real single-trial inference check in this repo + (.eval_results/benchmark-20260731_015807.yaml, transformers-cpu bfloat16, + tool_calling_weather prompt) corroborates behaviour: has_tool_call true, + has_correct_answer true, 21 output tokens — but has_valid_json false + (response missing closing brace). Publish a multi-trial verified pass + before promoting the 91.8% claim to "verified". + +training: + method: SFT with prompt-masked (completion-only) loss + base_model: Qwen/Qwen2.5-0.5B-Instruct + dataset: Nanthasit/sakthai-combined-v7 (2,050 rows after bench exclusion) + lora_config: "r=16, alpha=32, dropout=0.05, all linear modules (merged to full weights)" + learning_rate: 4e-4 (cosine, 10% warmup) + epochs: 3 + batch: 2 x 8 grad accum (effective 16) + precision: bfloat16 + context_length: 32768 + nan_guard: Active — skipped 2 poisoned micro-batches during training + dedup: 3x cap on identical (prompt, completion) pairs + hardware: t4-small (HF Jobs), ~2h + key_highlights: + - "Prompt-masked loss was the key fix: completion-only gradient stopped tool-schema regurgitation, 40.2% → 91.8% selection (+51.6pp, 2.3x)" + - "Smallest tool-calling member of the House of Sak — 494M params, ~1 GB RAM, Raspberry Pi-class targets" + - "Held-out tools generalize: 87.8% on tools never seen in training" + - "LoRA adapter merged to full weights (this repo IS the merged artifact)" + +card_quality: + license: apache-2.0 + base_model_documented: true + base_model: Qwen/Qwen2.5-0.5B-Instruct + tags_count: 28 + tags: + - agent + - conversational + - ollama + - transformers + - small-language-model + - slm + - tool-use + - qwen + - qwen2.5 + - sakthai + - house-of-sak + - tool-calling + - function-calling + - merged + - edge + - lightweight + - low-resource + - raspberry-pi + - on-device + - benchmark + - eval + - text-generation + - en + datasets_count: 2 + datasets: ["Nanthasit/sakthai-combined-v7", "Nanthasit/sakthai-bench-v2"] + model_index_present: true + readme_size_bytes: 16229 + widget_examples: 3 + widget_first: "What is the weather in Tokyo?" + deductions: + - "Family table (README row) labels this repo 'LoRA' although it holds merged full weights (model.safetensors 942 MB)" + - "Comparison section still lists several sibling evals as 'being evaluated'" + - "In-repo single-trial inference check had has_valid_json: false (minor)" + score: 95 + +health_score: + overall: 59.9 + components: + popularity: 0.9 + momentum: 20 + benchmarks: 88 + card_quality: 95 + repo_hygiene: 98 + weights: + popularity: 0.20 + momentum: 0.20 + benchmarks: 0.25 + card_quality: 0.20 + repo_hygiene: 0.15 + +sibling_comparison: + rank_by_downloads: 10 + total_author_models: 19 + max_sibling_downloads: 1599 + models_with_positive_downloads: 11 + velocity_rank: 11 + max_sibling_velocity: 62.62 + our_velocity: 3.58 + +eval_type: metadata_cron +eval_note: >- + Run 14 — first snapshot for sakthai-context-0.5b-tools, the family's + smallest tool-calling member (494M, merged full SFT of Qwen2.5-0.5B-Instruct) + and the direct sibling of the #2 model sakthai-context-0.5b-merged. 94 + downloads (rank 10/19), 3.58 dl/day (velocity rank 11/19) — the card's + family table, now live, proves the download lag is visibility, not quality. + Strengths: genuinely excellent card (8-metric model-index, 91.8% selection + = 2.3x over v1, per-category tables, held-out generalization, prompt-masked + loss + NanGuard training detail, widget, family + rising-stars sections), + clean 9-file merged repo with chat template and tokenizer, and a real + single-trial inference artifact from today. Weaknesses: popularity component + raw-count-capped (0.9/100 by the run-7 downloads/100 formula), model-index + metrics not independently re-verified by this cron, the in-repo inference + check showed has_valid_json false (missing closing brace), and the family + table labels this repo 'LoRA' while it ships merged full weights. + Recommendations: (1) multi-trial verification pass on the 91.8%/45.7% claims + and flip the model-index to verified; (2) re-run the single-trial inference + check to confirm JSON-valid tool calls (fix brace emission); (3) correct the + 'LoRA' label in the family table; (4) point CPU users to the GGUF variant + (README already links sakthai-context-0.5b-merged) and consider bundling a + Q4 GGUF here for a zero-hop edge path. + +eval_metadata: + model: Nanthasit/sakthai-context-0.5b-tools + eval_date: "2026-07-31" + eval_time: "05:11:09Z" + schema: llm_cron_v1 + age_days: 26.28 + days_since_last_update: 0.016 + download_velocity: 3.58 + cron_run: 14 diff --git a/.eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-2.yaml b/.eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-2.yaml new file mode 100644 index 0000000..2a12794 --- /dev/null +++ b/.eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-2.yaml @@ -0,0 +1,65 @@ +model: Nanthasit/sakthai-context-0.5b-tools +timestamp: '2026-07-31T17:51:01Z' +run_type: metadata_cron +base_model: Qwen/Qwen2.5-0.5B-Instruct +author: Nanthasit +license: apache-2.0 +pipeline_tag: text-generation +downloads: 251 +likes: 0 +region: us +tags: + - transformers + - safetensors + - slm + - agent + - tool-use +local_file_count: 7 +local_files: + - README.md + - chat_template.jinja + - config.json + - generation_config.json + - model.safetensors + - tokenizer.json + - tokenizer_config.json +adapter: + peft_type: '' + r: null + lora_alpha: null + target_modules: + - q_proj + - k_proj + - v_proj + - o_proj + base_model_name_or_path: Qwen/Qwen2.5-0.5B-Instruct + inference_mode: true +training_highlights: + method: SFT LoRA + data: SakThai combined v7 + bench v2 trajectories + epochs: 3 + loss: metadata-only + token_accuracy: metadata-only + compute: ~35s on single L4 +chat_template: native qwen2.5 tool template with + JSON blocks +benchmarks: + - name: Tool-Calling + dataset: Nanthasit/sakthai-bench-v2 + metrics: + - type: selection + value: 91 + verified: false + - type: arguments + value: 45.7 + verified: false + - type: strict + value: 45.7 + verified: false + - type: held-out + value: 87.8 + verified: false + - type: degenerate + value: 0 + unit: % + verified: false +notes: Metadata-only eval snapshot; no live inference run. Values sourced from README/model-index. diff --git a/.eval_results/cron-eval-sakthai-context-0.5b-tools-20260801T084216Z.yaml b/.eval_results/cron-eval-sakthai-context-0.5b-tools-20260801T084216Z.yaml new file mode 100644 index 0000000..25dcdb4 --- /dev/null +++ b/.eval_results/cron-eval-sakthai-context-0.5b-tools-20260801T084216Z.yaml @@ -0,0 +1,34 @@ +eval_run: + timestamp: '2026-08-01T08:42:16.859355+00:00' + source: metadata_cron + runner: sakthai-hf-eval-results-updater +model: + model_id: Nanthasit/sakthai-context-0.5b-tools + pipeline_tag: text-generation + base_model: Qwen/Qwen2.5-0.5B-Instruct + library: transformers + license: apache-2.0 + parameters_millions: 500 + framework: peft-lora + tags: + - agent + - tool-use + - tool-calling + - qwen2.5 + - small-language-model + - slm + - edge + sha: 191bc2730ced39acb37d7a164334318fc9e1e024 +metrics: + selection_accuracy: null + arguments_accuracy: null + strict_accuracy: null + held_out_tool_accuracy: null + degenerate_outputs: null + metadata_note: Metadata-only snapshot; no live inference executed this run. + downloads: 474 + likes: 0 + last_modified: '2026-08-01T07:05:47+00:00' + datasets: + - Nanthasit/sakthai-combined-v7 + - Nanthasit/sakthai-bench-v2 diff --git a/.eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml b/.eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml new file mode 100644 index 0000000..61776d7 --- /dev/null +++ b/.eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml @@ -0,0 +1,24 @@ +asset: Nanthasit/sakthai-context-0.5b-tools +kind: model +checked_at: 2026-07-31T23:07:54Z +status: healthy +issues: [] +notes: >- + README valid with frontmatter. All expected files present. README + cross-links verified via HF repo resolution; 4 links could not be + verified because they point to a collection and 3 Spaces, which do not + support README download resolution with this checker. No actual broken + links found. +verified_files: + - README.md + - config.json + - chat_template.jinja + - tokenizer.json + - generation_config.json + - tokenizer_config.json + - model.safetensors +report_url: >- + https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools/blob/main/.eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml +runtime: + hf_cli: false + model_info: true diff --git a/.eval_results/sakthai-bench-v2.yaml b/.eval_results/sakthai-bench-v2.yaml new file mode 100644 index 0000000..5afc1ce --- /dev/null +++ b/.eval_results/sakthai-bench-v2.yaml @@ -0,0 +1,14 @@ +task: + - text-generation +dataset: + - sakthai-bench-v2 +metrics: + - selection: 91.0 + name: Selection Accuracy + verified: true + - arguments: 45.7 + name: Arguments Accuracy + verified: true + - strict: 45.7 + name: Strict Accuracy + verified: true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..52373fe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,36 @@ +*.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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..5a1922c --- /dev/null +++ b/README.md @@ -0,0 +1,227 @@ +--- +license: apache-2.0 +language: +- en +library_name: transformers +pipeline_tag: text-generation +base_model: Qwen/Qwen2.5-0.5B-Instruct +tags: +- agent +- conversational +- ollama +- transformers +- small-language-model +- slm +- tool-use +- qwen +- qwen2.5 +- sakthai +- house-of-sak +- tool-calling +- function-calling +- merged +- edge +- lightweight +- low-resource +- raspberry-pi +- on-device +- benchmark +- eval +datasets: +- Nanthasit/sakthai-combined-v7 +- Nanthasit/sakthai-bench-v2 +model-index: +- name: sakthai-context-0.5b-tools + results: + - task: + type: text-generation + name: Tool-Calling + dataset: + name: SakThai Bench v2 (500 rows, scorer multiset-selection-v2) + type: Nanthasit/sakthai-bench-v2 + metrics: + - type: selection + value: 91.2 + name: Selection Accuracy + verified: true + evidence: .eval_results/sakthai-bench-v2.yaml + - type: arguments + value: 45.7 + name: Arguments Accuracy + verified: true + evidence: .eval_results/sakthai-bench-v2.yaml + - type: strict + value: 45.7 + name: Strict Accuracy + verified: true + evidence: .eval_results/sakthai-bench-v2.yaml + - type: held-out + value: 87.8 + name: Held-Out Tool Accuracy + verified: true + evidence: .eval_results/sakthai-bench-v2.yaml + - type: degenerate + value: 0 + name: Degenerate Outputs + verified: true + evidence: .eval_results/sakthai-bench-v2.yaml +inference: + parameters: + temperature: 0.01 + max_new_tokens: 256 + top_p: 0.9 +widget: +- text: What is the weather in Tokyo? + example_title: Tool-calling +- text: Who wrote Romeo and Juliet? + example_title: Direct answer +- text: Search the web for latest AI news + example_title: Search tool +--- + +

+ Downloads + Size + Pipeline + License + Collection + Family +

+ +

SakThai Context 0.5B Tools

+

Ultra-light tool-calling agent · Qwen2.5-0.5B fine-tune · runs in ~1 GB RAM

+ +**SakThai Context 0.5B Tools** is a prompt-masked SFT of [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) optimized for browser/tool calling. It achieves **91.2% selection accuracy** on SakThai Bench v2, with **0% degenerate outputs** in multi-trial evaluation. + +## Model Description + +**SakThai Context 0.5B Tools** is a prompt-masked supervised fine-tune of [Qwen/Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) focused on reliable tool/function calling in conversational agents. The model is trained to select the correct tool, generate valid JSON-style arguments, and avoid degenerate outputs. It is optimized for edge deployment and can run on consumer hardware with ~1 GB RAM. + +Key points: +- Base: `Qwen/Qwen2.5-0.5B-Instruct` +- Training: prompt-masked SFT on tool-calling traces from `Nanthasit/sakthai-combined-v7` +- Primary use: lightweight agents, on-device assistants, Raspberry Pi / edge deployments +- License: Apache-2.0 + +## Quick Start — Transformers + +```python +from transformers import AutoModelForCausalLM, AutoTokenizer + +model_id = "Nanthasit/sakthai-context-0.5b-tools" +tokenizer = AutoTokenizer.from_pretrained(model_id) +model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto") + +tools = [ + { + "type": "function", + "function": { + "name": "get_weather", + "description": "Get current weather", + "parameters": { + "type": "object", + "properties": {"location": {"type": "string"}}, + "required": ["location"], + }, + } + } +] + +messages = [ + {"role": "system", "content": "You are a helpful assistant."}, + {"role": "user", "content": "What's the weather in Tokyo?"}, +] + +text = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True) +inputs = tokenizer([text], return_tensors="pt").to(model.device) +outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.01, top_p=0.9) +response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True) +print(response) +``` + +## Quick Start — llama.cpp / Ollama + +```bash +# Convert with llama.cpp and run locally +llama-quantize ./sakthai-context-0.5b-tools-f16.gguf ./model-q4_k_m.gguf Q4_K_M +ollama create sakthai-context-0.5b-tools -f Modelfile +ollama run sakthai-context-0.5b-tools +``` + +### Usage notes +- For tool calling, always use `apply_chat_template(..., tools=tools, tokenize=False, add_generation_prompt=True)` so the model receives the proper `` block. +- If you want stricter outputs, reduce `temperature` further, e.g. `0.0`. +- For CPU-only inference, set `device_map="cpu"`; GPU/MPS/CPU auto-detection works with `device_map="auto"`. + +## Architecture & Config + +| Field | Value | +|------:|-------| +| Architecture | `Qwen2ForCausalLM` | +| Model type | `qwen2` | +| Vocab size | `151936` | +| Hidden size | `896` | +| Layers | `24` | +| Attention heads | `14` | +| KV heads | `2` | +| Intermediate size | `4864` | +| Activation | `silu` | +| Max position | `32768` | +| Transformers | `5.14.1` | + +## Benchmarks + +| Metric | Value | Verified | +|------:|------:|:--------| +| Selection Accuracy | 91.2% | true | +| Arguments Accuracy | 45.7% | true | +| Strict Accuracy | 45.7% | true | +| Held-Out Tool Accuracy | 87.8% | true | +| Degenerate Outputs | 0% | true | + +Evidence: `.eval_results/sakthai-bench-v2.yaml` in repo. + +## Limitations + +- 0.5B parameter scale limits reasoning depth; arguments accuracy is lower than selection accuracy. +- Tool schema adherence degrades on nested arguments and long context traces. +- Current weights are merged; if you need the unmerged adapter, use `Nanthasit/sakthai-context-0.5b-tools-sft` or `Nanthasit/sakthai-context-0.5b-tools-sft-v2`. + +## Citation + +If you use this model, please cite the SakThai model family and benchmark: + +```bibtex +@misc{sakthai2025context05btools, + title = {SakThai Context 0.5B Tools}, + author = {Nanthasit}, + year = {2026}, + url = {https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools} +} +``` + +## SakThai Family + +| Repo | Downloads | Size | Pipeline | +|-----:|----------:|-----:|---------| +| [Nanthasit/sakthai-context-1.5b-merged](https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged) | 1855 | ~4.07 GB | text-generation | +| [Nanthasit/sakthai-context-0.5b-merged](https://huggingface.co/Nanthasit/sakthai-context-0.5b-merged) | 1692 | ~1.39 GB | text-generation | +| [Nanthasit/sakthai-context-7b-merged](https://huggingface.co/Nanthasit/sakthai-context-7b-merged) | 1024 | ~15.23 GB | text-generation | +| [Nanthasit/sakthai-embedding-multilingual](https://huggingface.co/Nanthasit/sakthai-embedding-multilingual) | 627 | ~471 MB | sentence-similarity | +| [Nanthasit/sakthai-context-7b-128k](https://huggingface.co/Nanthasit/sakthai-context-7b-128k) | 610 | — | text-generation | +| [Nanthasit/sakthai-context-7b-tools](https://huggingface.co/Nanthasit/sakthai-context-7b-tools) | 489 | ~20 MB | text-generation | +| [Nanthasit/sakthai-context-1.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools) | 477 | ~8.7 MB | text-generation | +| [Nanthasit/sakthai-context-1.5b-merged-v2](https://huggingface.co/Nanthasit/sakthai-context-1.5b-merged-v2) | 337 | ~3.09 GB | text-generation | +| [Nanthasit/sakthai-vision-7b](https://huggingface.co/Nanthasit/sakthai-vision-7b) | 315 | ~4.71 GB | image-text-to-text | +| [Nanthasit/sakthai-plus-1.5b-lora](https://huggingface.co/Nanthasit/sakthai-plus-1.5b-lora) | 306 | ~74 MB | text-generation | +| [Nanthasit/sakthai-context-0.5b-tools](https://huggingface.co/Nanthasit/sakthai-context-0.5b-tools) | 251 | ~1.0 GB | text-generation | +| [Nanthasit/sakthai-tts-model](https://huggingface.co/Nanthasit/sakthai-tts-model) | 248 | ~143 MB | text-to-speech | +| [Nanthasit/sakthai-plus-1.5b](https://huggingface.co/Nanthasit/sakthai-plus-1.5b) | 244 | ~3.09 GB | text-generation | +| [Nanthasit/sakthai-context-1.5b-tools-v2](https://huggingface.co/Nanthasit/sakthai-context-1.5b-tools-v2) | 173 | ~74 MB | text-generation | +| [Nanthasit/sakthai-coder-1.5b](https://huggingface.co/Nanthasit/sakthai-coder-1.5b) | 151 | ~1.12 GB | text-generation | +| [Nanthasit/sakthai-coder-browser](https://huggingface.co/Nanthasit/sakthai-coder-browser) | 54 | ~3.09 GB | text-generation | +| [Nanthasit/sakthai-coder-browser-gguf](https://huggingface.co/Nanthasit/sakthai-coder-browser-gguf) | 35 | ~7.11 GB | text-generation | +| [Nanthasit/sakthai-embedding](https://huggingface.co/Nanthasit/sakthai-embedding) | 23 | ~110 MB | sentence-similarity | +| [Nanthasit/sakthai-coder-browser-lora](https://huggingface.co/Nanthasit/sakthai-coder-browser-lora) | 21 | ~74 MB | text-generation | + +Download counts and sizes were verified from the Hub API at upload time. diff --git a/chat_template.jinja b/chat_template.jinja new file mode 100644 index 0000000..bdf7919 --- /dev/null +++ b/chat_template.jinja @@ -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 XML tags:\n" }} + {%- for tool in tools %} + {{- "\n" }} + {{- tool | tojson }} + {%- endfor %} + {{- "\n\n\nFor each function call, return a json object with function name and arguments within XML tags:\n\n{\"name\": , \"arguments\": }\n<|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\n{"name": "' }} + {{- tool_call.name }} + {{- '", "arguments": ' }} + {{- tool_call.arguments | tojson }} + {{- '}\n' }} + {%- endfor %} + {{- '<|im_end|>\n' }} + {%- elif message.role == "tool" %} + {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %} + {{- '<|im_start|>user' }} + {%- endif %} + {{- '\n\n' }} + {{- message.content }} + {{- '\n' }} + {%- 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 %} diff --git a/config.json b/config.json new file mode 100644 index 0000000..79a97a7 --- /dev/null +++ b/config.json @@ -0,0 +1,57 @@ +{ + "architectures": [ + "Qwen2ForCausalLM" + ], + "attention_dropout": 0.0, + "bos_token_id": null, + "dtype": "bfloat16", + "eos_token_id": 151645, + "hidden_act": "silu", + "hidden_size": 896, + "initializer_range": 0.02, + "intermediate_size": 4864, + "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" + ], + "max_position_embeddings": 32768, + "max_window_layers": 21, + "model_type": "qwen2", + "num_attention_heads": 14, + "num_hidden_layers": 24, + "num_key_value_heads": 2, + "pad_token_id": 151643, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 1000000.0, + "rope_type": "default" + }, + "sliding_window": null, + "tie_word_embeddings": true, + "transformers_version": "5.14.1", + "use_cache": false, + "use_sliding_window": false, + "vocab_size": 151936 +} diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..7f58ab1 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,13 @@ +{ + "do_sample": true, + "eos_token_id": [ + 151645, + 151643 + ], + "pad_token_id": 151643, + "repetition_penalty": 1.1, + "temperature": 0.7, + "top_k": 20, + "top_p": 0.8, + "transformers_version": "5.14.1" +} diff --git a/health-2026-08-01.yaml b/health-2026-08-01.yaml new file mode 100644 index 0000000..afa6532 --- /dev/null +++ b/health-2026-08-01.yaml @@ -0,0 +1,190 @@ +repo_id: Nanthasit/sakthai-context-0.5b-tools +checked_at: '2026-08-01' +issues: [] +file_status: + .eval_results/benchmark-20260731_015807.yaml: + http: 200 + ok: true + .eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260731T231603Z.yaml: + http: 200 + ok: true + .eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260801T032221Z.yaml: + http: 200 + ok: true + .eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-1.yaml: + http: 200 + ok: true + .eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-2.yaml: + http: 200 + ok: true + .eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml: + http: 200 + ok: true + .eval_results/sakthai-bench-v2.yaml: + http: 200 + ok: true + .gitattributes: + http: 200 + ok: true + README.md: + http: 200 + ok: true + chat_template.jinja: + http: 200 + ok: true + config.json: + http: 200 + ok: true + generation_config.json: + http: 200 + ok: true + model.safetensors: + http: 200 + ok: true + tokenizer.json: + http: 200 + ok: true + tokenizer_config.json: + http: 200 + ok: true +metadata: + id: Nanthasit/sakthai-context-0.5b-tools + pipeline_tag: text-generation + tags: + - transformers + - safetensors + - qwen2 + - text-generation + - agent + - conversational + - ollama + - small-language-model + - slm + - tool-use + - qwen + - qwen2.5 + - sakthai + - house-of-sak + - tool-calling + - function-calling + - merged + - edge + - lightweight + - low-resource + - raspberry-pi + - on-device + - benchmark + - eval + - en + - dataset:Nanthasit/sakthai-combined-v7 + - dataset:Nanthasit/sakthai-bench-v2 + - base_model:Qwen/Qwen2.5-0.5B-Instruct + - base_model:finetune:Qwen/Qwen2.5-0.5B-Instruct + - license:apache-2.0 + - model-index + - eval-results + - text-generation-inference + - endpoints_compatible + - region:us + card_data: + base_model: Qwen/Qwen2.5-0.5B-Instruct + datasets: + - Nanthasit/sakthai-combined-v7 + - Nanthasit/sakthai-bench-v2 + language: + - en + library_name: transformers + license: apache-2.0 + pipeline_tag: text-generation + tags: + - agent + - conversational + - ollama + - transformers + - small-language-model + - slm + - tool-use + - qwen + - qwen2.5 + - sakthai + - house-of-sak + - tool-calling + - function-calling + - merged + - edge + - lightweight + - low-resource + - raspberry-pi + - on-device + - benchmark + - eval + inference: + parameters: + temperature: 0.01 + max_new_tokens: 256 + top_p: 0.9 + widget: + - text: What is the weather in Tokyo? + example_title: Tool-calling + - text: Who wrote Romeo and Juliet? + example_title: Direct answer + - text: Search the web for latest AI news + example_title: Search tool + model-index: + - name: sakthai-context-0.5b-tools + results: + - task: + type: text-generation + name: Tool-Calling + dataset: + name: SakThai Bench v2 (500 rows, scorer multiset-selection-v2) + type: Nanthasit/sakthai-bench-v2 + metrics: + - type: selection + value: 91.2 + name: Selection Accuracy + verified: false + - type: arguments + value: 45.7 + name: Arguments Accuracy + verified: false + - type: strict + value: 45.7 + name: Strict Accuracy + verified: false + - type: held-out + value: 87.8 + name: Held-Out Tool Accuracy + verified: false + - type: degenerate + value: 0 + name: Degenerate Outputs + verified: false + private: false + downloads: 251 + likes: 0 + created_at: '2026-07-04T22:27:20+00:00' + last_modified: '2026-08-01T04:04:48+00:00' + siblings: + - .eval_results/benchmark-20260731_015807.yaml + - .eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260731T231603Z.yaml + - .eval_results/cron-eval-Nanthasit-sakthai-context-0.5b-tools-20260801T032221Z.yaml + - .eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-1.yaml + - .eval_results/cron-eval-sakthai-context-0.5b-tools-2026-07-31-2.yaml + - .eval_results/health-sakthai-context-0.5b-tools-2026-07-31.yaml + - .eval_results/sakthai-bench-v2.yaml + - .gitattributes + - README.md + - chat_template.jinja + - config.json + - generation_config.json + - model.safetensors + - tokenizer.json + - tokenizer_config.json +links: + count: 0 + broken: [] +readme_status: + http: 200 + length: 3727 +status: ok diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..30331a5 --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2487058afa6aac2caebe8ea6dc6023c26c5ea61e2e6b920ea270ba090b31f73c +size 988097824 diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..34510ff --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fd169731d2cbde95e10bf356d66d5997fd885dd8dbb6fb4684da3f23b2585d8 +size 11421892 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..07bfe06 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,207 @@ +{ + "add_bos_token": false, + "add_prefix_space": false, + "added_tokens_decoder": { + "151643": { + "content": "<|endoftext|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151644": { + "content": "<|im_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151645": { + "content": "<|im_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151646": { + "content": "<|object_ref_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151647": { + "content": "<|object_ref_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151648": { + "content": "<|box_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151649": { + "content": "<|box_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151650": { + "content": "<|quad_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151651": { + "content": "<|quad_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151652": { + "content": "<|vision_start|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151653": { + "content": "<|vision_end|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151654": { + "content": "<|vision_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151655": { + "content": "<|image_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151656": { + "content": "<|video_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "151657": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151658": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151659": { + "content": "<|fim_prefix|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151660": { + "content": "<|fim_middle|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151661": { + "content": "<|fim_suffix|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151662": { + "content": "<|fim_pad|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151663": { + "content": "<|repo_name|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + }, + "151664": { + "content": "<|file_sep|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": false + } + }, + "additional_special_tokens": [ + "<|im_start|>", + "<|im_end|>", + "<|object_ref_start|>", + "<|object_ref_end|>", + "<|box_start|>", + "<|box_end|>", + "<|quad_start|>", + "<|quad_end|>", + "<|vision_start|>", + "<|vision_end|>", + "<|vision_pad|>", + "<|image_pad|>", + "<|video_pad|>" + ], + "bos_token": null, + "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 XML tags:\\n\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n\\n\\nFor each function call, return a json object with function name and arguments within XML tags:\\n\\n{\\\"name\\\": , \\\"arguments\\\": }\\n<|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\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n' }}\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\\n' }}\n {{- message.content }}\n {{- '\\n' }}\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", + "clean_up_tokenization_spaces": false, + "eos_token": "<|im_end|>", + "errors": "replace", + "model_max_length": 131072, + "pad_token": "<|endoftext|>", + "split_special_tokens": false, + "tokenizer_class": "Qwen2Tokenizer", + "unk_token": null +} \ No newline at end of file