ThaiSafetyClassifier WebGPU Q4
Independent browser conversion of typhoon-ai/ThaiSafetyClassifier, pinned at revision 1ebdbca46dcc433a141f96e8137d1f2a31de9a44.
Used by the Typhoon WebGPU Playground. Model files are downloaded on demand, and neural inference runs on the visitor’s WebGPU hardware. Input text, images, and audio stay in the browser.
Model and conversion
A binary classifier for an LLM response in the context of its prompt, using the exact ThaiSafetyClassifier adapter merged with its Microsoft DeBERTa-v3-base foundation. The model is intended for Thai language/cultural contexts.
Input format is input: <prompt> output: <response>. Tokenize the combined text with a maximum length of 256. Labels are 0 → safe and 1 → harmful. Text beyond the limit is not evaluated; the playground shows a truncation notice and both class probabilities.
The export contains 98 symmetric block-32 INT4 MatMulNBits matrices and one GatherBlockQuantized embedding operator. Activations, normalization parameters, and biases remain FP32. The merged classifier is exported to ONNX, and shared projection aliases are folded. The manifest records the exact source revision, hashes, and example native/Q4 logits.
Hardware-WebGPU smoke checks validate execution, not safety accuracy. Quantization can change borderline labels; the manifest includes an observed label change among its small reference examples. Scores are model predictions, not calibrated guarantees. Review outputs in their original context.
Browser runtime
ONNX Runtime Web 1.30.0 for the classifier, with the exported tokenizer loaded by Transformers.js 4.3.2.
Use a current desktop Chrome or Edge with hardware acceleration enabled. Tokenization/preprocessing/decoding can run in JavaScript; neural inference uses WebGPU. The application selects no CPU model or full-precision model fallback. Four-bit refers to the quantized weights; the floating-point exceptions are described above.
All package files are at this repository’s root, with ONNX graphs under onnx/ where applicable. manifest.json records source provenance, quantization, file sizes, and SHA-256 checksums. Exporters and runtime integration are available in the playground’s source repository. This is an independent conversion, not an official Typhoon release, and attribution does not imply endorsement.
License and attribution
The ThaiSafetyClassifier weights use Apache License 2.0. The Microsoft DeBERTa base retains its MIT license. See NOTICE for author attribution, source links, and conversion details.
- Downloads last month
- -
Model tree for saksornr/ThaiSafetyClassifier-webgpu-q4
Base model
microsoft/deberta-v3-base