Downloads · 30 days
2
7% of all-time downloads
DanKau/gliner2-guard-onnx
gliner2-guard-onnx is a text classification model from DanKau. Use it when you need a label for a piece of text. It is set up for onnx. The card lists the license as apache-2.0.
ONNX export of fastino/gliguard-LLMGuardrails-300M, an encoder-based guardrail model for LLM prompt and response moderation — safety, toxicity, jailbreak and refusal detection as structured classification rather than…
Downloads · 30 days
2
7% of all-time downloads
All-time downloads
30
Public
Repo size
830 MB
Likes
0
Public
Click a slice to open those files.
.onnx830 MB · 99%
From the Hugging Face model README
ONNX export of fastino/gliguard-LLMGuardrails-300M, an encoder-based guardrail model for
LLM prompt and response moderation — safety, toxicity, jailbreak and refusal detection as
structured classification rather than generation.
Exported for SecuPi's unstructured AI service (SPAI), which runs it through ONNX Runtime from Java. Published so that service can fetch it without a PyTorch dependency; anyone else is welcome to use it under the same licence as the base model.
| file | what it is |
|---|---|
onnx/encoder.onnx | DeBERTa-v3-base encoder over the schema prompt + text |
onnx/classifier.onnx | classification head, Linear(768→1536) → ReLU → Linear(1536→1), scored at each [L] marker |
onnx/span_rep.onnx | span representations (entity recognition path) |
onnx/count_embed.onnx | count embedding — see the note below |
gliner2_config.json, config.json | special-token ids and model configuration |
tokenizer.json, tokenizer_config.json | tokenizer |
count_lstm_v2 noteThis checkpoint is fine-tuned from fastino/gliner2-base-v1, so its count-embedding layer is
count_lstm_v2, not the count_lstm used by gliner2-multi-v1/-large-v1. The two share the
same GRU (same parameters, same gate order); they differ in what consumes its output:
The export unrolls the GRU for count=1 (the only value inference uses) and reimplements the
transformer's attention with shape-agnostic reshapes, because nn.MultiheadAttention otherwise
freezes the traced label count into its head-split Reshape and the graph then accepts only that
many labels. count_embed.onnx here takes label_embeddings (num_labels, 768) and returns
transformed_embeddings of the same shape, for any num_labels.
Verified against native PyTorch: max elementwise difference 1.9e-06 for the unroll, 3.8e-06 for ONNX Runtime vs PyTorch, and 94/94 classification fixtures reproduce native label and score within 0.05.
Exported from fastino/gliguard-LLMGuardrails-300M at revision fa88fefc9d2261075e038dd40716354b803a2cb4.
Apache 2.0, inherited from the base model. This repository redistributes the same weights in a different serialisation; all credit for the model belongs to Fastino.