Upload 5 files
Browse files- .gitattributes +1 -0
- README.md +217 -1
- config.json +48 -0
- tokenizer.json +3 -0
- tokenizer_config.json +239 -0
- vocab.json +0 -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
CHANGED
|
@@ -1,3 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<img src="docs/mano-asr-banner.svg" alt="mano-asr" width="800">
|
| 3 |
+
</p>
|
| 4 |
+
|
| 5 |
+
<p align="center">
|
| 6 |
+
<a href="#"><img src="https://img.shields.io/badge/python-3.10+-3776AB?logo=python&logoColor=white" alt="Python"></a>
|
| 7 |
+
<a href="#"><img src="https://img.shields.io/badge/FastAPI-server-009688?logo=fastapi&logoColor=white" alt="FastAPI"></a>
|
| 8 |
+
<a href="#"><img src="https://img.shields.io/badge/MLX-Apple%20Silicon-000000?logo=apple&logoColor=white" alt="MLX"></a>
|
| 9 |
+
<a href="https://github.com/Mininglamp-AI/mano-asr/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Mininglamp-AI/mano-asr?color=blue" alt="License"></a>
|
| 10 |
+
<a href="https://github.com/Mininglamp-AI/mano-asr/stargazers"><img src="https://img.shields.io/github/stars/Mininglamp-AI/mano-asr?style=social" alt="Stars"></a>
|
| 11 |
+
</p>
|
| 12 |
+
|
| 13 |
---
|
| 14 |
+
|
| 15 |
+
## Introduction
|
| 16 |
+
|
| 17 |
+
**mano-asr** is a local speech recognition (ASR) service built for **vertical domains**, deeply optimized for Apple Silicon via [MLX](https://github.com/ml-explore/mlx). It works out of the box, runs fully locally, and keeps your data on your machine.
|
| 18 |
+
|
| 19 |
+
mano-asr is specially tuned for **internet / IT office** scenarios — meeting notes, technical discussions, product reviews, and engineering dictation — where English terms, acronyms, product names and jargon (e.g. `FastAPI`, `Kubernetes`, `PRD`, `Code Review`) appear frequently, bringing recognition accuracy on these terms to a usable level.
|
| 20 |
+
|
| 21 |
+
Core capabilities:
|
| 22 |
+
|
| 23 |
+
- 🎯 **Vertical-domain tuning** — specialized tuning for internet / IT office jargon and mixed Chinese-English speech.
|
| 24 |
+
- 🍎 **Native Apple Silicon** — MLX-based local inference on M-series chips, further optimized with our in-house acceleration framework Cider.
|
| 25 |
+
- 🔒 **Fully local, privacy-first** — audio and transcripts never leave your machine.
|
| 26 |
+
- ✂️ **VAD segmentation** — optional FSMN VAD splits long audio and transcribes segment by segment.
|
| 27 |
+
- 🧩 **Pluggable engines** — supports Fun-ASR-Nano, Qwen3-ASR and more base models, switchable with one command.
|
| 28 |
+
- ⚡ **One-command start** — install via `brew install`, then `mano-asr start`.
|
| 29 |
+
|
| 30 |
---
|
| 31 |
+
|
| 32 |
+
<p align="center">
|
| 33 |
+
<a href="#en-news">Changelog</a> ·
|
| 34 |
+
<a href="#en-examples">Usage</a> ·
|
| 35 |
+
<a href="#en-models">Models</a> ·
|
| 36 |
+
<a href="#en-install">Installation</a> ·
|
| 37 |
+
<a href="#en-api">API</a> ·
|
| 38 |
+
<a href="#en-license">License</a> ·
|
| 39 |
+
<a href="#en-acknowledgments">Acknowledgments</a> ·
|
| 40 |
+
</p>
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
<a id="en-news"></a>
|
| 45 |
+
|
| 46 |
+
## Changelog
|
| 47 |
+
|
| 48 |
+
See the full release history on the **[Releases](https://github.com/Mininglamp-AI/mano-asr/releases)** page.
|
| 49 |
+
|
| 50 |
+
<a id="en-examples"></a>
|
| 51 |
+
|
| 52 |
+
## Usage
|
| 53 |
+
|
| 54 |
+
The example below shows **audio translation**: transcribe speech and translate it into Chinese.
|
| 55 |
+
|
| 56 |
+
### CLI (recommended)
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
# On first run, the service auto-initializes and downloads the default model
|
| 60 |
+
mano-asr start
|
| 61 |
+
|
| 62 |
+
# Transcribe / translate an audio file
|
| 63 |
+
mano-asr transcribe assets/BAC009S0764W0129.wav
|
| 64 |
+
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
### Python API
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
from core.auto_model import AutoModel
|
| 71 |
+
|
| 72 |
+
model = AutoModel(
|
| 73 |
+
model="models/Mininglamp-2718/Mano-ASR-0.8B-Instruct-1.0-MLX-8bit",
|
| 74 |
+
vad_model="models/fsmn-vad-mlx", # optional: auto-segment long audio
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
text = model.generate(
|
| 78 |
+
"assets/BAC009S0764W0129.wav",
|
| 79 |
+
task="translate", # translation task
|
| 80 |
+
target_language="zh", # target language: Chinese
|
| 81 |
+
merge_vad=True,
|
| 82 |
+
)
|
| 83 |
+
print(text)
|
| 84 |
+
# -> "甚至出现交易几乎停滞的情况"
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### HTTP API
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
curl -X POST http://127.0.0.1:8787/v1/voice/transcribe \
|
| 91 |
+
-F "audio=@assets/BAC009S0764W0129.wav" \
|
| 92 |
+
-F "personal_context=## Terms\n- FastAPI\n- Kubernetes" \
|
| 93 |
+
-F "mode=smart"
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
```json
|
| 97 |
+
{
|
| 98 |
+
"status": 200,
|
| 99 |
+
"text": "transcribed text",
|
| 100 |
+
"m": "fun-asr-nano",
|
| 101 |
+
"engine": "mlx"
|
| 102 |
+
}
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
> Full API fields, limits and auth are documented under [API](#en-api).
|
| 106 |
+
|
| 107 |
+
<a id="en-models"></a>
|
| 108 |
+
|
| 109 |
+
## Models
|
| 110 |
+
|
| 111 |
+
mano-asr uses a pluggable engine design and supports several mainstream ASR base models. Switch with a single command: `mano-asr model use <name>`.
|
| 112 |
+
|
| 113 |
+
| Model | Engine | Base model | Quant | Size | Languages | Links |
|
| 114 |
+
| --- | --- | --- | --- | --- | --- | --- |
|
| 115 |
+
| **Mano-ASR-0.8B-Instruct-1.0-MLX-8bit** (default) | `funasr` | [Fun-ASR-Nano](https://github.com/FunAudioLLM/Fun-ASR) | - | 0.8 GB | ZH / EN | [HuggingFace](https://huggingface.co/Mininglamp-2718/Mano-ASR-0.8B-Instruct-1.0-MLX-8bit) · [ModelScope](https://www.modelscope.cn/models/Mininglamp2718/Mano-ASR-0.8B-Instruct-1.0-MLX-8bit) |
|
| 116 |
+
|
| 117 |
+
> The model is downloaded automatically from HuggingFace or ModelScope (China mirror); the source is chosen by network environment on first run.
|
| 118 |
+
|
| 119 |
+
<a id="en-install"></a>
|
| 120 |
+
|
| 121 |
+
## Installation
|
| 122 |
+
|
| 123 |
+
### Option 1: Homebrew (recommended)
|
| 124 |
+
|
| 125 |
+
```bash
|
| 126 |
+
brew tap mano-asr/mano-asr
|
| 127 |
+
brew install mano-asr
|
| 128 |
+
|
| 129 |
+
# Start (first run auto-initializes + downloads the default model)
|
| 130 |
+
mano-asr start
|
| 131 |
+
mano-asr doctor # environment check
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
### Option 2: From source
|
| 135 |
+
|
| 136 |
+
```bash
|
| 137 |
+
# 1. Dependency: ffmpeg (decodes non-WAV audio)
|
| 138 |
+
brew install ffmpeg
|
| 139 |
+
|
| 140 |
+
# 2. Clone + install
|
| 141 |
+
git clone https://github.com/Mininglamp-AI/mano-asr.git
|
| 142 |
+
cd mano-asr
|
| 143 |
+
python3 -m venv .venv && source .venv/bin/activate
|
| 144 |
+
pip install -U pip
|
| 145 |
+
pip install -e .
|
| 146 |
+
|
| 147 |
+
# 3. Download the model
|
| 148 |
+
hf download Mininglamp-2718/Mano-ASR-0.8B-Instruct-1.0-MLX-8bit \
|
| 149 |
+
--local-dir models/Mininglamp-2718/Mano-ASR-0.8B-Instruct-1.0-MLX-8bit
|
| 150 |
+
|
| 151 |
+
# Behind a China mirror:
|
| 152 |
+
# HF_ENDPOINT=https://hf-mirror.com hf download ...
|
| 153 |
+
|
| 154 |
+
# 4. Start the server
|
| 155 |
+
python3 server.py \
|
| 156 |
+
--model-path models/Mininglamp-2718/Mano-ASR-0.8B-Instruct-1.0-MLX-8bit \
|
| 157 |
+
--vad-model-path models/fsmn-vad-mlx \
|
| 158 |
+
--host 0.0.0.0 --port 8787 --load-on-startup
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
**Requirements:** macOS (Apple Silicon) · Python 3.10+ · `ffmpeg` / `ffprobe` on `PATH`.
|
| 162 |
+
|
| 163 |
+
<a id="en-api"></a>
|
| 164 |
+
|
| 165 |
+
## API
|
| 166 |
+
|
| 167 |
+
### `POST /v1/voice/transcribe`
|
| 168 |
+
|
| 169 |
+
Transcribe a single uploaded audio file. Request type: `multipart/form-data`.
|
| 170 |
+
|
| 171 |
+
| Field | Type | Required | Description |
|
| 172 |
+
| --- | --- | --- | --- |
|
| 173 |
+
| `audio` | file | yes | Audio file. Supported: `.wav` `.mp3` `.ogg` `.webm` `.m4a` `.flac` |
|
| 174 |
+
| `context_text` | string | no | Existing text for append/edit modes; last 5000 chars kept |
|
| 175 |
+
| `chat_context` | string | no | Chat context; last 20000 chars kept |
|
| 176 |
+
| `personal_context` | string | no | Personal correction / hotword context; last 10000 chars kept |
|
| 177 |
+
| `member_context` | string | no | Member context; last 5000 chars kept |
|
| 178 |
+
| `mode` | string | no | `smart` / `append_only` / `edit_only`, default `smart` |
|
| 179 |
+
|
| 180 |
+
**Limits:** default max file `30 MiB`, max duration `660` s; `edit_only` requires `context_text`.
|
| 181 |
+
|
| 182 |
+
### `GET /v1/voice/config`
|
| 183 |
+
|
| 184 |
+
Returns current service limits and engine metadata.
|
| 185 |
+
|
| 186 |
+
```bash
|
| 187 |
+
curl http://127.0.0.1:8787/v1/voice/config
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
### Authentication
|
| 191 |
+
|
| 192 |
+
Disabled by default. If started with `--auth-token`, requests must carry `Authorization: Bearer <token>`.
|
| 193 |
+
|
| 194 |
+
```bash
|
| 195 |
+
python3 server.py --model-path <path> --auth-token "$MANO_ASR_TOKEN"
|
| 196 |
+
```
|
| 197 |
+
|
| 198 |
+
<a id="en-license"></a>
|
| 199 |
+
|
| 200 |
+
## License
|
| 201 |
+
|
| 202 |
+
Released under the [MIT License](LICENSE).
|
| 203 |
+
|
| 204 |
+
Copyright (c) 2026 MININGLAMP Technology.
|
| 205 |
+
|
| 206 |
+
<a id="en-acknowledgments"></a>
|
| 207 |
+
|
| 208 |
+
## Acknowledgments
|
| 209 |
+
|
| 210 |
+
mano-asr would not be possible without these excellent open-source projects:
|
| 211 |
+
|
| 212 |
+
- [**MLX**](https://github.com/ml-explore/mlx) & [**mlx-audio**](https://github.com/Blaizzy/mlx-audio) — Apple's machine-learning framework and audio toolkit, the foundation of mano-asr's local inference.
|
| 213 |
+
- [**FunASR / FunAudioLLM**](https://github.com/modelscope/FunASR) — source of Fun-ASR-Nano and FSMN-VAD, providing strong Chinese speech recognition.
|
| 214 |
+
- [**Qwen3**](https://github.com/QwenLM/Qwen3) — the base model behind the Qwen3-ASR engine.
|
| 215 |
+
- [**mlx-community**](https://huggingface.co/mlx-community) — high-quality MLX quantized models.
|
| 216 |
+
- [**ModelScope**](https://github.com/modelscope/modelscope) & [**Hugging Face**](https://huggingface.co/) — model hosting and distribution.
|
| 217 |
+
- [**FastAPI**](https://github.com/fastapi/fastapi) — high-performance web framework.
|
| 218 |
+
|
| 219 |
+
Thanks to everyone contributing to the open-source speech recognition community.
|
config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "funasr",
|
| 3 |
+
"sample_rate": 16000,
|
| 4 |
+
"n_mels": 80,
|
| 5 |
+
"lfr_m": 7,
|
| 6 |
+
"lfr_n": 6,
|
| 7 |
+
"encoder": {
|
| 8 |
+
"input_dim": 560,
|
| 9 |
+
"encoder_dim": 512,
|
| 10 |
+
"num_heads": 4,
|
| 11 |
+
"ffn_dim": 2048,
|
| 12 |
+
"kernel_size": 11,
|
| 13 |
+
"num_encoders0": 1,
|
| 14 |
+
"num_encoders": 49,
|
| 15 |
+
"num_tp_encoders": 20,
|
| 16 |
+
"dropout": 0.0
|
| 17 |
+
},
|
| 18 |
+
"adaptor": {
|
| 19 |
+
"downsample_rate": 1,
|
| 20 |
+
"encoder_dim": 512,
|
| 21 |
+
"llm_dim": 1024,
|
| 22 |
+
"ffn_dim": 2048,
|
| 23 |
+
"n_layer": 2,
|
| 24 |
+
"attention_heads": 8,
|
| 25 |
+
"dropout": 0.0
|
| 26 |
+
},
|
| 27 |
+
"llm": {
|
| 28 |
+
"vocab_size": 151936,
|
| 29 |
+
"hidden_size": 1024,
|
| 30 |
+
"num_hidden_layers": 28,
|
| 31 |
+
"num_attention_heads": 16,
|
| 32 |
+
"num_key_value_heads": 8,
|
| 33 |
+
"intermediate_size": 3072,
|
| 34 |
+
"max_position_embeddings": 40960,
|
| 35 |
+
"rope_theta": 1000000.0,
|
| 36 |
+
"rms_norm_eps": 1e-06,
|
| 37 |
+
"tie_word_embeddings": false,
|
| 38 |
+
"head_dim": 128
|
| 39 |
+
},
|
| 40 |
+
"quantization": {
|
| 41 |
+
"bits": 8,
|
| 42 |
+
"group_size": 64,
|
| 43 |
+
"quantized_components": [
|
| 44 |
+
"llm.model.layers",
|
| 45 |
+
"audio_adaptor"
|
| 46 |
+
]
|
| 47 |
+
}
|
| 48 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
|
| 3 |
+
size 11422654
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"151643": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"151644": {
|
| 14 |
+
"content": "<|im_start|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"special": true
|
| 20 |
+
},
|
| 21 |
+
"151645": {
|
| 22 |
+
"content": "<|im_end|>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false,
|
| 27 |
+
"special": true
|
| 28 |
+
},
|
| 29 |
+
"151646": {
|
| 30 |
+
"content": "<|object_ref_start|>",
|
| 31 |
+
"lstrip": false,
|
| 32 |
+
"normalized": false,
|
| 33 |
+
"rstrip": false,
|
| 34 |
+
"single_word": false,
|
| 35 |
+
"special": true
|
| 36 |
+
},
|
| 37 |
+
"151647": {
|
| 38 |
+
"content": "<|object_ref_end|>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false,
|
| 43 |
+
"special": true
|
| 44 |
+
},
|
| 45 |
+
"151648": {
|
| 46 |
+
"content": "<|box_start|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"special": true
|
| 52 |
+
},
|
| 53 |
+
"151649": {
|
| 54 |
+
"content": "<|box_end|>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false,
|
| 59 |
+
"special": true
|
| 60 |
+
},
|
| 61 |
+
"151650": {
|
| 62 |
+
"content": "<|quad_start|>",
|
| 63 |
+
"lstrip": false,
|
| 64 |
+
"normalized": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"single_word": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
"151651": {
|
| 70 |
+
"content": "<|quad_end|>",
|
| 71 |
+
"lstrip": false,
|
| 72 |
+
"normalized": false,
|
| 73 |
+
"rstrip": false,
|
| 74 |
+
"single_word": false,
|
| 75 |
+
"special": true
|
| 76 |
+
},
|
| 77 |
+
"151652": {
|
| 78 |
+
"content": "<|vision_start|>",
|
| 79 |
+
"lstrip": false,
|
| 80 |
+
"normalized": false,
|
| 81 |
+
"rstrip": false,
|
| 82 |
+
"single_word": false,
|
| 83 |
+
"special": true
|
| 84 |
+
},
|
| 85 |
+
"151653": {
|
| 86 |
+
"content": "<|vision_end|>",
|
| 87 |
+
"lstrip": false,
|
| 88 |
+
"normalized": false,
|
| 89 |
+
"rstrip": false,
|
| 90 |
+
"single_word": false,
|
| 91 |
+
"special": true
|
| 92 |
+
},
|
| 93 |
+
"151654": {
|
| 94 |
+
"content": "<|vision_pad|>",
|
| 95 |
+
"lstrip": false,
|
| 96 |
+
"normalized": false,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"single_word": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
"151655": {
|
| 102 |
+
"content": "<|image_pad|>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false,
|
| 107 |
+
"special": true
|
| 108 |
+
},
|
| 109 |
+
"151656": {
|
| 110 |
+
"content": "<|video_pad|>",
|
| 111 |
+
"lstrip": false,
|
| 112 |
+
"normalized": false,
|
| 113 |
+
"rstrip": false,
|
| 114 |
+
"single_word": false,
|
| 115 |
+
"special": true
|
| 116 |
+
},
|
| 117 |
+
"151657": {
|
| 118 |
+
"content": "<tool_call>",
|
| 119 |
+
"lstrip": false,
|
| 120 |
+
"normalized": false,
|
| 121 |
+
"rstrip": false,
|
| 122 |
+
"single_word": false,
|
| 123 |
+
"special": false
|
| 124 |
+
},
|
| 125 |
+
"151658": {
|
| 126 |
+
"content": "</tool_call>",
|
| 127 |
+
"lstrip": false,
|
| 128 |
+
"normalized": false,
|
| 129 |
+
"rstrip": false,
|
| 130 |
+
"single_word": false,
|
| 131 |
+
"special": false
|
| 132 |
+
},
|
| 133 |
+
"151659": {
|
| 134 |
+
"content": "<|fim_prefix|>",
|
| 135 |
+
"lstrip": false,
|
| 136 |
+
"normalized": false,
|
| 137 |
+
"rstrip": false,
|
| 138 |
+
"single_word": false,
|
| 139 |
+
"special": false
|
| 140 |
+
},
|
| 141 |
+
"151660": {
|
| 142 |
+
"content": "<|fim_middle|>",
|
| 143 |
+
"lstrip": false,
|
| 144 |
+
"normalized": false,
|
| 145 |
+
"rstrip": false,
|
| 146 |
+
"single_word": false,
|
| 147 |
+
"special": false
|
| 148 |
+
},
|
| 149 |
+
"151661": {
|
| 150 |
+
"content": "<|fim_suffix|>",
|
| 151 |
+
"lstrip": false,
|
| 152 |
+
"normalized": false,
|
| 153 |
+
"rstrip": false,
|
| 154 |
+
"single_word": false,
|
| 155 |
+
"special": false
|
| 156 |
+
},
|
| 157 |
+
"151662": {
|
| 158 |
+
"content": "<|fim_pad|>",
|
| 159 |
+
"lstrip": false,
|
| 160 |
+
"normalized": false,
|
| 161 |
+
"rstrip": false,
|
| 162 |
+
"single_word": false,
|
| 163 |
+
"special": false
|
| 164 |
+
},
|
| 165 |
+
"151663": {
|
| 166 |
+
"content": "<|repo_name|>",
|
| 167 |
+
"lstrip": false,
|
| 168 |
+
"normalized": false,
|
| 169 |
+
"rstrip": false,
|
| 170 |
+
"single_word": false,
|
| 171 |
+
"special": false
|
| 172 |
+
},
|
| 173 |
+
"151664": {
|
| 174 |
+
"content": "<|file_sep|>",
|
| 175 |
+
"lstrip": false,
|
| 176 |
+
"normalized": false,
|
| 177 |
+
"rstrip": false,
|
| 178 |
+
"single_word": false,
|
| 179 |
+
"special": false
|
| 180 |
+
},
|
| 181 |
+
"151665": {
|
| 182 |
+
"content": "<tool_response>",
|
| 183 |
+
"lstrip": false,
|
| 184 |
+
"normalized": false,
|
| 185 |
+
"rstrip": false,
|
| 186 |
+
"single_word": false,
|
| 187 |
+
"special": false
|
| 188 |
+
},
|
| 189 |
+
"151666": {
|
| 190 |
+
"content": "</tool_response>",
|
| 191 |
+
"lstrip": false,
|
| 192 |
+
"normalized": false,
|
| 193 |
+
"rstrip": false,
|
| 194 |
+
"single_word": false,
|
| 195 |
+
"special": false
|
| 196 |
+
},
|
| 197 |
+
"151667": {
|
| 198 |
+
"content": "<think>",
|
| 199 |
+
"lstrip": false,
|
| 200 |
+
"normalized": false,
|
| 201 |
+
"rstrip": false,
|
| 202 |
+
"single_word": false,
|
| 203 |
+
"special": false
|
| 204 |
+
},
|
| 205 |
+
"151668": {
|
| 206 |
+
"content": "</think>",
|
| 207 |
+
"lstrip": false,
|
| 208 |
+
"normalized": false,
|
| 209 |
+
"rstrip": false,
|
| 210 |
+
"single_word": false,
|
| 211 |
+
"special": false
|
| 212 |
+
}
|
| 213 |
+
},
|
| 214 |
+
"additional_special_tokens": [
|
| 215 |
+
"<|im_start|>",
|
| 216 |
+
"<|im_end|>",
|
| 217 |
+
"<|object_ref_start|>",
|
| 218 |
+
"<|object_ref_end|>",
|
| 219 |
+
"<|box_start|>",
|
| 220 |
+
"<|box_end|>",
|
| 221 |
+
"<|quad_start|>",
|
| 222 |
+
"<|quad_end|>",
|
| 223 |
+
"<|vision_start|>",
|
| 224 |
+
"<|vision_end|>",
|
| 225 |
+
"<|vision_pad|>",
|
| 226 |
+
"<|image_pad|>",
|
| 227 |
+
"<|video_pad|>"
|
| 228 |
+
],
|
| 229 |
+
"bos_token": null,
|
| 230 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
|
| 231 |
+
"clean_up_tokenization_spaces": false,
|
| 232 |
+
"eos_token": "<|im_end|>",
|
| 233 |
+
"errors": "replace",
|
| 234 |
+
"model_max_length": 131072,
|
| 235 |
+
"pad_token": "<|endoftext|>",
|
| 236 |
+
"split_special_tokens": false,
|
| 237 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 238 |
+
"unk_token": null
|
| 239 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|