ONNX export of fakespot-ai/roberta-base-ai-text-detection-v1 (Apache-2.0) for running in the browser with transformers.js. Used by AI Content Detector.
onnx/model.onnx: fp32, exported with Optimum.onnx/model_quantized.onnx: dynamic 8-bit quantization (uint8 weights), about 125 MB.On the AI-CD benchmark (2,474 held-out texts) the 8-bit model scores the same AUROC as the original PyTorch weights; see backend/eval/onnx.json in the GitHub repo.
import { AutoTokenizer, AutoModelForSequenceClassification } from "@huggingface/transformers";
const id = "ZubairElliot17/aicd-roberta-onnx";
const tokenizer = await AutoTokenizer.from_pretrained(id);
const model = await AutoModelForSequenceClassification.from_pretrained(id, { dtype: "q8" });
onnx/model.onnx 499 MBonnx/model_quantized.onnx 125 MB