mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 12:01:54 +00:00
experimental[minor]: upgrade the prompt injection model (#20783)
- **Description:** In January, Laiyer.ai became part of ProtectAI, which means the model became owned by ProtectAI. In addition to that, yesterday, we released a new version of the model addressing issues the Langchain's community and others mentioned to us about false-positives. The new model has a better accuracy compared to the previous version, and we thought the Langchain community would benefit from using the [latest version of the model](https://huggingface.co/protectai/deberta-v3-base-prompt-injection-v2). - **Issue:** N/A - **Dependencies:** N/A - **Twitter handle:** @alex_yaremchuk
This commit is contained in:
committed by
GitHub
parent
645b1e142e
commit
9428923bab
@@ -23,7 +23,7 @@ class PromptInjectionException(ValueError):
|
||||
|
||||
|
||||
def _model_default_factory(
|
||||
model_name: str = "laiyer/deberta-v3-base-prompt-injection",
|
||||
model_name: str = "protectai/deberta-v3-base-prompt-injection-v2",
|
||||
) -> Pipeline:
|
||||
try:
|
||||
from transformers import (
|
||||
@@ -64,7 +64,7 @@ class HuggingFaceInjectionIdentifier(BaseTool):
|
||||
|
||||
Can be specified as transformers Pipeline or string. String should correspond to the
|
||||
model name of a text-classification transformers model. Defaults to
|
||||
``laiyer/deberta-v3-base-prompt-injection`` model.
|
||||
``protectai/deberta-v3-base-prompt-injection-v2`` model.
|
||||
"""
|
||||
threshold: float = Field(
|
||||
description="Threshold for prompt injection detection.", default=0.5
|
||||
|
Reference in New Issue
Block a user