Streaming Turn v0.5: ONNX model, PyTorch weights, model card
Browse files
README.md
CHANGED
|
@@ -18,16 +18,17 @@ Streaming, audio-only turn-taking model for [Pipecat](https://github.com/pipecat
|
|
| 18 |
|
| 19 |
- 4.0M parameters: log-mel, causal conv encoder, GRU. 16 kHz mono in, 25 frames a second out.
|
| 20 |
- 0.37 ms per 40 ms chunk on one Apple M-series core (ONNX Runtime).
|
| 21 |
-
- English only. Experimental:
|
| 22 |
|
| 23 |
## Versions
|
| 24 |
|
| 25 |
| Folder | End the turn when |
|
| 26 |
|---|---|
|
| 27 |
-
| `streaming-turn-v0.
|
|
|
|
| 28 |
| `streaming-turn-v0.2` | `eot` ≥ 0.5, or 0.8 s after the last sound if `eot` reached 0.3 |
|
| 29 |
|
| 30 |
-
v0.4 adds `eot_late`, a second end-of-turn output for a user who has gone quiet.
|
| 31 |
|
| 32 |
Each folder holds `streaming-turn-fp32.onnx` (the streaming model), `model.json` (tensor names, chunk size, class lists) and a `.pt` file (PyTorch config and weights).
|
| 33 |
|
|
@@ -51,11 +52,12 @@ from pipecat.turns.user_turn_strategies import UserTurnStrategies
|
|
| 51 |
|
| 52 |
from agent.turn_analyzers import StreamingTurnAnalyzer, StreamingTurnParams
|
| 53 |
|
| 54 |
-
VERSION = "streaming-turn-v0.
|
| 55 |
repo = snapshot_download("jptaylor/streaming-turn", allow_patterns=f"{VERSION}/*")
|
| 56 |
analyzer = StreamingTurnAnalyzer(
|
| 57 |
Path(repo) / VERSION,
|
| 58 |
-
params=StreamingTurnParams(threshold=0.
|
|
|
|
| 59 |
# v0.2: StreamingTurnParams(threshold=0.5, likely_threshold=0.3)
|
| 60 |
)
|
| 61 |
|
|
@@ -85,7 +87,7 @@ One frame per 40 ms chunk.
|
|
| 85 |
| Output | |
|
| 86 |
|---|---|
|
| 87 |
| `eot` | probability that the user's turn is over |
|
| 88 |
-
| `eot_late` | the same, for a user who has gone quiet (v0.4
|
| 89 |
| `intent` | continuer, assessment, negative, floor_take, non_speech. Backchannel = continuer + assessment; floor-take = negative + floor_take |
|
| 90 |
| `leadin` | none, acknowledgement, hesitation, marker, reaction (barely beats guessing) |
|
| 91 |
| `vad`, `vap` | auxiliary: voice activity now, and both speakers' activity over the next 2 s |
|
|
@@ -98,19 +100,25 @@ Held-out Open Yap 1K conversations (1,259 turn ends, 8,191 pauses), replayed thr
|
|
| 98 |
|
| 99 |
| | Cuts in on a pause | Answers within 500 ms | Within 1 s | Waits for the 3 s timeout |
|
| 100 |
|---|---|---|---|---|
|
|
|
|
| 101 |
| v0.4 | 4.9% | 56.4% | 79.7% | 2.9% |
|
| 102 |
| v0.2 | 4.6% | 51.4% | 82.2% | 15.5% |
|
| 103 |
|
| 104 |
-
On
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
## Limitations
|
| 107 |
|
| 108 |
- The held-out conversations are from a corpus the model trained on (different conversations).
|
| 109 |
-
- Keep `bot_state` up to date.
|
|
|
|
| 110 |
- A finished sentence it takes for an unfinished one waits for the 3 s timeout.
|
| 111 |
- Half of the end-of-turn targets on Smart Turn clips are Smart Turn v3.2's own predictions, so it is not independent of v3.2.
|
| 112 |
-
- Trained on human-to-human conversation and single-speaker clips, with simulated echo. Phone codecs are untested.
|
| 113 |
|
| 114 |
## Training data
|
| 115 |
|
| 116 |
-
[Open Yap 1K](https://theagenticdatacompany.com/open-yap-1k) v1.0, [otoSpeech-full-duplex-280h](https://huggingface.co/datasets/otoearth/otoSpeech-full-duplex-280h) (CC BY 4.0), the English part of the [Smart Turn v3.2 training data](https://huggingface.co/datasets/pipecat-ai/smart-turn-data-v3.2-train) (CC BY 4.0), and 600 synthetic hard negatives. A frozen [Whisper base.en](https://huggingface.co/openai/whisper-base.en) encoder was the distillation target, and Smart Turn v3.2 gave soft end-of-turn labels. No training data is included here.
|
|
|
|
| 18 |
|
| 19 |
- 4.0M parameters: log-mel, causal conv encoder, GRU. 16 kHz mono in, 25 frames a second out.
|
| 20 |
- 0.37 ms per 40 ms chunk on one Apple M-series core (ONNX Runtime).
|
| 21 |
+
- English only. Experimental: little live testing, and v0.5 has not yet been compared with v0.4 live.
|
| 22 |
|
| 23 |
## Versions
|
| 24 |
|
| 25 |
| Folder | End the turn when |
|
| 26 |
|---|---|
|
| 27 |
+
| `streaming-turn-v0.5` (latest) | `eot` ≥ 0.6, or `eot_late` ≥ 0.4 |
|
| 28 |
+
| `streaming-turn-v0.4` | `eot` ≥ 0.5, or `eot_late` ≥ 0.4 |
|
| 29 |
| `streaming-turn-v0.2` | `eot` ≥ 0.5, or 0.8 s after the last sound if `eot` reached 0.3 |
|
| 30 |
|
| 31 |
+
v0.4 adds `eot_late`, a second end-of-turn output for a user who has gone quiet. v0.5 is v0.4 trained twice as long, with synthetic sessions of a person talking to an agent (pauses while dictating, one-word answers, "mm-hmm" over the bot) in a tenth of each batch.
|
| 32 |
|
| 33 |
Each folder holds `streaming-turn-fp32.onnx` (the streaming model), `model.json` (tensor names, chunk size, class lists) and a `.pt` file (PyTorch config and weights).
|
| 34 |
|
|
|
|
| 52 |
|
| 53 |
from agent.turn_analyzers import StreamingTurnAnalyzer, StreamingTurnParams
|
| 54 |
|
| 55 |
+
VERSION = "streaming-turn-v0.5"
|
| 56 |
repo = snapshot_download("jptaylor/streaming-turn", allow_patterns=f"{VERSION}/*")
|
| 57 |
analyzer = StreamingTurnAnalyzer(
|
| 58 |
Path(repo) / VERSION,
|
| 59 |
+
params=StreamingTurnParams(threshold=0.6, late_threshold=0.4),
|
| 60 |
+
# v0.4: StreamingTurnParams(threshold=0.5, late_threshold=0.4)
|
| 61 |
# v0.2: StreamingTurnParams(threshold=0.5, likely_threshold=0.3)
|
| 62 |
)
|
| 63 |
|
|
|
|
| 87 |
| Output | |
|
| 88 |
|---|---|
|
| 89 |
| `eot` | probability that the user's turn is over |
|
| 90 |
+
| `eot_late` | the same, for a user who has gone quiet (v0.4 and v0.5) |
|
| 91 |
| `intent` | continuer, assessment, negative, floor_take, non_speech. Backchannel = continuer + assessment; floor-take = negative + floor_take |
|
| 92 |
| `leadin` | none, acknowledgement, hesitation, marker, reaction (barely beats guessing) |
|
| 93 |
| `vad`, `vap` | auxiliary: voice activity now, and both speakers' activity over the next 2 s |
|
|
|
|
| 100 |
|
| 101 |
| | Cuts in on a pause | Answers within 500 ms | Within 1 s | Waits for the 3 s timeout |
|
| 102 |
|---|---|---|---|---|
|
| 103 |
+
| v0.5 | 4.1% | 58.0% | 79.9% | 1.2% |
|
| 104 |
| v0.4 | 4.9% | 56.4% | 79.7% | 2.9% |
|
| 105 |
| v0.2 | 4.6% | 51.4% | 82.2% | 15.5% |
|
| 106 |
|
| 107 |
+
On held-out otoSpeech conversations v0.5 answers 44.1% of turn ends within 1 s (v0.4: 44.0%) and leaves 2.8% to the timeout (v0.4: 11.0%), cutting in on 7.8% of pauses (7.7%).
|
| 108 |
+
|
| 109 |
+
On Smart Turn v3.2's English test clips (7,820, read 200 ms after the speech ends): v0.5 93.6%, v0.4 93.3%, v0.2 93.8%, Smart Turn v3.2 93.5%.
|
| 110 |
+
|
| 111 |
+
On held-out synthetic sessions of a person dictating to an agent, v0.5 cuts in on 4% of mid-turn pauses and v0.4 on half. Those sessions use new voices but the same scripts and speech vendors as v0.5's training ones; no real recordings of that case exist yet.
|
| 112 |
|
| 113 |
## Limitations
|
| 114 |
|
| 115 |
- The held-out conversations are from a corpus the model trained on (different conversations).
|
| 116 |
+
- Keep `bot_state` up to date.
|
| 117 |
+
- v0.5 is one of three runs, chosen on held-out data. A second seed of the same recipe scored about two points lower on the measure that chose it.
|
| 118 |
- A finished sentence it takes for an unfinished one waits for the 3 s timeout.
|
| 119 |
- Half of the end-of-turn targets on Smart Turn clips are Smart Turn v3.2's own predictions, so it is not independent of v3.2.
|
| 120 |
+
- Trained on human-to-human conversation and single-speaker clips, with simulated echo, and for v0.5 on synthetic speech. Phone codecs are untested.
|
| 121 |
|
| 122 |
## Training data
|
| 123 |
|
| 124 |
+
[Open Yap 1K](https://theagenticdatacompany.com/open-yap-1k) v1.0, [otoSpeech-full-duplex-280h](https://huggingface.co/datasets/otoearth/otoSpeech-full-duplex-280h) (CC BY 4.0), the English part of the [Smart Turn v3.2 training data](https://huggingface.co/datasets/pipecat-ai/smart-turn-data-v3.2-train) (CC BY 4.0), and 600 synthetic hard negatives. v0.5 adds 1,355 synthetic agent sessions, with the user's speech from ElevenLabs v4 and the bot's from Deepgram Aura-2. A frozen [Whisper base.en](https://huggingface.co/openai/whisper-base.en) encoder was the distillation target, and Smart Turn v3.2 gave soft end-of-turn labels. No training data is included here.
|
streaming-turn-v0.5/model.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"chunk_samples": 640,
|
| 3 |
+
"frames_per_chunk": 1,
|
| 4 |
+
"frame_secs": 0.04,
|
| 5 |
+
"outputs": [
|
| 6 |
+
"eot",
|
| 7 |
+
"intent",
|
| 8 |
+
"leadin",
|
| 9 |
+
"vad",
|
| 10 |
+
"vap",
|
| 11 |
+
"eot_late"
|
| 12 |
+
],
|
| 13 |
+
"state_names": [
|
| 14 |
+
"audio_cache",
|
| 15 |
+
"stem1_cache",
|
| 16 |
+
"stem2_cache",
|
| 17 |
+
"block0_cache",
|
| 18 |
+
"block1_cache",
|
| 19 |
+
"block2_cache",
|
| 20 |
+
"block3_cache",
|
| 21 |
+
"block4_cache",
|
| 22 |
+
"block5_cache",
|
| 23 |
+
"gru_state"
|
| 24 |
+
],
|
| 25 |
+
"intent_classes": [
|
| 26 |
+
"continuer",
|
| 27 |
+
"assessment",
|
| 28 |
+
"negative",
|
| 29 |
+
"floor_take",
|
| 30 |
+
"non_speech"
|
| 31 |
+
],
|
| 32 |
+
"leadin_classes": [
|
| 33 |
+
"none",
|
| 34 |
+
"acknowledgement",
|
| 35 |
+
"hesitation",
|
| 36 |
+
"marker",
|
| 37 |
+
"reaction"
|
| 38 |
+
],
|
| 39 |
+
"config": {
|
| 40 |
+
"features": {
|
| 41 |
+
"sample_rate": 16000,
|
| 42 |
+
"n_fft": 512,
|
| 43 |
+
"win_length": 400,
|
| 44 |
+
"hop_length": 160,
|
| 45 |
+
"n_mels": 80,
|
| 46 |
+
"f_min": 20.0,
|
| 47 |
+
"f_max": 7600.0,
|
| 48 |
+
"log_eps": 1e-06
|
| 49 |
+
},
|
| 50 |
+
"d_model": 256,
|
| 51 |
+
"stem_kernel": 5,
|
| 52 |
+
"stem_stride": 4,
|
| 53 |
+
"enc_kernel": 5,
|
| 54 |
+
"enc_dilations": [
|
| 55 |
+
1,
|
| 56 |
+
2,
|
| 57 |
+
4,
|
| 58 |
+
8,
|
| 59 |
+
1,
|
| 60 |
+
2
|
| 61 |
+
],
|
| 62 |
+
"gru_hidden": 448,
|
| 63 |
+
"gru_layers": 2,
|
| 64 |
+
"bot_state_dim": 8,
|
| 65 |
+
"n_intent": 5,
|
| 66 |
+
"n_vap_bins": 8,
|
| 67 |
+
"dropout": 0.2,
|
| 68 |
+
"stem_mid": 128,
|
| 69 |
+
"n_leadin": 5,
|
| 70 |
+
"teacher_dim": 512,
|
| 71 |
+
"sent_head": false,
|
| 72 |
+
"enc_norm": true,
|
| 73 |
+
"late_head": true,
|
| 74 |
+
"late_detach": false
|
| 75 |
+
}
|
| 76 |
+
}
|
streaming-turn-v0.5/streaming-turn-fp32.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:461cbc83b28aae2500b0a58c5e03aeeb45d7c591812c54ca02f2967aea7353dc
|
| 3 |
+
size 16873141
|
streaming-turn-v0.5/streaming-turn-v0.5.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36d0662d95d98ed86e1fd69e332c77e990c25a5c9c7ae341ea206081edcd0306
|
| 3 |
+
size 17781646
|