mirror of
https://github.com/jiaxiaojunQAQ/OmniSafeBench-MM.git
synced 2026-08-28 06:00:27 +02:00
Enhance project configuration and structure: Added build-system requirements in pyproject.toml, updated README for installation instructions, and refactored attack classes to utilize a new create_test_case method. Introduced a plugins.yaml for component registration and removed the legacy registry initialization file.
This commit is contained in:
+8
-14
@@ -13,7 +13,7 @@ from PIL import Image, ImageFont, ImageDraw
|
||||
import textwrap
|
||||
|
||||
from core.data_formats import TestCase
|
||||
from core.unified_registry import BaseAttack
|
||||
from core.base_classes import BaseAttack
|
||||
|
||||
|
||||
from . import utils
|
||||
@@ -236,17 +236,11 @@ class MMLAttack(BaseAttack):
|
||||
"images_rotate", "images_rotate"
|
||||
).format(scrambled_prompt)
|
||||
|
||||
test_case = TestCase(
|
||||
test_case_id=case_id,
|
||||
image_path=img_path,
|
||||
prompt=adv_prompt,
|
||||
metadata={
|
||||
"attack_method": "mml",
|
||||
"original_prompt": original_prompt,
|
||||
"jailbreak_prompt": adv_prompt,
|
||||
"jailbreak_image_path": img_path,
|
||||
"aug_type": self.cfg.aug_type,
|
||||
},
|
||||
return self.create_test_case(
|
||||
case_id=case_id,
|
||||
jailbreak_prompt=adv_prompt,
|
||||
jailbreak_image_path=str(img_path),
|
||||
original_prompt=original_prompt,
|
||||
original_image_path=str(image_path),
|
||||
metadata={"aug_type": self.cfg.aug_type},
|
||||
)
|
||||
|
||||
return test_case
|
||||
|
||||
Reference in New Issue
Block a user