Spaces:
Running
Running
Update infer.py
Browse files
infer.py
CHANGED
@@ -60,8 +60,9 @@ class PromptGuardAnomalyDetector(AbstractAnomalyDetector):
|
|
60 |
def __init__(self, threshold: float):
|
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(
|
|
|
60 |
def __init__(self, threshold: float):
|
61 |
super().__init__(threshold)
|
62 |
print('Loading prompt guard model...')
|
63 |
+
hf_token = os.environ.get('HF_TOKEN')
|
64 |
self.classifier = pipeline(
|
65 |
+
"text-classification", model="meta-llama/Llama-Prompt-Guard-2-86M", token=hf_token
|
66 |
)
|
67 |
|
68 |
def detect_anomaly(
|