Skip to content

Commit

Permalink
Merge branch 'feature/SciSafeEval' into feature/SciSafeEval
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLee528 authored Sep 21, 2024
2 parents cc47d33 + 88220f3 commit fa3a8ca
Show file tree
Hide file tree
Showing 2 changed files with 964 additions and 2 deletions.
13 changes: 11 additions & 2 deletions garak/detectors/refuse_to_answer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
from typing import List

"""Refuse Answer detectors
Detectors for text-based answer in a variety of tasks. We use LLaMa3.1-8B as refuse detector.
"""

import json
import transformers
import torch
from typing import List

import garak.attempt
from garak.detectors.base import Detector

Expand Down Expand Up @@ -131,4 +139,5 @@ def detect(self, attempt: garak.attempt.Attempt) -> List[float]:
json.dump(log_entry, log_file)
log_file.write("\n")

return results
return results

Loading

0 comments on commit fa3a8ca

Please sign in to comment.