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
2 changes: 1 addition & 1 deletion doc/code/datasets/4_dataset_coding.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
" def dataset_name(self) -> str:\n",
" return \"dark_bench\"\n",
"\n",
" async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:\n",
" async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:\n",
" # Fetch from HuggingFace\n",
" data = await self._fetch_from_huggingface(\n",
" dataset_name=\"apart/darkbench\",\n",
Expand Down
2 changes: 1 addition & 1 deletion doc/code/datasets/4_dataset_coding.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SimpleDarkBench(_RemoteDatasetLoader):
def dataset_name(self) -> str:
return "dark_bench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
# Fetch from HuggingFace
data = await self._fetch_from_huggingface(
dataset_name="apart/darkbench",
Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/local/local_dataset_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return self._dataset_name

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Load the dataset from the local YAML file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "aegis_content_safety"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch NVIDIA Aegis AI Content Safety dataset with optional filtering and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "aya_redteaming"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Aya Red-teaming dataset with optional filtering and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "babelscape_alert"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Babelscape ALERT dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "beaver_tails"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch BeaverTails dataset from HuggingFace and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/cbt_bench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "cbt_bench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch CBT-Bench dataset from HuggingFace and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "ccp_sensitive_prompts"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch CCP-sensitive prompts dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "comic_jailbreak"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch ComicJailbreak dataset and return as SeedDataset of image+text pairs.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/darkbench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "dark_bench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch DarkBench dataset from HuggingFace and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/equitymedqa_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "equitymedqa"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch EquityMedQA dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "forbidden_questions"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Forbidden Questions dataset and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/harmbench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "harmbench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch HarmBench dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "harmbench_multimodal"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch HarmBench multimodal examples and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/harmful_qa_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "harmful_qa"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch HarmfulQA dataset from HuggingFace and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "jbb_behaviors"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch JBB-Behaviors dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "librai_do_not_answer"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch LibrAI Do Not Answer dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "llm_lat_harmful"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch LLM-LAT harmful dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "medsafetybench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch MedSafetyBench dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "mlcommons_ailuminate"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch AILuminate dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "multilingual_vulnerability"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Multilingual Vulnerability dataset and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/or_bench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, *, split: str = "train") -> None:
"""
self.split = split

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch OR-Bench dataset from HuggingFace and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "pku_safe_rlhf"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch PKU-SafeRLHF dataset and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/promptintel_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _convert_record_to_seed_prompt(self, record: dict[str, Any]) -> Optional[See
metadata=metadata,
)

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch prompts from the PromptIntel API and return as a SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "red_team_social_bias"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Red Team Social Bias dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _RemoteDatasetLoader(SeedDatasetProvider, ABC):
- HuggingFace Hub

Subclasses must implement:
- fetch_dataset(): Fetch and return the dataset as a SeedDataset
- fetch_dataset_async(): Fetch and return the dataset as a SeedDataset
- dataset_name property: Human-readable name for the dataset
"""

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/salad_bench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _parse_category(category: str) -> str:
"""
return re.sub(r"^O\d+:\s*", "", category)

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch SALAD-Bench dataset from HuggingFace and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "simple_safety_tests"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch SimpleSafetyTests dataset from HuggingFace and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/sorry_bench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "sorry_bench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Sorry-Bench dataset and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/sosbench_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "sosbench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch SOSBench dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "tdc23_redteaming"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch TDC23-RedTeaming dataset and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/toxic_chat_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _extract_harm_categories(self, item: dict[str, Any]) -> list[str]:

return categories

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch ToxicChat dataset from HuggingFace and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "transphobia_awareness"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch Transphobia-Awareness dataset and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "visual_leak_bench"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch VisualLeakBench examples and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/vlguard_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "vlguard"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch VLGuard multimodal examples and return as SeedDataset.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "ml_vlsu"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch ML-VLSU multimodal examples and return as SeedDataset.

Expand Down
2 changes: 1 addition & 1 deletion pyrit/datasets/seed_datasets/remote/xstest_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def dataset_name(self) -> str:
"""Return the dataset name."""
return "xstest"

async def fetch_dataset(self, *, cache: bool = True) -> SeedDataset:
async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
"""
Fetch XSTest dataset and return as SeedDataset.

Expand Down
Loading
Loading