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

Model: bineric/lynx-instruct-30b
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-02 00:09:18 +08:00
commit fd6872ac04
28 changed files with 171230 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -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

257
README.md Normal file
View File

@@ -0,0 +1,257 @@
---
license: apache-2.0
language:
- en
- no
- sv
- da
- is
base_model: Qwen/Qwen3-30B-A3B-Instruct-2507
tags:
- european
- nordic
- norwegian
- swedish
- danish
- icelandic
- multilingual
- moe
- qwen3
library_name: transformers
pipeline_tag: text-generation
---
# Bineric Lynx Instruct 30B
**A European large language model with exceptional Nordic language performance.**
| | |
|---|---|
| **Parameters** | 30B total, ~3B active |
| **Architecture** | Qwen3 MoE (128 experts, 8 active) |
| **Context Length** | 262K tokens |
| **Base Model** | [Qwen3-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-30B-A3B-Instruct-2507) |
| **Languages** | Norwegian (Bokmål/Nynorsk), Swedish, Danish, Icelandic + 100+ via base |
## About Bineric
[Bineric](https://bineric.com) is an AI company based in Oslo, Norway, built from a European perspective. We started Bineric to make AI usable for organizations that care about governance, language, and where their systems and data actually live.
Lynx is our flagship model — designed to serve European users with strong multilingual support and exceptional Nordic language performance.
## Overview
Lynx is built on Qwen3-30B's efficient Mixture-of-Experts architecture. It retains strong multilingual capabilities across **100+ languages including all major European languages**, while being specifically fine-tuned and rigorously evaluated on Nordic languages (Norwegian, Swedish, Danish, Icelandic) where it demonstrates exceptional results.
**Key features:**
- Strong European language support inherited from Qwen3 base model
- Fine-tuned and optimized for Nordic language understanding and generation
- Efficient MoE architecture: only 3B parameters active per token
- Available in 8-bit and 4-bit quantized variants for flexible deployment
- 262K context window for long-document processing
## Try Lynx
Lynx is available through multiple channels:
| Access Method | Link | Best For |
|--------------|------|----------|
| **Chatbot** | [chat.bineric.com](https://chat.bineric.com) | Interactive conversations, quick testing |
| **API** | [bineric.com/platform](https://bineric.com/platform) | Production integrations, programmatic access |
| **Hugging Face** | This repository | Self-hosting, fine-tuning, research |
## Evaluation Results
Evaluated using [EuroEval](https://github.com/ScandEval/EuroEval) benchmark framework (March 2026).
> **Note:** While Lynx supports all European languages via its Qwen3 base, we have rigorously evaluated performance on Nordic languages. Benchmarks for additional European languages coming soon.
### Nordic Language Performance
| Language | Overall Score | Best Task | Score |
|----------|---------------|-----------|-------|
| Danish | **79.3%** | Citizen Tests (Knowledge) | 79.3% |
| Swedish | **76.9%** | European Values | 76.9% |
| Norwegian | **71.0%** | NER Nynorsk | 71.0% |
| Icelandic | **65.1%** | Summarization | 65.1% |
![Language Performance Comparison](assets/language_comparison.svg)
### Task Performance by Language
#### Norwegian (8-bit)
| Task | Dataset | Metric | Score |
|------|---------|--------|-------|
| Sentiment | NoReC | MCC | 51.0% |
| NER (Bokmål) | NorNE-nb | F1 | 65.7% |
| NER (Nynorsk) | NorNE-nn | F1 | 71.0% |
| Reading Comprehension | NorQuAD | F1 | 61.2% |
| Summarization | NoSammendrag | BERTScore | 63.4% |
| Common Sense | NorCommonSenseQA | MCC | 69.3% |
| Knowledge | NRK Quiz QA | MCC | 35.3% |
#### Danish (8-bit)
| Task | Dataset | Metric | Score |
|------|---------|--------|-------|
| Sentiment | AngryTweets | MCC | 54.8% |
| NER | DANSK | F1 | 53.8% |
| Reading Comprehension | MultiWikiQA-da | F1 | **72.2%** |
| Summarization | Nordjylland News | BERTScore | 65.2% |
| Common Sense | HellaSwag-da | MCC | 67.7% |
| Knowledge | Danish Citizen Tests | MCC | **79.3%** |
| Idioms | Danske Talemåder | MCC | 64.9% |
#### Swedish (8-bit)
| Task | Dataset | Metric | Score |
|------|---------|--------|-------|
| Sentiment | SweReC | MCC | 34.5% |
| NER | SUC3 | F1 | 65.0% |
| Reading Comprehension | MultiWikiQA-sv | F1 | **72.4%** |
| Summarization | SweDN | BERTScore | 65.9% |
| Common Sense | HellaSwag-sv | MCC | 58.3% |
| Knowledge | MMLU-sv | MCC | 53.9% |
| European Values | VaLEU-sv | MCC | **76.9%** |
#### Icelandic (8-bit)
| Task | Dataset | Metric | Score |
|------|---------|--------|-------|
| NER | MIM-GOLD-NER | F1 | 63.6% |
| Reading Comprehension | NQiI | F1 | 58.6% |
| Summarization | RRN | BERTScore | **65.1%** |
| Knowledge | Icelandic Knowledge | MCC | 28.2% |
| Common Sense | Winogrande-is | MCC | 9.7% |
![Task Performance by Language](assets/task_performance.svg)
### Quantization Comparison (Norwegian)
8-bit quantization consistently outperforms 4-bit by ~2% on average.
| Task | 4-bit | 8-bit | Delta |
|------|-------|-------|-------|
| Sentiment (NoReC) | 49.7% | 51.0% | +1.3% |
| NER Bokmål | 65.1% | 65.7% | +0.6% |
| NER Nynorsk | 69.9% | 71.0% | +1.1% |
| Reading Comp | 58.9% | 61.2% | +2.3% |
| Summarization | 63.1% | 63.4% | +0.3% |
| Common Sense | 68.5% | 69.3% | +0.8% |
| Linguistic Accept. | 29.8% | 36.4% | **+6.6%** |
![8-bit vs 4-bit Quantization](assets/quantization_comparison.svg)
## Strengths & Limitations
### Strengths
- **Named Entity Recognition**: Consistently strong across all languages (63-71% F1)
- **Reading Comprehension**: Excellent for Danish and Swedish (72%+)
- **Knowledge Tasks**: Outstanding on Danish Citizen Tests (79.3%)
- **Summarization**: Stable 63-66% BERTScore across all languages
### Limitations
- **Linguistic Acceptability**: Grammatical judgment tasks are weak (10-36% MCC)
- **Icelandic Common Sense**: Winogrande-is performance is low (9.7%)
- **Norwegian Idioms**: Room for improvement (17-19% MCC)
## Quantization Options
| Variant | Size | Quality | Use Case |
|---------|------|---------|----------|
| **bfloat16** | ~60GB | Best | Research, high-end GPUs |
| **8-bit** | ~30GB | ~1-2% loss | Production (A10/L4 GPU) |
| **4-bit** | ~16GB | ~3-5% loss | Cost-optimized (T4 GPU) |
## Usage
### Basic Inference
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"bineric/lynx-instruct-30b",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("bineric/lynx-instruct-30b")
messages = [
{"role": "user", "content": "Hva er hovedstaden i Norge?"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### With Thinking Mode
Lynx supports extended thinking for complex reasoning tasks:
```python
messages = [
{"role": "user", "content": "Forklar forskjellen mellom bokmål og nynorsk."}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True # Enable reasoning mode
)
```
### vLLM Deployment
```bash
vllm serve bineric/lynx-instruct-30b \
--tensor-parallel-size 1 \
--max-model-len 32768 \
--quantization awq # For 4-bit
```
## Model Architecture
```
Qwen3 MoE Architecture
├── Total Parameters: 30.5B
├── Active Parameters: ~3B per token
├── Hidden Layers: 48
├── Hidden Size: 2048
├── Attention Heads: 32
├── KV Heads: 4 (Grouped Query Attention)
├── Experts: 128 total
├── Active Experts: 8 per token
├── Vocab Size: 151,936
└── Context Length: 262,144 tokens
```
## Training
Lynx is fine-tuned from [Qwen3-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-30B-A3B-Instruct-2507) with additional training on Nordic language data to improve performance on Norwegian, Swedish, Danish, and Icelandic tasks.
## Citation
```bibtex
@misc{bineric2026lynx,
title={Bineric Lynx: A European Large Language Model},
author={Bineric AI},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/bineric/lynx-instruct-30b}
}
```
## Links
- [Base Model: Qwen3-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-30B-A3B-Instruct-2507)
---
*Built with care in Oslo by [Bineric](https://bineric.com)*

28
added_tokens.json Normal file
View File

@@ -0,0 +1,28 @@
{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

View File

@@ -0,0 +1,42 @@
<svg width="600" height="350" xmlns="http://www.w3.org/2000/svg">
<style>
.title { font: bold 18px sans-serif; fill: #333; }
.label { font: 14px sans-serif; fill: #333; }
.value { font: bold 14px sans-serif; fill: #fff; }
.axis { font: 12px sans-serif; fill: #666; }
</style>
<!-- Background -->
<rect width="600" height="350" fill="#fafafa"/>
<!-- Title -->
<text x="300" y="35" text-anchor="middle" class="title">Overall Performance by Language</text>
<text x="300" y="55" text-anchor="middle" class="axis">(EuroEval Benchmark, March 2026)</text>
<!-- Bars -->
<!-- Danish: 79.3% -->
<rect x="80" y="90" width="396.5" height="50" fill="#2563eb" rx="4"/>
<text x="95" y="120" class="value">Danish</text>
<text x="460" y="120" class="label">79.3%</text>
<!-- Swedish: 76.9% -->
<rect x="80" y="155" width="384.5" height="50" fill="#3b82f6" rx="4"/>
<text x="95" y="185" class="value">Swedish</text>
<text x="448" y="185" class="label">76.9%</text>
<!-- Norwegian: 71.0% -->
<rect x="80" y="220" width="355" height="50" fill="#60a5fa" rx="4"/>
<text x="95" y="250" class="value">Norwegian</text>
<text x="420" y="250" class="label">71.0%</text>
<!-- Icelandic: 65.1% -->
<rect x="80" y="285" width="325.5" height="50" fill="#93c5fd" rx="4"/>
<text x="95" y="315" class="value">Icelandic</text>
<text x="390" y="315" class="label">65.1%</text>
<!-- Scale line -->
<line x1="80" y1="345" x2="580" y2="345" stroke="#ccc" stroke-width="1"/>
<text x="80" y="342" class="axis">0%</text>
<text x="330" y="342" class="axis">50%</text>
<text x="560" y="342" class="axis">100%</text>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,72 @@
<svg width="700" height="400" xmlns="http://www.w3.org/2000/svg">
<style>
.title { font: bold 18px sans-serif; fill: #333; }
.label { font: 12px sans-serif; fill: #333; }
.value { font: 11px sans-serif; fill: #333; }
.axis { font: 11px sans-serif; fill: #666; }
.legend { font: 13px sans-serif; fill: #333; }
</style>
<!-- Background -->
<rect width="700" height="400" fill="#fafafa"/>
<!-- Title -->
<text x="350" y="30" text-anchor="middle" class="title">8-bit vs 4-bit Quantization (Norwegian)</text>
<!-- Legend -->
<rect x="480" y="50" width="16" height="16" fill="#3b82f6"/>
<text x="502" y="63" class="legend">8-bit</text>
<rect x="560" y="50" width="16" height="16" fill="#94a3b8"/>
<text x="582" y="63" class="legend">4-bit</text>
<!-- Y-axis labels -->
<text x="70" y="100" text-anchor="end" class="label">Sentiment</text>
<text x="70" y="145" text-anchor="end" class="label">NER (nb)</text>
<text x="70" y="190" text-anchor="end" class="label">NER (nn)</text>
<text x="70" y="235" text-anchor="end" class="label">Reading</text>
<text x="70" y="280" text-anchor="end" class="label">Summary</text>
<text x="70" y="325" text-anchor="end" class="label">Common Sense</text>
<text x="70" y="370" text-anchor="end" class="label">Ling. Accept.</text>
<!-- Bars - Sentiment -->
<rect x="80" y="85" width="306" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="105" width="298.2" height="18" fill="#94a3b8" rx="2"/>
<text x="392" y="98" class="value">51.0%</text>
<text x="384" y="118" class="value">49.7%</text>
<!-- Bars - NER nb -->
<rect x="80" y="130" width="394.2" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="150" width="390.6" height="18" fill="#94a3b8" rx="2"/>
<text x="480" y="143" class="value">65.7%</text>
<text x="476" y="163" class="value">65.1%</text>
<!-- Bars - NER nn -->
<rect x="80" y="175" width="426" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="195" width="419.4" height="18" fill="#94a3b8" rx="2"/>
<text x="512" y="188" class="value">71.0%</text>
<text x="505" y="208" class="value">69.9%</text>
<!-- Bars - Reading -->
<rect x="80" y="220" width="367.2" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="240" width="353.4" height="18" fill="#94a3b8" rx="2"/>
<text x="453" y="233" class="value">61.2%</text>
<text x="439" y="253" class="value">58.9%</text>
<!-- Bars - Summary -->
<rect x="80" y="265" width="380.4" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="285" width="378.6" height="18" fill="#94a3b8" rx="2"/>
<text x="466" y="278" class="value">63.4%</text>
<text x="464" y="298" class="value">63.1%</text>
<!-- Bars - Common Sense -->
<rect x="80" y="310" width="415.8" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="330" width="411" height="18" fill="#94a3b8" rx="2"/>
<text x="501" y="323" class="value">69.3%</text>
<text x="497" y="343" class="value">68.5%</text>
<!-- Bars - Linguistic Acceptability (biggest difference) -->
<rect x="80" y="355" width="218.4" height="18" fill="#3b82f6" rx="2"/>
<rect x="80" y="375" width="178.8" height="18" fill="#94a3b8" rx="2"/>
<text x="304" y="368" class="value">36.4% (+6.6%)</text>
<text x="264" y="388" class="value">29.8%</text>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,78 @@
<svg width="750" height="450" xmlns="http://www.w3.org/2000/svg">
<style>
.title { font: bold 18px sans-serif; fill: #333; }
.label { font: 11px sans-serif; fill: #333; }
.value { font: 10px sans-serif; fill: #333; }
.axis { font: 11px sans-serif; fill: #666; }
.legend { font: 12px sans-serif; fill: #333; }
.grid { stroke: #e5e7eb; stroke-width: 1; }
</style>
<!-- Background -->
<rect width="750" height="450" fill="#fafafa"/>
<!-- Title -->
<text x="375" y="30" text-anchor="middle" class="title">Task Performance Across Nordic Languages</text>
<!-- Legend -->
<rect x="200" y="50" width="14" height="14" fill="#1e40af"/>
<text x="218" y="62" class="legend">Danish</text>
<rect x="300" y="50" width="14" height="14" fill="#3b82f6"/>
<text x="318" y="62" class="legend">Swedish</text>
<rect x="400" y="50" width="14" height="14" fill="#60a5fa"/>
<text x="418" y="62" class="legend">Norwegian</text>
<rect x="520" y="50" width="14" height="14" fill="#93c5fd"/>
<text x="538" y="62" class="legend">Icelandic</text>
<!-- Grid lines -->
<line x1="100" y1="100" x2="100" y2="400" class="grid"/>
<line x1="100" y1="400" x2="700" y2="400" class="grid"/>
<line x1="100" y1="325" x2="700" y2="325" class="grid" stroke-dasharray="4"/>
<line x1="100" y1="250" x2="700" y2="250" class="grid" stroke-dasharray="4"/>
<line x1="100" y1="175" x2="700" y2="175" class="grid" stroke-dasharray="4"/>
<line x1="100" y1="100" x2="700" y2="100" class="grid" stroke-dasharray="4"/>
<!-- Y-axis labels -->
<text x="95" y="405" text-anchor="end" class="axis">0%</text>
<text x="95" y="330" text-anchor="end" class="axis">25%</text>
<text x="95" y="255" text-anchor="end" class="axis">50%</text>
<text x="95" y="180" text-anchor="end" class="axis">75%</text>
<text x="95" y="105" text-anchor="end" class="axis">100%</text>
<!-- X-axis labels -->
<text x="160" y="420" text-anchor="middle" class="label">NER</text>
<text x="280" y="420" text-anchor="middle" class="label">Reading</text>
<text x="400" y="420" text-anchor="middle" class="label">Summary</text>
<text x="520" y="420" text-anchor="middle" class="label">Knowledge</text>
<text x="640" y="420" text-anchor="middle" class="label">Common Sense</text>
<!-- NER bars (DA:53.8, SV:65, NO:71, IS:63.6) -->
<rect x="125" y="238.4" width="18" height="161.6" fill="#1e40af"/>
<rect x="145" y="205" width="18" height="195" fill="#3b82f6"/>
<rect x="165" y="186" width="18" height="214" fill="#60a5fa"/>
<rect x="185" y="209.2" width="18" height="190.8" fill="#93c5fd"/>
<!-- Reading Comprehension (DA:72.2, SV:72.4, NO:61.2, IS:58.6) -->
<rect x="245" y="183.4" width="18" height="216.6" fill="#1e40af"/>
<rect x="265" y="182.8" width="18" height="217.2" fill="#3b82f6"/>
<rect x="285" y="216.4" width="18" height="183.6" fill="#60a5fa"/>
<rect x="305" y="224.2" width="18" height="175.8" fill="#93c5fd"/>
<!-- Summarization (DA:65.2, SV:65.9, NO:63.4, IS:65.1) -->
<rect x="365" y="204.4" width="18" height="195.6" fill="#1e40af"/>
<rect x="385" y="202.3" width="18" height="197.7" fill="#3b82f6"/>
<rect x="405" y="209.8" width="18" height="190.2" fill="#60a5fa"/>
<rect x="425" y="204.7" width="18" height="195.3" fill="#93c5fd"/>
<!-- Knowledge (DA:79.3, SV:53.9, NO:35.3, IS:28.2) -->
<rect x="485" y="161.9" width="18" height="238.1" fill="#1e40af"/>
<rect x="505" y="238.3" width="18" height="161.7" fill="#3b82f6"/>
<rect x="525" y="294.1" width="18" height="105.9" fill="#60a5fa"/>
<rect x="545" y="315.4" width="18" height="84.6" fill="#93c5fd"/>
<!-- Common Sense (DA:67.7, SV:58.3, NO:69.3, IS:9.7) -->
<rect x="605" y="196.9" width="18" height="203.1" fill="#1e40af"/>
<rect x="625" y="225.1" width="18" height="174.9" fill="#3b82f6"/>
<rect x="645" y="192.1" width="18" height="207.9" fill="#60a5fa"/>
<rect x="665" y="370.9" width="18" height="29.1" fill="#93c5fd"/>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

89
chat_template.jinja Normal file
View File

@@ -0,0 +1,89 @@
{%- if tools %}
{{- '<|im_start|>system\n' }}
{%- if messages[0].role == 'system' %}
{{- messages[0].content + '\n\n' }}
{%- endif %}
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
{%- for tool in tools %}
{{- "\n" }}
{{- tool | tojson }}
{%- endfor %}
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
{%- else %}
{%- if messages[0].role == 'system' %}
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
{%- for message in messages[::-1] %}
{%- set index = (messages|length - 1) - loop.index0 %}
{%- 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>')) %}
{%- set ns.multi_step_tool = false %}
{%- set ns.last_query_index = index %}
{%- endif %}
{%- endfor %}
{%- for message in messages %}
{%- if message.content is string %}
{%- set content = message.content %}
{%- else %}
{%- set content = '' %}
{%- endif %}
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
{%- elif message.role == "assistant" %}
{%- set reasoning_content = '' %}
{%- if message.reasoning_content is string %}
{%- set reasoning_content = message.reasoning_content %}
{%- else %}
{%- if '</think>' in content %}
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
{%- endif %}
{%- endif %}
{%- if loop.index0 > ns.last_query_index %}
{%- if loop.last or (not loop.last and reasoning_content) %}
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- else %}
{{- '<|im_start|>' + message.role + '\n' + content }}
{%- endif %}
{%- if message.tool_calls %}
{%- for tool_call in message.tool_calls %}
{%- if (loop.first and content) or (not loop.first) %}
{{- '\n' }}
{%- endif %}
{%- if tool_call.function %}
{%- set tool_call = tool_call.function %}
{%- endif %}
{{- '<tool_call>\n{"name": "' }}
{{- tool_call.name }}
{{- '", "arguments": ' }}
{%- if tool_call.arguments is string %}
{{- tool_call.arguments }}
{%- else %}
{{- tool_call.arguments | tojson }}
{%- endif %}
{{- '}\n</tool_call>' }}
{%- endfor %}
{%- endif %}
{{- '<|im_end|>\n' }}
{%- elif message.role == "tool" %}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
{{- '<|im_start|>user' }}
{%- endif %}
{{- '\n<tool_response>\n' }}
{{- content }}
{{- '\n</tool_response>' }}
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
{{- '<|im_end|>\n' }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
{{- '<|im_start|>assistant\n' }}
{%- if enable_thinking is defined and enable_thinking is false %}
{{- '<think>\n\n</think>\n\n' }}
{%- endif %}
{%- endif %}

39
config.json Normal file
View File

@@ -0,0 +1,39 @@
{
"_name_or_path": "Qwen/Qwen3-30B-A3B-Instruct-2507",
"architectures": [
"Qwen3MoeForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 151643,
"decoder_sparse_step": 1,
"dtype": "bfloat16",
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 6144,
"max_position_embeddings": 262144,
"max_window_layers": 48,
"mlp_only_layers": [],
"model_type": "qwen3_moe",
"moe_intermediate_size": 768,
"norm_topk_prob": true,
"num_attention_heads": 32,
"num_experts": 128,
"num_experts_per_tok": 8,
"num_hidden_layers": 48,
"num_key_value_heads": 4,
"output_router_logits": false,
"rms_norm_eps": 1e-06,
"rope_scaling": null,
"rope_theta": 10000000,
"router_aux_loss_coef": 0.001,
"sliding_window": null,
"tie_word_embeddings": false,
"transformers_version": "4.56.1",
"use_cache": true,
"use_sliding_window": false,
"vocab_size": 151936
}

13
generation_config.json Normal file
View File

@@ -0,0 +1,13 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95,
"transformers_version": "4.56.1"
}

151388
merges.txt Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

18875
model.safetensors.index.json Normal file

File diff suppressed because it is too large Load Diff

31
special_tokens_map.json Normal file
View File

@@ -0,0 +1,31 @@
{
"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|>"
],
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

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

239
tokenizer_config.json Normal file
View File

@@ -0,0 +1,239 @@
{
"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": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"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
},
"151665": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151666": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151667": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151668": {
"content": "</think>",
"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,
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

1
vocab.json Normal file

File diff suppressed because one or more lines are too long