2023-09-15 15:06:53 +08:00
|
|
|
from mmengine.config import read_base
|
2025-01-20 19:17:38 +08:00
|
|
|
|
2023-09-15 15:06:53 +08:00
|
|
|
from opencompass.partitioners import NaivePartitioner
|
|
|
|
from opencompass.runners import LocalRunner
|
|
|
|
from opencompass.tasks import OpenICLAttackTask
|
|
|
|
|
|
|
|
with read_base():
|
|
|
|
# choose a list of datasets
|
2025-01-20 19:17:38 +08:00
|
|
|
from opencompass.configs.datasets.promptbench.promptbench_wnli_gen_50662f import \
|
|
|
|
wnli_datasets
|
2024-08-22 14:48:45 +08:00
|
|
|
from opencompass.configs.models.qwen.hf_qwen2_1_5b import models
|
2023-09-15 15:06:53 +08:00
|
|
|
|
|
|
|
datasets = wnli_datasets
|
|
|
|
|
|
|
|
# Please run whole dataset at a time, aka use `NaivePartitioner` only
|
|
|
|
# Please use `OpenICLAttackTask` if want to perform attack experiment
|
|
|
|
infer = dict(
|
|
|
|
partitioner=dict(type=NaivePartitioner),
|
2025-01-20 19:17:38 +08:00
|
|
|
runner=dict(type=LocalRunner,
|
|
|
|
max_num_workers=8,
|
|
|
|
task=dict(type=OpenICLAttackTask)),
|
2023-09-15 15:06:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
attack = dict(
|
|
|
|
attack='textfooler',
|
|
|
|
query_budget=100,
|
|
|
|
prompt_topk=1,
|
|
|
|
)
|