Downloads · 30 days
436
18% of all-time downloads
Moustafa3092/livekit-turn-detector-arabic
livekit-turn-detector-arabic is a text generation model from Moustafa3092. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Fine-tuned Arabic End-of-Utterance (EOU) detection model for LiveKit voice agents.
Downloads · 30 days
436
18% of all-time downloads
All-time downloads
2.4K
Public
Parameters
259M
529 MB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors517 MB · 97%
From the Hugging Face model README
Fine-tuned Arabic End-of-Utterance (EOU) detection model for LiveKit voice agents.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model
model = AutoModelForCausalLM.from_pretrained("Moustafa3092/livekit-turn-detector-arabic")
tokenizer = AutoTokenizer.from_pretrained("Moustafa3092/livekit-turn-detector-arabic", trust_remote_code=True)
# Predict EOU
def predict_eou(text: str) -> float:
formatted = f"<|im_start|>user\n{text}"
inputs = tokenizer(formatted, return_tensors="pt", add_special_tokens=False)
with torch.no_grad():
logits = model(**inputs).logits[0, -1, :]
probs = torch.softmax(logits, dim=-1)
eou_prob = probs[tokenizer.convert_tokens_to_ids("<|im_end|>")]
return eou_prob.item()
# Test
print(predict_eou("شكرا جزيلا")) # Should be high (complete)
print(predict_eou("اممممم")) # Should be low (incomplete)
Export to ONNX:
# Convert model to ONNX format for production
# See deployment documentation
Use in LiveKit Agent:
from livekit.agents import WorkerOptions, cli
from livekit.plugins import turn_detector
# Configure with your fine-tuned model
turn_detector.configure(model_path="path/to/model.onnx")
Complete Utterances (EOU): 20,194 (35.1%)
Incomplete Utterances (non-EOU): 37,281 (64.9%)
Hesitations (Non-EOU) - Speaker thinking, will continue:
Closures (EOU) - Complete short responses:
If you use this model, please cite:
@misc{livekit-turn-detector-arabic,
author = {Moustafa3092},
title = {LiveKit Turn Detector - Arabic},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/Moustafa3092/livekit-turn-detector-arabic}
}
Apache 2.0
Developed by: Moustafa3092 Model Type: Turn Detection / End-of-Utterance Language: Arabic (ar) Base Model: livekit/turn-detector (v0.4.1-intl)