Views
No views yet
livekit/turn-detector (Qwen2.5-0.5B), fine-tuned on the Fisher English telephone corpus (LDC2004T19 + LDC2005T19) for end-of-turn (EOT) detection.data/fisher_splits.json of the source repo):| Variant | Val loss | PR-AUC | AUC-ROC |
|---|---|---|---|
Pretrained livekit/turn-detector | 2.39 | 0.660 | 0.663 |
| + This LoRA (1 epoch) | 0.69 | 0.724 | 0.71 |
| + This LoRA (3 epochs, this checkpoint) | 0.70 | 0.728 | 0.63 |
Cross-domain transfer (SWDA / AMI / Taskmaster / fixie-ai) is documented in the source repo. The LoRA targets Fisher-style natural telephone speech; expect smaller or zero gains on structured voice-assistant inputs.
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3from peft import PeftModel
4
5base_id = "livekit/turn-detector"
6lora_id = "tuanamz/livekit-turn-detector-fisher-eot-lora"
7
8tok = AutoTokenizer.from_pretrained(base_id)
9base = AutoModelForCausalLM.from_pretrained(base_id, dtype=torch.float32)
10model = PeftModel.from_pretrained(base, lora_id).eval()
11
12messages = [
13 {"role": "user", "content": "yeah i think that was it"},
14]
15text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
16if text.rstrip().endswith("<|im_end|>"):
17 text = text.rstrip()[: -len("<|im_end|>")]
18enc = tok(text, return_tensors="pt", truncation=True, max_length=512)
19
20eou_id = tok.encode("<|im_end|>", add_special_tokens=False)[0]
21with torch.no_grad():
22 logits = model(**enc).logits[0, -1, :]
23prob_eot = float(torch.softmax(logits, dim=-1)[eou_id])
24print(f"P(end-of-turn) = {prob_eot:.3f}")z = logit[<|im_end|>] − logsumexp(other logits). sigmoid(z) is the EOT score.{q,k,v,o}_proj, r=16, α=32, dropout=0.05.doc/phase2_summary.md.P(<|im_end|>); threshold around the model's calibration sweet spot (typically 0.14–0.5 depending on FP/FN cost).@misc{livekit-turn-detector,
title = {LiveKit Turn-Detector},
author = {LiveKit},
url = {https://huggingface.co/livekit/turn-detector}
}livekit/turn-detector. Fisher corpus terms apply to anything trained on it.