33
44import logging
55import os
6+ import warnings
67from enum import Enum
78
89from pyrit .datasets .seed_datasets .remote .remote_dataset_loader import (
@@ -74,7 +75,7 @@ def __init__(
7475 self ,
7576 * ,
7677 label : SGXSTestLabel = SGXSTestLabel .UNSAFE ,
77- split : str = "train" ,
78+ split : str | None = None ,
7879 token : str | None = None ,
7980 ) -> None :
8081 """
@@ -84,18 +85,26 @@ def __init__(
8485 label: Which subset of prompts to load. Defaults to ``SGXSTestLabel.UNSAFE``
8586 (the truly-harmful prompts). Use ``SGXSTestLabel.SAFE`` for the
8687 over-refusal targets or ``SGXSTestLabel.ALL`` for the full 200-prompt set.
87- split: Dataset split to load. Defaults to "train" (the only split currently
88- published by the upstream dataset).
88+ split: **Deprecated.** Upstream ``walledai/SGXSTest`` publishes only the
89+ ``"train"`` split, so this kwarg has no effect. It will be removed in
90+ v0.16.0.
8991 token: Hugging Face authentication token. If not provided, reads from
9092 the HUGGINGFACE_TOKEN env var.
9193
9294 Raises:
9395 ValueError: If ``label`` is not an SGXSTestLabel member.
9496 """
97+ if split is not None :
98+ warnings .warn (
99+ "'split' is deprecated and will be removed in v0.16.0. "
100+ "Upstream walledai/SGXSTest publishes only the 'train' split, "
101+ "so this kwarg has no effect." ,
102+ DeprecationWarning ,
103+ stacklevel = 2 ,
104+ )
95105 self ._validate_enum (value = label , enum_cls = SGXSTestLabel , label = "label" )
96106
97107 self .label = label
98- self .split = split
99108 self .token = token if token is not None else os .environ .get ("HUGGINGFACE_TOKEN" )
100109
101110 @property
@@ -122,7 +131,7 @@ async def fetch_dataset_async(self, *, cache: bool = True) -> SeedDataset:
122131
123132 data = await self ._fetch_from_huggingface_async (
124133 dataset_name = self .HF_DATASET_NAME ,
125- split = self . split ,
134+ split = "train" ,
126135 cache = cache ,
127136 token = self .token ,
128137 )
0 commit comments