Run this model with HF Jobs
Run holistic-ai/rejection_detection on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/holistic-ai/rejection_detection. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/holistic-ai/rejection_detection on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use holistic-ai/rejection_detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use holistic-ai/rejection_detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="holistic-ai/rejection_detection")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("holistic-ai/rejection_detection") model = AutoModelForSequenceClassification.from_pretrained("holistic-ai/rejection_detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Model Card: distilroberta-base-rejection-v1
This model was originally developed and fine-tuned by Protect AI. It is a fine-tuned version of distilroberta-base, trained on multiple datasets containing rejection responses from LLMs and standard outputs from RLHF datasets.
The goal of this model is to detect LLM rejections when a prompt does not pass content moderation. It classifies responses into two categories:
0: Normal output1: Rejection detected
On the evaluation set, the model achieves:
- Loss: 0.0544
- Accuracy: 0.9887
- Recall: 0.9810
- Precision: 0.9279
- F1 Score: 0.9537
Model Details
- Developed & fine-tuned by: ProtectAI.com
- Base model: distilroberta-base
- Language(s): English
- License: Apache 2.0
- Task: Text classification (Rejection detection)
Intended Use & Limitations
The model is designed to identify rejection responses in LLM outputs, particularly where a refusal or safeguard message is generated.
Limitations:
- Performance depends on the quality and domain of the training data.
- May underperform on text styles or topics underrepresented in training.
- Being based on
distilroberta-base, it is case-sensitive.
Usage
With Hugging Face Transformers
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
import torch
tokenizer = AutoTokenizer.from_pretrained("ProtectAI/distilroberta-base-rejection-v1")
model = AutoModelForSequenceClassification.from_pretrained("ProtectAI/distilroberta-base-rejection-v1")
classifier = pipeline(
"text-classification",
model=model,
tokenizer=tokenizer,
truncation=True,
max_length=512,
device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
)
print(classifier("Sorry, but I can't assist with that."))
- Downloads last month
- 13