Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] add harm categories to AdvBench Dataset #732

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions pyrit/datasets/fetch_example_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ def fetch_adv_bench_dataset(
# Extract and append the data to respective containers
prompts = [item["goal"] for item in examples if "goal" in item]

# harm_categories = _fetch_from_file("pyrit/datasets/harm_categories/adv_bench_dataset.json", "json")
# harm_categories_list = list(harm_categories.values())

harm_categories = [
"Endangering National Security",
"Insulting Behavior",
Expand Down Expand Up @@ -562,13 +565,15 @@ def fetch_adv_bench_dataset(
name="AdvBench Dataset",
dataset_name="AdvBench Dataset",
harm_categories=harm_categories,
# harm_categories=harm_categories_list[i],
description="""AdvBench is a set of 520 harmful behaviors formulated as instructions. These behaviors
range over the same themes as the harmful strings setting, but the adversary's goal is instead to find
a single attack string that will cause the model to generate any response that attempts to comply with
the instruction, and to do so over as many harmful behaviors as possible.""",
source="https://github.com/llm-attacks/llm-attacks/tree/main/data/advbench",
)
for prompt in prompts
# for i, prompt in enumerate(prompts)
]

seed_prompt_dataset = SeedPromptDataset(prompts=seed_prompts)
Expand Down
Loading