Token Classification
Transformers
ONNX
Safetensors
Transformers.js
English
modernbert
prompt-injection
indirect-prompt-injection
prompt-localization
sanitization
ai-security
guardrails
tamarillo
prompt-injection-detection
jailbreak-detection
llm-security
litellm
nemo-guardrails
open-webui
Instructions to use Tamarillo/injection-span-guard-tiny-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tamarillo/injection-span-guard-tiny-en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Tamarillo/injection-span-guard-tiny-en")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Tamarillo/injection-span-guard-tiny-en") model = AutoModelForTokenClassification.from_pretrained("Tamarillo/injection-span-guard-tiny-en", device_map="auto") - Transformers.js
How to use Tamarillo/injection-span-guard-tiny-en with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'Tamarillo/injection-span-guard-tiny-en'); - Notebooks
- Google Colab
- Kaggle
Release Tamarillo/injection-span-guard-tiny-en (Apache-2.0, token-level indirect prompt injection localizer & surgical sanitizer, parity-verified ONNX)
6ab45fd verified Download onnx_benchmark.json from Tamarillo/injection-span-guard-tiny-en: direct link, hf CLI and curl.
- Browser
- Download file 2.43 kB
-
https://huggingface.co/Tamarillo/injection-span-guard-tiny-en/resolve/main/onnx_benchmark.json
- Command line
-
hf download hf://Tamarillo/injection-span-guard-tiny-en/onnx_benchmark.json
-
curl -L -o onnx_benchmark.json https://huggingface.co/Tamarillo/injection-span-guard-tiny-en/resolve/main/onnx_benchmark.json
2.43 kB
| { | |
| "threads": 4, | |
| "artifacts": { | |
| "fp32": { | |
| "filename": "onnx/model.onnx", | |
| "size_mb": 122.41, | |
| "parity_short": { | |
| "agreement": 1.0, | |
| "max_abs_prob_diff": 1e-05, | |
| "mean_abs_prob_diff": 0.0, | |
| "n_tokens": 184 | |
| }, | |
| "parity_2048": { | |
| "agreement": 1.0, | |
| "max_abs_prob_diff": 0.0, | |
| "mean_abs_prob_diff": 0.0, | |
| "n_tokens": 8192 | |
| }, | |
| "passed_gate": true, | |
| "cpu_latency_64": { | |
| "seq_len": 64, | |
| "p50_ms": 9.29, | |
| "p95_ms": 9.46, | |
| "n_runs": 25 | |
| }, | |
| "cpu_latency_512": { | |
| "seq_len": 512, | |
| "p50_ms": 72.54, | |
| "p95_ms": 73.56, | |
| "n_runs": 10 | |
| }, | |
| "cpu_latency_1024": { | |
| "seq_len": 1024, | |
| "p50_ms": 219.12, | |
| "p95_ms": 220.38, | |
| "n_runs": 5 | |
| }, | |
| "cpu_latency_2048": { | |
| "seq_len": 2048, | |
| "p50_ms": 763.28, | |
| "p95_ms": 766.73, | |
| "n_runs": 5 | |
| } | |
| }, | |
| "fp16": { | |
| "filename": "onnx/model_fp16.onnx", | |
| "size_mb": 61.3, | |
| "parity_short": { | |
| "agreement": 1.0, | |
| "max_abs_prob_diff": 0.00061, | |
| "mean_abs_prob_diff": 2e-05, | |
| "n_tokens": 184 | |
| }, | |
| "parity_2048": { | |
| "agreement": 0.99963, | |
| "max_abs_prob_diff": 0.00812, | |
| "mean_abs_prob_diff": 3e-05, | |
| "n_tokens": 8192 | |
| }, | |
| "passed_gate": true, | |
| "cpu_latency_64": { | |
| "seq_len": 64, | |
| "p50_ms": 11.5, | |
| "p95_ms": 12.29, | |
| "n_runs": 25 | |
| }, | |
| "cpu_latency_512": { | |
| "seq_len": 512, | |
| "p50_ms": 90.57, | |
| "p95_ms": 92.82, | |
| "n_runs": 10 | |
| }, | |
| "cpu_latency_1024": { | |
| "seq_len": 1024, | |
| "p50_ms": 291.21, | |
| "p95_ms": 292.1, | |
| "n_runs": 5 | |
| }, | |
| "cpu_latency_2048": { | |
| "seq_len": 2048, | |
| "p50_ms": 999.15, | |
| "p95_ms": 1004.17, | |
| "n_runs": 5 | |
| } | |
| }, | |
| "int8": { | |
| "filename": "onnx/model_quantized.onnx", | |
| "size_mb": 86.83, | |
| "parity_short": { | |
| "agreement": 0.92935, | |
| "max_abs_prob_diff": 0.99654, | |
| "mean_abs_prob_diff": 0.04339, | |
| "n_tokens": 184 | |
| }, | |
| "parity_2048": { | |
| "agreement": 0.9967, | |
| "max_abs_prob_diff": 0.80684, | |
| "mean_abs_prob_diff": 0.00324, | |
| "n_tokens": 8192 | |
| }, | |
| "passed_gate": false, | |
| "deleted_due_to_parity_gate": true | |
| } | |
| } | |
| } |