Skip to content

Commit fef2b9a

Browse files
jeradfdavidzhao
andauthored
update turn detector model; more robust to missing terminal punctuation (#1565)
Co-authored-by: David Zhao <dz@livekit.io>
1 parent 6fb681b commit fef2b9a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/shaggy-fans-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-plugins-turn-detector": patch
3+
---
4+
5+
retrained to be robust to missing terminal punctuation

livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/eou.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
HG_MODEL = "livekit/turn-detector"
1515
ONNX_FILENAME = "model_q8.onnx"
16-
MODEL_REVISION = "v1.2.0"
17-
MAX_HISTORY = 4
16+
MODEL_REVISION = "v1.2.1"
1817
MAX_HISTORY_TOKENS = 512
18+
MAX_HISTORY_TURNS = 6
1919

2020

2121
def _download_from_hf_hub(repo_id, filename, **kwargs):
@@ -120,7 +120,7 @@ class EOUModel:
120120
def __init__(
121121
self,
122122
inference_executor: InferenceExecutor | None = None,
123-
unlikely_threshold: float = 0.008,
123+
unlikely_threshold: float = 0.0289,
124124
) -> None:
125125
self._executor = (
126126
inference_executor or get_current_job_context().inference_executor
@@ -168,7 +168,7 @@ async def predict_end_of_turn(
168168
)
169169
break
170170

171-
messages = messages[-MAX_HISTORY:]
171+
messages = messages[-MAX_HISTORY_TURNS:]
172172

173173
json_data = json.dumps({"chat_ctx": messages}).encode()
174174

0 commit comments

Comments
 (0)