Downloads · 30 days
9
16% of all-time downloads
AtliQ-Technologies/guardex-roberta-safety
guardex-roberta-safety is a text classification model from AtliQ-Technologies. Use it when you need a label for a piece of text. It is set up for transformers.
Binary classifier that labels a piece of text as safe or unsafe. Used by GuardEx, an LLM guardrail library, as one of its content-safety models.
Downloads · 30 days
9
16% of all-time downloads
All-time downloads
55
Public
Parameters
125M
499 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
Binary classifier that labels a piece of text as safe or unsafe. Used by
GuardEx, an LLM guardrail library, as one of
its content-safety models.
| id | label |
|---|---|
| 0 | safe |
| 1 | unsafe |
Held-out evaluation:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo = "AtliQ-Technologies/guardex-roberta-safety"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo)
enc = tok("text to check", return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**enc).logits
print(model.config.id2label[int(logits.argmax())]) # "safe" or "unsafe"
Fine-tuned from s-nlp/roberta_toxicity_classifier with hyperparameter
optimization. Max sequence length 128.