Spaces:
Running
Running
Update infer.py
Browse files
infer.py
CHANGED
@@ -61,7 +61,7 @@ class PromptGuardAnomalyDetector(AbstractAnomalyDetector):
|
|
61 |
super().__init__(threshold)
|
62 |
print('Loading prompt guard model...')
|
63 |
self.classifier = pipeline(
|
64 |
-
"text-classification", model="
|
65 |
)
|
66 |
|
67 |
def detect_anomaly(
|
@@ -80,7 +80,7 @@ class PromptGuardAnomalyDetector(AbstractAnomalyDetector):
|
|
80 |
KnownAttackVector(
|
81 |
known_prompt=anomaly["label"],
|
82 |
similarity_percentage=anomaly["score"],
|
83 |
-
source="Prompt-Guard-86M",
|
84 |
)
|
85 |
for anomaly in anomalies
|
86 |
if anomaly["score"] >= threshold
|
|
|
61 |
super().__init__(threshold)
|
62 |
print('Loading prompt guard model...')
|
63 |
self.classifier = pipeline(
|
64 |
+
"text-classification", model="meta-llama/Llama-Prompt-Guard-2-86M"
|
65 |
)
|
66 |
|
67 |
def detect_anomaly(
|
|
|
80 |
KnownAttackVector(
|
81 |
known_prompt=anomaly["label"],
|
82 |
similarity_percentage=anomaly["score"],
|
83 |
+
source="meta-llama/Llama-Prompt-Guard-2-86M",
|
84 |
)
|
85 |
for anomaly in anomalies
|
86 |
if anomaly["score"] >= threshold
|