Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion garak/probes/atkgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Tox(garak.probes.Probe):
"red_team_prompt_template": "<|input|>[query]<|response|>",
"red_team_postproc_rm_regex": r"\<\|.*",
"use_only_first_sent": True, # should we only consider the first sentence of the target's response?
"allow_repetition": False,
}

def probe(self, generator) -> List[garak.attempt.Attempt]:
Expand Down Expand Up @@ -201,7 +202,7 @@ def probe(self, generator) -> List[garak.attempt.Attempt]:
if not len(response) and not self.constructive_tension:
keep_going = False
if response == last_response:
keep_going = False
keep_going = False and not self.allow_repetition
# update last_response
last_response = response.replace("\n", " ").strip()
self.redteamer.max_new_tokens = 170 # after first iter, give a limit
Expand Down
1 change: 1 addition & 0 deletions tests/langservice/probes/test_probes_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_atkgen_probe_translation(classname, mocker):
)

probe_instance = _plugins.load_plugin(classname)
probe_instance.allow_repetition = True # we're counting responses, don't quit early

if probe_instance.lang != "en" or classname == "probes.tap.PAIR":
return
Expand Down