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

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 demo
  • test-node.js - Node.js test script
  • package.json - Node.js dependencies
Downloads last month
2
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support