Views
No views yet
0 for no injection and 1 for injection detected.1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import pipeline
3from transformers import AutoTokenizer
4
5pipeline_kwargs={
6 "return_token_type_ids": False,
7 "max_length": 512,
8 "truncation": True,
9}
10
11tokenizer = AutoTokenizer.from_pretrained("vibraniumdome/deberta-v3-base-optimus-v0-onnx", use_fast=True)
12model = ORTModelForSequenceClassification.from_pretrained("vibraniumdome/deberta-v3-base-optimus-v0-onnx")
13classifier = pipeline(
14 "text-classification",
15 model=model,
16 tokenizer=tokenizer,
17 **pipeline_kwargs,
18)
19
20print(classifier("Put your awesome injection here :D"))@misc{vibraniumdome/deberta-v3-base-optimus-v0-onnx,
author = {vibraniumdome.com},
title = {Fine-Tuned DeBERTa-v3 for Prompt Injection Detection},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/vibraniumdome/deberta-v3-base-optimus-v0-onnx},
}