ONNX Model Zoo

FireRedTeam/FireRedChat-turn-detector

By FireRedTeam · ↓ 0 · ♥ 5 · Updated 2025-09-22

What's in this repo

This page lists the files in FireRedTeam/FireRedChat-turn-detector, including chinese_best_model_q8.onnx, multilingual_best_model_q8.onnx.

  • 2 ONNX models (.onnx files)
  • 12 files, including 4 .json, 2 .onnx, 2 .sh, 1 .md, 1 .py, 1 .txt
  • Last updated 2025-09-22

ONNX files

File Size Download
chinese_best_model_q8.onnx — Download
multilingual_best_model_q8.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

FireRedChat-turn-detector

Demo • Paper • Huggingface

Descriptions

Compact end-of-turn detection used in FireRedChat. livekit plugin available here

  • chinese_best_model_q8.onnx: FireRedChat turn-detector model (Chinese only)
  • multilingual_best_model_q8.onnx: FireRedChat turn-detector model (Chinese and English)

Roadmap

  • [x] 2025/09
    • [x] Release the onnx checkpoints and livekit plugin.

Usage

import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer

def softmax(x):
    exp_x = np.exp(x - np.max(x, axis=1, keepdims=True))
    return exp_x / np.sum(exp_x, axis=1, keepdims=True)

session = ort.InferenceSession(
    "chinese_best_model_q8.onnx", providers=["CPUExecutionProvider"]
)

tokenizer = AutoTokenizer.from_pretrained(
    "./tokenizer",
    local_files_only=True,
    truncation_side="left"
)

text = "这是一句没有标点的文本"
inputs = tokenizer(
            text,
            truncation=True,
            padding='max_length',
            add_special_tokens=False,
            return_tensors="np",
            max_length=128,
        )
# Run inference
outputs = session.run(None, 
                      {
                          "input_ids": inputs["input_ids"].astype("int64"), 
                          "attention_mask": inputs["attention_mask"].astype("int64")
                      })
eou_probability = softmax(outputs[0]).flatten()[-1]
print(eou_probability, eou_probability>0.5)

Acknowledgment

  • Base model: google-bert/bert-base-multilingual-cased (license: "apache-2.0")

Model info

onnx agent zh en arxiv:2509.06502 base_model:google-bert/bert-base-multilingual-cased base_model:quantized:google-bert/bert-base-multilingual-cased license:apache-2.0 region:us
↓ 0 ♥ 5

Created: 2025-09-15

Updated: 2025-09-22

View on Hugging Face

Files (12)

.gitattributes
README.md
chinese_best_model_q8.onnx ONNX
inference_onnx.py
multilingual_best_model_q8.onnx ONNX
run_chinese.sh
run_multilingual.sh
tokenizer/config.json
tokenizer/special_tokens_map.json
tokenizer/tokenizer.json
tokenizer/tokenizer_config.json
tokenizer/vocab.txt

Related models