Audio Classification
Transformers
Safetensors
qwen3_omni_moe
text-to-audio
audio
turn-taking
end-of-turn-detection
interruption-detection
lora
ms-swift
custom-inference
Instructions to use Beagledata/Turn-Detection-S1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Beagledata/Turn-Detection-S1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="Beagledata/Turn-Detection-S1")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Beagledata/Turn-Detection-S1") model = AutoModelForMultimodalLM.from_pretrained("Beagledata/Turn-Detection-S1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
rename
#2
by Beagledata - opened
- .gitattributes +0 -1
- EVALUATION.md +6 -6
- NOTICE +1 -1
- README.md +59 -28
- README_zh.md +62 -29
- image/01_metric_comparison.png +2 -2
- image/02_latency_comparison.png +2 -2
- release_manifest.json +10 -11
.gitattributes
CHANGED
|
@@ -4,4 +4,3 @@
|
|
| 4 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 5 |
image/01_metric_comparison.png filter=lfs diff=lfs merge=lfs -text
|
| 6 |
image/02_latency_comparison.png filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
image/效果对比.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 4 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 5 |
image/01_metric_comparison.png filter=lfs diff=lfs merge=lfs -text
|
| 6 |
image/02_latency_comparison.png filter=lfs diff=lfs merge=lfs -text
|
|
|
EVALUATION.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
# Turn-Detection-
|
| 2 |
|
| 3 |
[返回模型主页](README.md)
|
| 4 |
|
| 5 |
-
开源发布名为 **Turn-Detection-
|
| 6 |
|
| 7 |
## 训练数据与配置
|
| 8 |
|
|
@@ -69,7 +69,7 @@ Easy-Turn 的 listening / speaking 准确率分别为 **97.78%(440/450)**、
|
|
| 69 |
|
| 70 |
### 共同样本上的模型参照
|
| 71 |
|
| 72 |
-
Easy-Turn 下表只取 complete/incomplete 的 **600 条**共同样本;Turn-Detection-
|
| 73 |
|
| 74 |
| 数据集 | 模型 | N | 准确率 | 精准率(宏平均) | 召回率(宏平均) | F1(宏平均) |
|
| 75 |
| --- | --- | --- | --- | --- | --- | --- |
|
|
@@ -77,14 +77,14 @@ Easy-Turn 下表只取 complete/incomplete 的 **600 条**共同样本;Turn-De
|
|
| 77 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% |
|
| 78 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% |
|
| 79 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% |
|
| 80 |
-
| easyturn | Turn-Detection-
|
| 81 |
| smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% |
|
| 82 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% |
|
| 83 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% |
|
| 84 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% |
|
| 85 |
-
| smart-test | Turn-Detection-
|
| 86 |
|
| 87 |
-
Turn-Detection-
|
| 88 |
|
| 89 |
### 评估协议与耗时
|
| 90 |
|
|
|
|
| 1 |
+
# Turn-Detection-S1:训练与评估详情
|
| 2 |
|
| 3 |
[返回模型主页](README.md)
|
| 4 |
|
| 5 |
+
开源发布名为 **Turn-Detection-S1**。
|
| 6 |
|
| 7 |
## 训练数据与配置
|
| 8 |
|
|
|
|
| 69 |
|
| 70 |
### 共同样本上的模型参照
|
| 71 |
|
| 72 |
+
Easy-Turn 下表只取 complete/incomplete 的 **600 条**共同样本;Turn-Detection-S1 为 **589/600**,与全量 800 条的 789/800 是不同范围。Smart-Test 使用固定 4,000 条子集。Turn-Detection-S1 使用本次结果,其他模型保留历史结果。
|
| 73 |
|
| 74 |
| 数据集 | 模型 | N | 准确率 | 精准率(宏平均) | 召回率(宏平均) | F1(宏平均) |
|
| 75 |
| --- | --- | --- | --- | --- | --- | --- |
|
|
|
|
| 77 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% |
|
| 78 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% |
|
| 79 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% |
|
| 80 |
+
| easyturn | Turn-Detection-S1 | 600 | 98.17% | 98.33% | 98.17% | 98.25% |
|
| 81 |
| smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% |
|
| 82 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% |
|
| 83 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% |
|
| 84 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% |
|
| 85 |
+
| smart-test | Turn-Detection-S1 | 4000 | 96.78% | 96.87% | 96.78% | 96.81% |
|
| 86 |
|
| 87 |
+
Turn-Detection-S1 获得了按标签规则构造的助手状态,其他音频模型未获得该状态,且服务和环境不同。因此表格只作描述性参照,不能据此将差值全部归因于微调或声称同等输入条件下的优势。
|
| 88 |
|
| 89 |
### 评估协议与耗时
|
| 90 |
|
NOTICE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
Turn-Detection-
|
| 2 |
|
| 3 |
This release is a fine-tuned derivative of Qwen3-Omni-30B-A3B-Instruct,
|
| 4 |
developed and released by the Qwen team. Rights in the original model
|
|
|
|
| 1 |
+
Turn-Detection-S1
|
| 2 |
|
| 3 |
This release is a fine-tuned derivative of Qwen3-Omni-30B-A3B-Instruct,
|
| 4 |
developed and released by the Qwen team. Rights in the original model
|
README.md
CHANGED
|
@@ -17,17 +17,17 @@ datasets:
|
|
| 17 |
- pipecat-ai/smart-turn-data-v3.2-train
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Turn-Detection-
|
| 21 |
|
| 22 |
### Audio turn completion, interruptions, and backchannels
|
| 23 |
|
| 24 |
**Fine-tuned Qwen3-Omni-30B-A3B-Instruct · Five semantic actions / seven state labels · Apache-2.0**
|
| 25 |
|
| 26 |
-
[
|
| 27 |
|
| 28 |
**Language:** English | [中文](README_zh.md)
|
| 29 |
|
| 30 |
-
Turn-Detection-
|
| 31 |
|
| 32 |
## Contents
|
| 33 |
|
|
@@ -50,7 +50,7 @@ Turn-Detection-Jev predicts when a speech assistant should consider responding,
|
|
| 50 |
| Interruption and backchannel | Distinguishes completed interruptions, brief feedback, unfinished speech, and background during playback |
|
| 51 |
| State-conditioned scoring | Uses three listening labels or four speaking labels according to caller-supplied playback state |
|
| 52 |
| Single-forward prediction | Uses Qwen3-Omni-30B-A3B-Instruct audio understanding and reads candidate answer-token logits in one forward pass, without generating explanations |
|
| 53 |
-
| Application integration | The
|
| 54 |
| Open weights | Apache-2.0, retaining attribution to the Qwen3-Omni-30B-A3B-Instruct base model |
|
| 55 |
|
| 56 |
## Labels
|
|
@@ -71,7 +71,7 @@ The application must provide the real `assistant_speaking` state. The same words
|
|
| 71 |
|
| 72 |
### Public evaluation sets
|
| 73 |
|
| 74 |
-
Turn-Detection-
|
| 75 |
|
| 76 |
| Dataset | Samples | Correct | Accuracy | Semantic Macro-F1 |
|
| 77 |
| --- | ---: | ---: | ---: | ---: |
|
|
@@ -92,18 +92,18 @@ The main comparison uses original semantic labels: listen_complete→complete; l
|
|
| 92 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% |
|
| 93 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% |
|
| 94 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% |
|
| 95 |
-
| easyturn | Turn-Detection-
|
| 96 |
| smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% |
|
| 97 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% |
|
| 98 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% |
|
| 99 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% |
|
| 100 |
-
| smart-test | Turn-Detection-
|
| 101 |
|
| 102 |

|
| 103 |
|
| 104 |
Accuracy is computed over all shared samples. Precision, recall, and F1 are equally averaged over the two ground-truth target classes, complete and incomplete. Predictions outside those targets remain errors and are not renormalized.
|
| 105 |
|
| 106 |
-
Turn-Detection-
|
| 107 |
|
| 108 |
### Client request latency
|
| 109 |
|
|
@@ -113,16 +113,16 @@ Turn-Detection-Jev received constructed assistant-state metadata that the other
|
|
| 113 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 64.91 | 47.66 | 54.51 | 15.41 |
|
| 114 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 5.36 | 4.18 | 5.26 | 186.68 |
|
| 115 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 222.09 | 226.87 | 247.68 | 4.50 |
|
| 116 |
-
| easyturn | Turn-Detection-
|
| 117 |
| smart-test | TurnSense 1.1 GPU | 4000 | 543.53 | 649.01 | 659.98 | 1.84 |
|
| 118 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 165.56 | 192.63 | 296.12 | 6.04 |
|
| 119 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 4.07 | 3.42 | 4.63 | 245.65 |
|
| 120 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 229.76 | 221.62 | 275.89 | 4.35 |
|
| 121 |
-
| smart-test | Turn-Detection-
|
| 122 |
|
| 123 |

|
| 124 |
|
| 125 |
-
Turn-Detection-
|
| 126 |
|
| 127 |
The chart uses logarithmic axes. Historical ONNX runs used warmup=20 and remote runs warmup=0. ONNX timing includes mixing, resampling, features and inference; remote timing additionally includes encoding, HTTP, queueing and parsing. Both historical paths exclude file reading/decoding, whereas this Jev run includes it. Hardware, models and execution environments also differ, so this is not a controlled speed ranking.
|
| 128 |
|
|
@@ -130,19 +130,19 @@ Table samples/s equals N × 1000 / cumulative per-sample latency; it is neither
|
|
| 130 |
|
| 131 |
## Quick start
|
| 132 |
|
| 133 |
-
This Hugging Face repository contains model artifacts and documentation. Inference, serving, evaluation tools, and test-set instructions are
|
| 134 |
|
| 135 |
-
|
| 136 |
|
| 137 |
```bash
|
| 138 |
-
|
| 139 |
-
cd Turn-Detection-
|
| 140 |
-
|
| 141 |
```
|
| 142 |
|
| 143 |
### 1. Install dependencies
|
| 144 |
|
| 145 |
-
Activate an isolated Python >= 3.10 environment and install CUDA-enabled PyTorch suitable for the server first. From
|
| 146 |
|
| 147 |
```bash
|
| 148 |
bash scripts/01_install.sh
|
|
@@ -161,7 +161,7 @@ This runs `python -m pip install -e '.[datasets]'` and prints the PyTorch versio
|
|
| 161 |
Before step 2, keep this layout in the code repository when using default paths:
|
| 162 |
|
| 163 |
```text
|
| 164 |
-
Turn-Detection-
|
| 165 |
├── datasets/
|
| 166 |
│ ├── README.md # Dataset instructions; recommended
|
| 167 |
│ ├── Easy-Turn-Testset/ # Complete original Easy-Turn test set
|
|
@@ -213,7 +213,7 @@ To change the output directory, set the same `DATASETS_DIR` for steps 2 and 3:
|
|
| 213 |
EASYTURN_DIR=/path/to/Easy-Turn-Testset \
|
| 214 |
SMART_TEST_DIR=/path/to/smart-turn-data-v3.2-test \
|
| 215 |
DATASETS_DIR=datasets/v3-public-new bash scripts/02_validate_data.sh
|
| 216 |
-
DATASETS_DIR=datasets/v3-public-new bash scripts/03_evaluate.sh
|
| 217 |
```
|
| 218 |
|
| 219 |
Equivalent direct commands (choose either these or the script):
|
|
@@ -229,30 +229,30 @@ python evaluate.py --manifest datasets/v3-public/smart-test-4000/test.jsonl --va
|
|
| 229 |
|
| 230 |
### 3. Evaluate merged weights
|
| 231 |
|
| 232 |
-
Place the full model
|
| 233 |
|
| 234 |
```bash
|
| 235 |
bash scripts/03_evaluate.sh
|
| 236 |
|
| 237 |
# Optional: specify a model directory and a new output directory.
|
| 238 |
-
# Relative paths are resolved from
|
| 239 |
-
bash scripts/03_evaluate.sh models/Turn-Detection-
|
| 240 |
```
|
| 241 |
|
| 242 |
Alternatively, run the equivalent commands directly (choose either the script or these commands):
|
| 243 |
|
| 244 |
```bash
|
| 245 |
RUN_OUTPUT="results/runs/merged-$(date +%Y%m%d_%H%M%S)-$$"
|
| 246 |
-
python evaluate.py --model
|
| 247 |
--device cuda:0 --dtype bfloat16 --attn-implementation sdpa \
|
| 248 |
-
--calibration
|
| 249 |
--manifest datasets/v3-public/easyturn/test.jsonl --out "$RUN_OUTPUT/easyturn" \
|
| 250 |
--manifest datasets/v3-public/smart-test-4000/test.jsonl --out "$RUN_OUTPUT/smart-test-4000"
|
| 251 |
```
|
| 252 |
|
| 253 |
-
By default this reads the converted data from `datasets/v3-public/` validated in step 2. This starts one `evaluate.py` process, loads the model once and sequentially evaluates all 800 Easy-Turn and 4000 Smart-Test samples, without `--limit`. It uses native Transformers/PyTorch, one GPU (`cuda:0`), BF16, SDPA and temperature calibration from `
|
| 254 |
|
| 255 |
-
The script now loads `
|
| 256 |
|
| 257 |
```bash
|
| 258 |
CALIBRATION=/path/to/calibration.json bash scripts/03_evaluate.sh /path/to/model
|
|
@@ -268,8 +268,39 @@ Temperature scaling adjusts probabilities and confidence. Positive temperature p
|
|
| 268 |
|
| 269 |
Each run defaults to a new `results/runs/merged-TIMESTAMP-PID/` directory with per-dataset `predictions.jsonl` and `report.json` files. Inspect `classification.accuracy`, `classification.macro_f1`, `semantic.macro_f1` and `is_full_run=true`. The main benchmark table reports semantic Macro-F1. A specified output directory must not already exist; scripts stop on errors.
|
| 270 |
|
| 271 |
-
These are single-window results conditioned on constructed `assistant_speaking` state. Published
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
## Training and evaluation
|
| 275 |
|
|
@@ -293,4 +324,4 @@ Thanks to Qwen, ms-swift, OmniJev/OneJev, Easy-Turn, Smart-Turn and MUSAN. Datas
|
|
| 293 |
|
| 294 |
## Source code and feedback
|
| 295 |
|
| 296 |
-
[
|
|
|
|
| 17 |
- pipecat-ai/smart-turn-data-v3.2-train
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# Turn-Detection-S1
|
| 21 |
|
| 22 |
### Audio turn completion, interruptions, and backchannels
|
| 23 |
|
| 24 |
**Fine-tuned Qwen3-Omni-30B-A3B-Instruct · Five semantic actions / seven state labels · Apache-2.0**
|
| 25 |
|
| 26 |
+
[Model weights](https://huggingface.co/Beagledata/Turn-Detection-S1) · [Quick start](#quick-start) · [License](LICENSE)
|
| 27 |
|
| 28 |
**Language:** English | [中文](README_zh.md)
|
| 29 |
|
| 30 |
+
Turn-Detection-S1 predicts when a speech assistant should consider responding, waiting, or handling a user interruption. It takes audio and the application's current assistant playback state, then scores the labels available in that state. It is fine-tuned from [Qwen3-Omni-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Omni-30B-A3B-Instruct).
|
| 31 |
|
| 32 |
## Contents
|
| 33 |
|
|
|
|
| 50 |
| Interruption and backchannel | Distinguishes completed interruptions, brief feedback, unfinished speech, and background during playback |
|
| 51 |
| State-conditioned scoring | Uses three listening labels or four speaking labels according to caller-supplied playback state |
|
| 52 |
| Single-forward prediction | Uses Qwen3-Omni-30B-A3B-Instruct audio understanding and reads candidate answer-token logits in one forward pass, without generating explanations |
|
| 53 |
+
| Application integration | The runtime in `eval/` provides CLI inference and an HTTP API returning labels and probabilities |
|
| 54 |
| Open weights | Apache-2.0, retaining attribution to the Qwen3-Omni-30B-A3B-Instruct base model |
|
| 55 |
|
| 56 |
## Labels
|
|
|
|
| 71 |
|
| 72 |
### Public evaluation sets
|
| 73 |
|
| 74 |
+
Turn-Detection-S1 scores come from the complete native Transformers run `merged-20261111_051726-1672084` on 2026-11-11, using temperature T=1 with calibration disabled. Other models retain their historical results.
|
| 75 |
|
| 76 |
| Dataset | Samples | Correct | Accuracy | Semantic Macro-F1 |
|
| 77 |
| --- | ---: | ---: | ---: | ---: |
|
|
|
|
| 92 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% |
|
| 93 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% |
|
| 94 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% |
|
| 95 |
+
| easyturn | Turn-Detection-S1 | 600 | 98.17% | 98.33% | 98.17% | 98.25% |
|
| 96 |
| smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% |
|
| 97 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% |
|
| 98 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% |
|
| 99 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% |
|
| 100 |
+
| smart-test | Turn-Detection-S1 | 4000 | 96.78% | 96.87% | 96.78% | 96.81% |
|
| 101 |
|
| 102 |

|
| 103 |
|
| 104 |
Accuracy is computed over all shared samples. Precision, recall, and F1 are equally averaged over the two ground-truth target classes, complete and incomplete. Predictions outside those targets remain errors and are not renormalized.
|
| 105 |
|
| 106 |
+
Turn-Detection-S1 received constructed assistant-state metadata that the other audio models did not receive. Services and execution environments also differ. These figures compare the current S1 run with historical baselines; they are not a controlled comparison with identical information. The TurnSense figures here come from our evaluation, not its official model card.
|
| 107 |
|
| 108 |
### Client request latency
|
| 109 |
|
|
|
|
| 113 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 64.91 | 47.66 | 54.51 | 15.41 |
|
| 114 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 5.36 | 4.18 | 5.26 | 186.68 |
|
| 115 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 222.09 | 226.87 | 247.68 | 4.50 |
|
| 116 |
+
| easyturn | Turn-Detection-S1 | 600 | 120.38 | 94.68 | 160.56 | 8.31 |
|
| 117 |
| smart-test | TurnSense 1.1 GPU | 4000 | 543.53 | 649.01 | 659.98 | 1.84 |
|
| 118 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 165.56 | 192.63 | 296.12 | 6.04 |
|
| 119 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 4.07 | 3.42 | 4.63 | 245.65 |
|
| 120 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 229.76 | 221.62 | 275.89 | 4.35 |
|
| 121 |
+
| smart-test | Turn-Detection-S1 | 4000 | 97.50 | 96.29 | 110.90 | 10.26 |
|
| 122 |
|
| 123 |

|
| 124 |
|
| 125 |
+
Turn-Detection-S1 latency comes from the native Transformers run above and includes local audio reading/decoding, preprocessing and inference. First-call overhead is retained; independent GPU kernel time was not measured. Other models retain historical timing.
|
| 126 |
|
| 127 |
The chart uses logarithmic axes. Historical ONNX runs used warmup=20 and remote runs warmup=0. ONNX timing includes mixing, resampling, features and inference; remote timing additionally includes encoding, HTTP, queueing and parsing. Both historical paths exclude file reading/decoding, whereas this Jev run includes it. Hardware, models and execution environments also differ, so this is not a controlled speed ranking.
|
| 128 |
|
|
|
|
| 130 |
|
| 131 |
## Quick start
|
| 132 |
|
| 133 |
+
This Hugging Face repository contains model artifacts and documentation at its root. Inference, serving, evaluation tools, and test-set instructions are included in `eval/`. Run the commands below from `eval/`.
|
| 134 |
|
| 135 |
+
Download the repository from Hugging Face, including the code in `eval/` (test WAV files are prepared separately):
|
| 136 |
|
| 137 |
```bash
|
| 138 |
+
hf download Beagledata/Turn-Detection-S1 --local-dir Turn-Detection-S1
|
| 139 |
+
cd Turn-Detection-S1
|
| 140 |
+
cd eval
|
| 141 |
```
|
| 142 |
|
| 143 |
### 1. Install dependencies
|
| 144 |
|
| 145 |
+
Activate an isolated Python >= 3.10 environment and install CUDA-enabled PyTorch suitable for the server first. From `eval/`, run:
|
| 146 |
|
| 147 |
```bash
|
| 148 |
bash scripts/01_install.sh
|
|
|
|
| 161 |
Before step 2, keep this layout in the code repository when using default paths:
|
| 162 |
|
| 163 |
```text
|
| 164 |
+
Turn-Detection-S1/eval/
|
| 165 |
├── datasets/
|
| 166 |
│ ├── README.md # Dataset instructions; recommended
|
| 167 |
│ ├── Easy-Turn-Testset/ # Complete original Easy-Turn test set
|
|
|
|
| 213 |
EASYTURN_DIR=/path/to/Easy-Turn-Testset \
|
| 214 |
SMART_TEST_DIR=/path/to/smart-turn-data-v3.2-test \
|
| 215 |
DATASETS_DIR=datasets/v3-public-new bash scripts/02_validate_data.sh
|
| 216 |
+
DATASETS_DIR=datasets/v3-public-new bash scripts/03_evaluate.sh # model: ../; data and results: inside eval/
|
| 217 |
```
|
| 218 |
|
| 219 |
Equivalent direct commands (choose either these or the script):
|
|
|
|
| 229 |
|
| 230 |
### 3. Evaluate merged weights
|
| 231 |
|
| 232 |
+
Place the full model merged from the original `checkpoint-1100` (or the full model downloaded from this HF repository) at the repository root (`../` when running from `eval/`). Include `config.json`, all weight shards and their index, processor/tokenizer files and the original `scoring_head.json`. Do not leave an adapter's `adapter_config.json` in this directory: it selects the adapter loading path.
|
| 233 |
|
| 234 |
```bash
|
| 235 |
bash scripts/03_evaluate.sh
|
| 236 |
|
| 237 |
# Optional: specify a model directory and a new output directory.
|
| 238 |
+
# Relative paths are resolved from eval/. The default model directory is .. .
|
| 239 |
+
bash scripts/03_evaluate.sh models/Turn-Detection-S1 results/runs/merged-check
|
| 240 |
```
|
| 241 |
|
| 242 |
Alternatively, run the equivalent commands directly (choose either the script or these commands):
|
| 243 |
|
| 244 |
```bash
|
| 245 |
RUN_OUTPUT="results/runs/merged-$(date +%Y%m%d_%H%M%S)-$$"
|
| 246 |
+
python evaluate.py --model .. \
|
| 247 |
--device cuda:0 --dtype bfloat16 --attn-implementation sdpa \
|
| 248 |
+
--calibration ../calibration.json \
|
| 249 |
--manifest datasets/v3-public/easyturn/test.jsonl --out "$RUN_OUTPUT/easyturn" \
|
| 250 |
--manifest datasets/v3-public/smart-test-4000/test.jsonl --out "$RUN_OUTPUT/smart-test-4000"
|
| 251 |
```
|
| 252 |
|
| 253 |
+
By default this reads the converted data from `datasets/v3-public/` validated in step 2. This starts one `evaluate.py` process, loads the model once and sequentially evaluates all 800 Easy-Turn and 4000 Smart-Test samples, without `--limit`. It uses native Transformers/PyTorch, one GPU (`cuda:0`), BF16, SDPA and temperature calibration from `../calibration.json`. No HTTP server, vLLM, separate base-model download or LoRA weights are needed. Select another GPU with `DEVICE=cuda:1 bash scripts/03_evaluate.sh`; the selected GPU must have enough memory for inference.
|
| 254 |
|
| 255 |
+
The script now loads `../calibration.json` by default: listening uses `choice:3` (T≈1.01754) and speaking uses `choice:4` (T≈1.37385). The report records `provenance.calibration_enabled=true`. To select another file:
|
| 256 |
|
| 257 |
```bash
|
| 258 |
CALIBRATION=/path/to/calibration.json bash scripts/03_evaluate.sh /path/to/model
|
|
|
|
| 268 |
|
| 269 |
Each run defaults to a new `results/runs/merged-TIMESTAMP-PID/` directory with per-dataset `predictions.jsonl` and `report.json` files. Inspect `classification.accuracy`, `classification.macro_f1`, `semantic.macro_f1` and `is_full_run=true`. The main benchmark table reports semantic Macro-F1. A specified output directory must not already exist; scripts stop on errors.
|
| 270 |
|
| 271 |
+
These are single-window results conditioned on constructed `assistant_speaking` state. Published S1 scores now use the complete native Transformers run above; historical ms-swift results remain in the code repository under `results/reference/`.
|
| 272 |
|
| 273 |
+
### Download and run one sample (optional)
|
| 274 |
+
|
| 275 |
+
After the weights are published, the runtime accepts this model's Hub ID and downloads it on first use:
|
| 276 |
+
|
| 277 |
+
```bash
|
| 278 |
+
python infer.py --model Beagledata/Turn-Detection-S1 \
|
| 279 |
+
--audio example.wav --assistant-speaking false
|
| 280 |
+
|
| 281 |
+
python infer.py --model Beagledata/Turn-Detection-S1 \
|
| 282 |
+
--audio example.wav --assistant-speaking true
|
| 283 |
+
```
|
| 284 |
+
|
| 285 |
+
Alternatively, download the files first:
|
| 286 |
+
|
| 287 |
+
```bash
|
| 288 |
+
hf download Beagledata/Turn-Detection-S1 --local-dir models/Turn-Detection-S1
|
| 289 |
+
python infer.py --model models/Turn-Detection-S1 \
|
| 290 |
+
--audio example.wav --assistant-speaking false
|
| 291 |
+
```
|
| 292 |
+
|
| 293 |
+
The default temperature is T=1. To enable the accompanying calibration, add `--calibration models/Turn-Detection-S1/calibration.json`. Merged weights do not require `--base-model`.
|
| 294 |
+
|
| 295 |
+
Predictions are returned in `answers.turn.choice` and `probabilities`. This task uses custom candidate scoring; the generic `pipeline("audio-classification")` is not a drop-in replacement.
|
| 296 |
+
|
| 297 |
+
### HTTP service (optional)
|
| 298 |
+
|
| 299 |
+
```bash
|
| 300 |
+
python serve.py --model Beagledata/Turn-Detection-S1 --host 127.0.0.1 --port 8000
|
| 301 |
+
```
|
| 302 |
+
|
| 303 |
+
The service exposes `/health`, `/v1/models`, and `/v1/systemone`. See the [evaluation guide](https://huggingface.co/Beagledata/Turn-Detection-S1/blob/main/eval/README.md) for API requests and the [test-set directory](https://huggingface.co/Beagledata/Turn-Detection-S1/tree/main/eval/datasets) for the 4,800-sample benchmark and evaluation tools.
|
| 304 |
|
| 305 |
## Training and evaluation
|
| 306 |
|
|
|
|
| 324 |
|
| 325 |
## Source code and feedback
|
| 326 |
|
| 327 |
+
[Source code](https://huggingface.co/Beagledata/Turn-Detection-S1/tree/main/eval) · [Hugging Face Discussions](https://huggingface.co/Beagledata/Turn-Detection-S1/discussions)
|
README_zh.md
CHANGED
|
@@ -17,20 +17,20 @@ datasets:
|
|
| 17 |
- pipecat-ai/smart-turn-data-v3.2-train
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Turn-Detection-
|
| 21 |
|
| 22 |
### 面向语音对话的轮次结束、打断与附和判断
|
| 23 |
|
| 24 |
**Qwen3-Omni-30B-A3B-Instruct 微调 · 五种语义 / 七个状态标签 · Apache-2.0**
|
| 25 |
|
| 26 |
-
[
|
| 27 |
|
| 28 |
**语言:** [English](README.md) | 中文
|
| 29 |
|
| 30 |
|
| 31 |
-
**Turn-Detection-
|
| 32 |
|
| 33 |
-
Turn-Detection-
|
| 34 |
|
| 35 |
## 目录
|
| 36 |
|
|
@@ -73,7 +73,7 @@ Turn-Detection-Jev is a state-conditioned audio model for turn completion, inter
|
|
| 73 |
|
| 74 |
### 公开测试集
|
| 75 |
|
| 76 |
-
Turn-Detection-
|
| 77 |
|
| 78 |
| 数据集 | 样本数 | 正确数 | Accuracy | 语义 Macro-F1 |
|
| 79 |
| --- | ---: | ---: | ---: | ---: |
|
|
@@ -94,18 +94,18 @@ Turn-Detection-Jev 成绩来自 2026-11-11 的完整原生 Transformers 评估
|
|
| 94 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% |
|
| 95 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% |
|
| 96 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% |
|
| 97 |
-
| easyturn | Turn-Detection-
|
| 98 |
| smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% |
|
| 99 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% |
|
| 100 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% |
|
| 101 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% |
|
| 102 |
-
| smart-test | Turn-Detection-
|
| 103 |
|
| 104 |

|
| 105 |
|
| 106 |
准确率按全部共同样本计算;精准率、召回率、F1 均对 complete 和 incomplete 两个真实目标类等权平均。所有目标外预测仍计入错误,不重新归一化。
|
| 107 |
|
| 108 |
-
Turn-Detection-
|
| 109 |
|
| 110 |
### 调用耗时
|
| 111 |
|
|
@@ -115,36 +115,36 @@ Turn-Detection-Jev 额外获得了构造的助手状态,其他音频模型未
|
|
| 115 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 64.91 | 47.66 | 54.51 | 15.41 |
|
| 116 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 5.36 | 4.18 | 5.26 | 186.68 |
|
| 117 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 222.09 | 226.87 | 247.68 | 4.50 |
|
| 118 |
-
| easyturn | Turn-Detection-
|
| 119 |
| smart-test | TurnSense 1.1 GPU | 4000 | 543.53 | 649.01 | 659.98 | 1.84 |
|
| 120 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 165.56 | 192.63 | 296.12 | 6.04 |
|
| 121 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 4.07 | 3.42 | 4.63 | 245.65 |
|
| 122 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 229.76 | 221.62 | 275.89 | 4.35 |
|
| 123 |
-
| smart-test | Turn-Detection-
|
| 124 |
|
| 125 |

|
| 126 |
|
| 127 |
-
Turn-Detection-
|
| 128 |
|
| 129 |
-
图表使用对数轴。其他模型的 ONNX 运行 warmup=20,历史远端运行 warmup=0;历史 ONNX 计时含混音、重采样、特征和推理,远端还含编码、HTTP、排队及响应解析,均不含文件读取/解码。Turn-Detection-
|
| 130 |
|
| 131 |
表中 samples/s=样本数×1000/累计逐样本耗时,不是整轮墙钟吞吐,也不表示并发容量。未在本次输出中记录独立 `gpu_latency_ms` 或 `inference_latency_ms`。
|
| 132 |
|
| 133 |
## 快速开始
|
| 134 |
|
| 135 |
-
本 Hugging Face 仓库
|
| 136 |
|
| 137 |
-
|
| 138 |
|
| 139 |
```bash
|
| 140 |
-
|
| 141 |
-
cd Turn-Detection-
|
| 142 |
-
|
| 143 |
```
|
| 144 |
|
| 145 |
### 1. 安装依赖
|
| 146 |
|
| 147 |
-
先激活 Python >= 3.10 的独立环境,并按服务器 GPU/CUDA 环境安装相应的 CUDA 版 PyTorch。在
|
| 148 |
|
| 149 |
```bash
|
| 150 |
bash scripts/01_install.sh
|
|
@@ -163,7 +163,7 @@ python -m pip install -e '.[datasets]'
|
|
| 163 |
按默认路径执行第二步前,项目中应保留以下文件和目录:
|
| 164 |
|
| 165 |
```text
|
| 166 |
-
Turn-Detection-
|
| 167 |
├── datasets/
|
| 168 |
│ ├── README.md # 数据说明,建议保留
|
| 169 |
│ ├── Easy-Turn-Testset/ # 完整原始 Easy-Turn 测试集
|
|
@@ -215,7 +215,7 @@ Git 不包含 `datasets/**/audio/`;无需从本地上传导出的测试音频
|
|
| 215 |
EASYTURN_DIR=/path/to/Easy-Turn-Testset \
|
| 216 |
SMART_TEST_DIR=/path/to/smart-turn-data-v3.2-test \
|
| 217 |
DATASETS_DIR=datasets/v3-public-new bash scripts/02_validate_data.sh
|
| 218 |
-
DATASETS_DIR=datasets/v3-public-new bash scripts/03_evaluate.sh
|
| 219 |
```
|
| 220 |
|
| 221 |
也可直接执行以下等价命令(与脚本二选一):
|
|
@@ -231,29 +231,29 @@ python evaluate.py --manifest datasets/v3-public/smart-test-4000/test.jsonl --va
|
|
| 231 |
|
| 232 |
### 3. 评估完整合并模型
|
| 233 |
|
| 234 |
-
经 LoRA 合并后的完整模型(或从本 HF 仓库下载的完整模型)放入 `
|
| 235 |
|
| 236 |
```bash
|
| 237 |
bash scripts/03_evaluate.sh
|
| 238 |
|
| 239 |
-
# 可选:指定模型目录及一个尚不存在的结果目录(相对路径以
|
| 240 |
-
bash scripts/03_evaluate.sh models/Turn-Detection-
|
| 241 |
```
|
| 242 |
|
| 243 |
也可直接执行以下等价命令(与脚本二选一):
|
| 244 |
|
| 245 |
```bash
|
| 246 |
RUN_OUTPUT="results/runs/merged-$(date +%Y%m%d_%H%M%S)-$$"
|
| 247 |
-
python evaluate.py --model
|
| 248 |
--device cuda:0 --dtype bfloat16 --attn-implementation sdpa \
|
| 249 |
-
--calibration
|
| 250 |
--manifest datasets/v3-public/easyturn/test.jsonl --out "$RUN_OUTPUT/easyturn" \
|
| 251 |
--manifest datasets/v3-public/smart-test-4000/test.jsonl --out "$RUN_OUTPUT/smart-test-4000"
|
| 252 |
```
|
| 253 |
|
| 254 |
-
脚本默认读取第二步生成并校验的 `datasets/v3-public/`,在同一个 `evaluate.py` 进程中只加载一次模型,依次完整评估 Easy-Turn 800 条与 Smart-Test 4000 条,不设置 `--limit`。使用原生 Transformers/PyTorch、单卡 `cuda:0`、BF16、SDPA,默认加载 `
|
| 255 |
|
| 256 |
-
脚本现默认加载 `
|
| 257 |
|
| 258 |
```bash
|
| 259 |
CALIBRATION=/path/to/calibration.json bash scripts/03_evaluate.sh /path/to/model
|
|
@@ -269,7 +269,40 @@ CALIBRATION=none bash scripts/03_evaluate.sh /path/to/model
|
|
| 269 |
|
| 270 |
默认结果保存到自动生成的 `results/runs/merged-时间戳-进程号/`,两个数据集各有 `predictions.jsonl` 和 `report.json`。查看 `classification.accuracy`、`classification.macro_f1`、`semantic.macro_f1`,并确认 `is_full_run=true`;主页主表使用语义 Macro-F1。指定的结果目录必须不存在,脚本遇到错误会停止。
|
| 271 |
|
| 272 |
-
以上是已构造 `assistant_speaking` 状态条件下的单窗口评估。主页
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
## 训练与评测说明
|
| 275 |
|
|
@@ -293,4 +326,4 @@ CALIBRATION=none bash scripts/03_evaluate.sh /path/to/model
|
|
| 293 |
|
| 294 |
## 源码与反馈
|
| 295 |
|
| 296 |
-
推理代码、测试集准备与评估:[
|
|
|
|
| 17 |
- pipecat-ai/smart-turn-data-v3.2-train
|
| 18 |
---
|
| 19 |
|
| 20 |
+
# Turn-Detection-S1
|
| 21 |
|
| 22 |
### 面向语音对话的轮次结束、打断与附和判断
|
| 23 |
|
| 24 |
**Qwen3-Omni-30B-A3B-Instruct 微调 · 五种语义 / 七个状态标签 · Apache-2.0**
|
| 25 |
|
| 26 |
+
[模型权重](https://huggingface.co/Beagledata/Turn-Detection-S1) · [快速开始](#快速开始) · [许可证](LICENSE)
|
| 27 |
|
| 28 |
**语言:** [English](README.md) | 中文
|
| 29 |
|
| 30 |
|
| 31 |
+
**Turn-Detection-S1** 用于判断语音对话中何时接话、何时等待,以及助手播放过程中用户是否希望打断。模型同时接收音频与应用提供的助手播放状态,输出对应场景的类别及概率,可用于语音助手、客服和语音对话系统的轮次控制研究与集成。
|
| 32 |
|
| 33 |
+
Turn-Detection-S1 is a state-conditioned audio model for turn completion, interruptions, backchannels, incomplete speech, and background audio, fine-tuned from Qwen3-Omni-30B-A3B-Instruct.
|
| 34 |
|
| 35 |
## 目录
|
| 36 |
|
|
|
|
| 73 |
|
| 74 |
### 公开测试集
|
| 75 |
|
| 76 |
+
Turn-Detection-S1 成绩来自 2026-11-11 的完整原生 Transformers 评估(运行 `merged-20261111_051726-1672084`),温度 T=1,未启用 calibration。其他模型保留历史结果。
|
| 77 |
|
| 78 |
| 数据集 | 样本数 | 正确数 | Accuracy | 语义 Macro-F1 |
|
| 79 |
| --- | ---: | ---: | ---: | ---: |
|
|
|
|
| 94 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% |
|
| 95 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% |
|
| 96 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% |
|
| 97 |
+
| easyturn | Turn-Detection-S1 | 600 | 98.17% | 98.33% | 98.17% | 98.25% |
|
| 98 |
| smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% |
|
| 99 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% |
|
| 100 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% |
|
| 101 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% |
|
| 102 |
+
| smart-test | Turn-Detection-S1 | 4000 | 96.78% | 96.87% | 96.78% | 96.81% |
|
| 103 |
|
| 104 |

|
| 105 |
|
| 106 |
准确率按全部共同样本计算;精准率、召回率、F1 均对 complete 和 incomplete 两个真实目标类等权平均。所有目标外预测仍计入错误,不重新归一化。
|
| 107 |
|
| 108 |
+
Turn-Detection-S1 额外获得了构造的助手状态,其他音频模型未获得该输入;各服务和运行环境也不同。因此这些数值为本次 S1 与其他模型历史实现的描述性参照,不能据此声称同等输入下的领先或将差值全部归因于微调。这里的 TurnSense 数据来自本项目的评估,不是 TurnSense 官方页面公布的成绩。
|
| 109 |
|
| 110 |
### 调用耗时
|
| 111 |
|
|
|
|
| 115 |
| easyturn | Smart-Turn 3.2 CPU | 600 | 64.91 | 47.66 | 54.51 | 15.41 |
|
| 116 |
| easyturn | Smart-Turn 3.2 GPU | 600 | 5.36 | 4.18 | 5.26 | 186.68 |
|
| 117 |
| easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 222.09 | 226.87 | 247.68 | 4.50 |
|
| 118 |
+
| easyturn | Turn-Detection-S1 | 600 | 120.38 | 94.68 | 160.56 | 8.31 |
|
| 119 |
| smart-test | TurnSense 1.1 GPU | 4000 | 543.53 | 649.01 | 659.98 | 1.84 |
|
| 120 |
| smart-test | Smart-Turn 3.2 CPU | 4000 | 165.56 | 192.63 | 296.12 | 6.04 |
|
| 121 |
| smart-test | Smart-Turn 3.2 GPU | 4000 | 4.07 | 3.42 | 4.63 | 245.65 |
|
| 122 |
| smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 229.76 | 221.62 | 275.89 | 4.35 |
|
| 123 |
+
| smart-test | Turn-Detection-S1 | 4000 | 97.50 | 96.29 | 110.90 | 10.26 |
|
| 124 |
|
| 125 |

|
| 126 |
|
| 127 |
+
Turn-Detection-S1 耗时来自上述原生 Transformers 运行,含本地音频读取/解码、预处理和推理;未剔除首次调用开销,未测量独立 GPU kernel 耗时。其他模型仍为历史计时。
|
| 128 |
|
| 129 |
+
图表使用对数轴。其他模型的 ONNX 运行 warmup=20,历史远端运行 warmup=0;历史 ONNX 计时含混音、重采样、特征和推理,远端还含编码、HTTP、排队及响应解析,均不含文件读取/解码。Turn-Detection-S1 本次计时包含读取/解码,且硬件、模型和运行环境不同,本图不能用于同硬件速度排名。
|
| 130 |
|
| 131 |
表中 samples/s=样本数×1000/累计逐样本耗时,不是整轮墙钟吞吐,也不表示并发容量。未在本次输出中记录独立 `gpu_latency_ms` 或 `inference_latency_ms`。
|
| 132 |
|
| 133 |
## 快速开始
|
| 134 |
|
| 135 |
+
本 Hugging Face 仓库根目录存放模型文件与说明,推理、服务、评测代码及测试集准备工具位于 `eval/`。以下命令均在 `eval/` 内运行。
|
| 136 |
|
| 137 |
+
从 Hugging Face 下载完整仓库(包括 `eval/` 代码;测试 WAV 需另外准备):
|
| 138 |
|
| 139 |
```bash
|
| 140 |
+
hf download Beagledata/Turn-Detection-S1 --local-dir Turn-Detection-S1
|
| 141 |
+
cd Turn-Detection-S1
|
| 142 |
+
cd eval
|
| 143 |
```
|
| 144 |
|
| 145 |
### 1. 安装依赖
|
| 146 |
|
| 147 |
+
先激活 Python >= 3.10 的独立环境,并按服务器 GPU/CUDA 环境安装相应的 CUDA 版 PyTorch。在 `eval/` 目录执行:
|
| 148 |
|
| 149 |
```bash
|
| 150 |
bash scripts/01_install.sh
|
|
|
|
| 163 |
按默认路径执行第二步前,项目中应保留以下文件和目录:
|
| 164 |
|
| 165 |
```text
|
| 166 |
+
Turn-Detection-S1/eval/
|
| 167 |
├── datasets/
|
| 168 |
│ ├── README.md # 数据说明,建议保留
|
| 169 |
│ ├── Easy-Turn-Testset/ # 完整原始 Easy-Turn 测试集
|
|
|
|
| 215 |
EASYTURN_DIR=/path/to/Easy-Turn-Testset \
|
| 216 |
SMART_TEST_DIR=/path/to/smart-turn-data-v3.2-test \
|
| 217 |
DATASETS_DIR=datasets/v3-public-new bash scripts/02_validate_data.sh
|
| 218 |
+
DATASETS_DIR=datasets/v3-public-new bash scripts/03_evaluate.sh # model: ../; data and results: inside eval/
|
| 219 |
```
|
| 220 |
|
| 221 |
也可直接执行以下等价命令(与脚本二选一):
|
|
|
|
| 231 |
|
| 232 |
### 3. 评估完整合并模型
|
| 233 |
|
| 234 |
+
将原实验 `checkpoint-1100` 经 LoRA 合并后的完整模型(或从本 HF 仓库下载的完整模型)放入项目根目录(即当前 `eval/` 的父目录 `../`),包含 `config.json`、全部权重分片及索引、processor/tokenizer 配套文件,并保留原始 `scoring_head.json`。不要混入 adapter 的 `adapter_config.json`,否则加载器会进入 adapter 分支。
|
| 235 |
|
| 236 |
```bash
|
| 237 |
bash scripts/03_evaluate.sh
|
| 238 |
|
| 239 |
+
# 可选:指定模型目录及一个尚不存在的结果目录(相对路径以 `eval/` 为准)。
|
| 240 |
+
bash scripts/03_evaluate.sh models/Turn-Detection-S1 results/runs/merged-check
|
| 241 |
```
|
| 242 |
|
| 243 |
也可直接执行以下等价命令(与脚本二选一):
|
| 244 |
|
| 245 |
```bash
|
| 246 |
RUN_OUTPUT="results/runs/merged-$(date +%Y%m%d_%H%M%S)-$$"
|
| 247 |
+
python evaluate.py --model .. \
|
| 248 |
--device cuda:0 --dtype bfloat16 --attn-implementation sdpa \
|
| 249 |
+
--calibration ../calibration.json \
|
| 250 |
--manifest datasets/v3-public/easyturn/test.jsonl --out "$RUN_OUTPUT/easyturn" \
|
| 251 |
--manifest datasets/v3-public/smart-test-4000/test.jsonl --out "$RUN_OUTPUT/smart-test-4000"
|
| 252 |
```
|
| 253 |
|
| 254 |
+
脚本默认读取第二步生成并校验的 `datasets/v3-public/`,在同一个 `evaluate.py` 进程中只加载一次模型,依次完整评估 Easy-Turn 800 条与 Smart-Test 4000 条,不设置 `--limit`。使用原生 Transformers/PyTorch、单卡 `cuda:0`、BF16、SDPA,默认加载 `../calibration.json` 进行温度校准,无需启动 HTTP 服务或 vLLM,也无需另行下载基座/LoRA 权重。可用 `DEVICE=cuda:1 bash scripts/03_evaluate.sh` 指定 GPU;该卡需要容纳完整推理所需显存。
|
| 255 |
|
| 256 |
+
脚本现默认加载 `../calibration.json`:listening 使用 `choice:3`(T≈1.01754),speaking 使用 `choice:4`(T≈1.37385)。报告记录 `provenance.calibration_enabled=true`。也可指定其他校准文件:
|
| 257 |
|
| 258 |
```bash
|
| 259 |
CALIBRATION=/path/to/calibration.json bash scripts/03_evaluate.sh /path/to/model
|
|
|
|
| 269 |
|
| 270 |
默认结果保存到自动生成的 `results/runs/merged-时间戳-进程号/`,两个数据集各有 `predictions.jsonl` 和 `report.json`。查看 `classification.accuracy`、`classification.macro_f1`、`semantic.macro_f1`,并确认 `is_full_run=true`;主页主表使用语义 Macro-F1。指定的结果目录必须不存在,脚本遇到错误会停止。
|
| 271 |
|
| 272 |
+
以上是已构造 `assistant_speaking` 状态条件下的单窗口评估。主页 S1 成绩已更新为上述原生 Transformers 完整运行;历史 ms-swift 成绩保留于代码仓库的 `results/reference/`。
|
| 273 |
+
|
| 274 |
+
### 下载模型与单条推理(可选)
|
| 275 |
+
|
| 276 |
+
发布权重后,`--model` 可直接使用本仓库 ID,首次运行会自动下载:
|
| 277 |
+
|
| 278 |
+
```bash
|
| 279 |
+
python infer.py --model Beagledata/Turn-Detection-S1 \
|
| 280 |
+
--audio example.wav --assistant-speaking false
|
| 281 |
+
|
| 282 |
+
# 助手正在播放时:
|
| 283 |
+
python infer.py --model Beagledata/Turn-Detection-S1 \
|
| 284 |
+
--audio example.wav --assistant-speaking true
|
| 285 |
+
```
|
| 286 |
+
|
| 287 |
+
也可以先下载到本地:
|
| 288 |
+
|
| 289 |
+
```bash
|
| 290 |
+
hf download Beagledata/Turn-Detection-S1 --local-dir models/Turn-Detection-S1
|
| 291 |
+
python infer.py --model models/Turn-Detection-S1 \
|
| 292 |
+
--audio example.wav --assistant-speaking false
|
| 293 |
+
```
|
| 294 |
+
|
| 295 |
+
默认概率温度为 T=1。启用配套校准时添加 `--calibration models/Turn-Detection-S1/calibration.json`。完整合并模型无需指定 `--base-model`。
|
| 296 |
+
|
| 297 |
+
输出包含 `answers.turn.choice` 与 `probabilities`。应用应提供真实的 `assistant_speaking`,结合阈值、连续确认和播放逻辑决定是否接话或停止播放。此任务使用定制的选项评分流程,不能直接用通用 `pipeline("audio-classification")` 替代。
|
| 298 |
+
|
| 299 |
+
### HTTP 服务(可选)
|
| 300 |
+
|
| 301 |
+
```bash
|
| 302 |
+
python serve.py --model Beagledata/Turn-Detection-S1 --host 127.0.0.1 --port 8000
|
| 303 |
+
```
|
| 304 |
+
|
| 305 |
+
服务提供 `/health`、`/v1/models` 和 `/v1/systemone`。完整调用示例见 [评测指南](https://huggingface.co/Beagledata/Turn-Detection-S1/blob/main/eval/README.md),评估方法和 4800 条测试集说明见 [测试集目录](https://huggingface.co/Beagledata/Turn-Detection-S1/tree/main/eval/datasets)。
|
| 306 |
|
| 307 |
## 训练与评测说明
|
| 308 |
|
|
|
|
| 326 |
|
| 327 |
## 源码与反馈
|
| 328 |
|
| 329 |
+
推理代码、测试集准备与评估:[Hugging Face 源码](https://huggingface.co/Beagledata/Turn-Detection-S1/tree/main/eval)。问题反馈:[Hugging Face Discussions](https://huggingface.co/Beagledata/Turn-Detection-S1/discussions)。
|
image/01_metric_comparison.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
image/02_latency_comparison.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
release_manifest.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
| 1 |
{
|
| 2 |
"complete_model": false,
|
| 3 |
"weight_files": [],
|
| 4 |
-
"links_are_placeholders":
|
| 5 |
-
"hf_repo_id": "
|
| 6 |
-
"github_repo": "YOUR_GITHUB_ORG/Turn-Detection-Jev",
|
| 7 |
-
"github_ref": "main",
|
| 8 |
"sha256": {
|
| 9 |
".gitattributes": "77db011f87feff0d3ed5a3d8935c8df0ccdf1f3f0e37ad39de66ef56aa3dc130",
|
| 10 |
-
"
|
|
|
|
| 11 |
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
|
| 12 |
-
"NOTICE": "
|
| 13 |
-
"README.md": "
|
| 14 |
-
"README_zh.md": "
|
| 15 |
"calibration.json": "e0bdf32ab8aae2d0750b9d50ace497cf5cd2d1729ad346063f3ec13996eb3a3e",
|
| 16 |
-
"image/01_metric_comparison.png": "
|
| 17 |
-
"image/02_latency_comparison.png": "
|
| 18 |
-
"image/效果对比.png": "
|
| 19 |
},
|
| 20 |
"gpu_validation": "not performed by packaging; actual checkpoint validation remains required"
|
| 21 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"complete_model": false,
|
| 3 |
"weight_files": [],
|
| 4 |
+
"links_are_placeholders": false,
|
| 5 |
+
"hf_repo_id": "Beagledata/Turn-Detection-S1",
|
|
|
|
|
|
|
| 6 |
"sha256": {
|
| 7 |
".gitattributes": "77db011f87feff0d3ed5a3d8935c8df0ccdf1f3f0e37ad39de66ef56aa3dc130",
|
| 8 |
+
".gitignore": "9c734686e9bbf4e62d8acbdc1cdddf85c37578fff2cce3df7c6398785f17c061",
|
| 9 |
+
"EVALUATION.md": "fe08405889eff8c94057deba00c7c778005c6dd69eacb9973f49a0ceefcf114f",
|
| 10 |
"LICENSE": "c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4",
|
| 11 |
+
"NOTICE": "5fb718f6d558cdeab43bcb5910e1fb8a3d22d35b09556b61b37c730e8ef26912",
|
| 12 |
+
"README.md": "88ce4f0de329a521e7c6e64192ce18fbd04d1de0e7a46c8dcec6eb2efa96bd9c",
|
| 13 |
+
"README_zh.md": "09c3191eee7aeea177e624341b7a74cafbd40a53c959f674020ab045850f1457",
|
| 14 |
"calibration.json": "e0bdf32ab8aae2d0750b9d50ace497cf5cd2d1729ad346063f3ec13996eb3a3e",
|
| 15 |
+
"image/01_metric_comparison.png": "834eb47590031e3c3043a77c6d63bbabc67c742a849a0ae6ad263f4d4521bcb2",
|
| 16 |
+
"image/02_latency_comparison.png": "bfbb2760d375ae321e4bc40962f42015c40cf8cfa42838ef7fc73b1e1cf0a747",
|
| 17 |
+
"image/效果对比.png": "834eb47590031e3c3043a77c6d63bbabc67c742a849a0ae6ad263f4d4521bcb2"
|
| 18 |
},
|
| 19 |
"gpu_validation": "not performed by packaging; actual checkpoint validation remains required"
|
| 20 |
}
|