Downloads · 30 days
21
3% of all-time downloads
Derbdale/Llama-Prompt-Guard-86M-ONNX
Llama-Prompt-Guard-86M-ONNX is a text classification model from Derbdale. Use it when you need a label for a piece of text. It is set up for onnx. The card lists the license as llama3.1.
Downloads · 30 days
21
3% of all-time downloads
All-time downloads
776
Public
Repo size
1.1 GB
Likes
1
Public
Click a slice to open those files.
.onnx1.1 GB · 99%
From the Hugging Face model README
Built with Llama.
This repo provides a quantized ONNX Runtime export of meta-llama/Prompt-Guard-86M.
model.onnx: INT8 quantized graph (ONNX Runtime dynamic quantization)tokenizer.json / tokenizer_config.jsonconfig.jsonLICENSE (Llama 3.1 Community License) and NOTICEoptimum-cli export onnx ... then onnxruntime.quantization ...import onnxruntime as ort
from transformers import AutoTokenizer
tok = AutoTokenizer.from_pretrained("<you>/Prompt-Guard-86M-onnx-int8")
session = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
text = "your input"
enc = tok(text, return_tensors="np", padding=True, truncation=True)
outputs = session.run(None, {k: v for k, v in enc.items()})