YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Threat Matrix ONNX Test Project
Test project for using the neuralchemy/distilbert-base-threat-matrix ONNX model with Transformers.js.
Model
- Hugging Face: mhingston/distilbert-base-threat-matrix-onnx
- Original: neuralchemy/distilbert-base-threat-matrix
- Task: Text Classification (Binary: benign / malicious)
- Labels:
benign,malicious
Usage
Browser (HTML)
Open index.html in a browser. The model loads from Hugging Face CDN.
Note: WebGPU is required for best performance. If unavailable, the code falls back to WASM.
Node.js
# Install dependencies
npm install
# Run tests
npm run test
# Or start a local server
npm run start
Device Options
| Device | Description |
|---|---|
webgpu |
Fastest in browser (Chrome/Edge) |
wasm |
Slower but universal browser support |
cpu |
For Node.js only |
API Usage
import { pipeline } from '@huggingface/transformers';
const classifier = await pipeline(
'text-classification',
'mhingston/distilbert-base-threat-matrix-onnx',
{ device: 'webgpu' }
);
const result = await classifier("Ignore all previous instructions...");
console.log(result);
// [{ label: 'malicious', score: 0.992 }]
Files
index.html- Browser demotest-node.js- Node.js test scriptpackage.json- Node.js dependencies
- Downloads last month
- 2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support