Downloads · 30 days
13
16% of all-time downloads
AtliQ-Technologies/toxicity-fast-onnx
toxicity-fast-onnx is a text classification model from AtliQ-Technologies. Use it when you need a label for a piece of text. It is set up for onnx.
RoBERTa toxicity classifier exported to ONNX for fast CPU inference. This is the default safety classifier loaded by GuardEx in local mode.
Downloads · 30 days
13
16% of all-time downloads
All-time downloads
80
Public
Repo size
624 MB
Likes
0
Public
Click a slice to open those files.
.onnx624 MB · 99%
From the Hugging Face model README
RoBERTa toxicity classifier exported to ONNX for fast CPU inference. This is the default safety classifier loaded by GuardEx in local mode.
The repo ships two weights:
model.onnx — full precision (~499 MB)model_int8.onnx — int8 quantized (~125 MB), smaller and faster with a small
accuracy trade-off| id | label |
|---|---|
| 0 | neutral |
| 1 | toxic |
GuardEx maps neutral → safe and toxic → unsafe.
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer
import onnxruntime as ort
repo = "AtliQ-Technologies/toxicity-fast-onnx"
tok = AutoTokenizer.from_pretrained(repo)
sess = ort.InferenceSession(hf_hub_download(repo, "model_int8.onnx"))
enc = tok("text to check", return_tensors="np", truncation=True, max_length=128)
inputs = {i.name: enc[i.name] for i in sess.get_inputs()}
logits = sess.run(None, inputs)[0]
print(["neutral", "toxic"][int(logits.argmax())])
Exported from s-nlp/roberta_toxicity_classifier. Max sequence length 128.