BUG: ComicJailbreak max_examples counts goals that render nothing, so templates=["code"] with max_examples=10 fails
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Đọc pyrit/datasets/seed_datasets/remote/comic_jailbreak_dataset.py, đặc biệt là _fetch_dataset_async, và theo dõi cách đếm các mục tiêu đối chiếu với max_examples khi thiếu văn bản mẫu đã chọn. Trước tiên, hãy kiểm tra các trường hợp được báo cáo cho code, instruction và giới hạn bằng không. Hoàn tất khi giới hạn đếm các mục tiêu đã render và các giá trị nhỏ hơn 1 gây ra ValueError đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
_ComicJailbreakDataset (pyrit/datasets/seed_datasets/remote/comic_jailbreak_dataset.py) documents max_examples as the "maximum number of source goals to render", but _fetch_dataset_async counts every goal it looks at, including goals that have no text for any of the selected templates and so render nothing. In the dataset, 213 of the 300 goals have no Code text, 61 have no Instruction text and 59 have no Speech text, so the cap is used up by goals that produce no seeds:
templates=["code"], max_examples=10: none of the first 10 goals hasCodetext, so nothing is rendered and loading fails withSeedDataset cannot be empty.templates=["instruction"], max_examples=10: only 2 goals are rendered.
The cap is also checked only after a goal has been rendered, so max_examples=0 (or a negative value) still renders one goal.
Steps/Code to Reproduce
import asyncio
from pyrit.datasets.seed_datasets.remote.comic_jailbreak_dataset import _ComicJailbreakDataset
from pyrit.models import SeedObjective
from pyrit.setup.initialization import IN_MEMORY, initialize_pyrit_async
async def main():
await initialize_pyrit_async(memory_db_type=IN_MEMORY)
for templates, max_examples in ((["code"], 10), (["instruction"], 10), (["article"], 0)):
try:
loader = _ComicJailbreakDataset(templates=templates, max_examples=max_examples)
dataset = await loader.fetch_dataset_async(cache=False)
except ValueError as e:
print(f"templates={templates} max_examples={max_examples}: ValueError: {str(e).splitlines()[0]}")
continue
goals = {s.value for s in dataset.seeds if isinstance(s, SeedObjective)}
print(f"templates={templates} max_examples={max_examples}: {len(goals)} goals")
asyncio.run(main())
Expected Results
max_examples goals are rendered for each template, and a cap below 1 is rejected:
templates=['code'] max_examples=10: 10 goals
templates=['instruction'] max_examples=10: 10 goals
templates=['article'] max_examples=0: ValueError: max_examples must be at least 1 or None, got 0
Actual Results
templates=['code'] max_examples=10: ValueError: 1 validation error for SeedDataset
templates=['instruction'] max_examples=10: 2 goals
templates=['article'] max_examples=0: 1 goals
The first error is SeedDataset cannot be empty.
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (6224d531) in editable mode
- Ngôn ngữ chính
- Python
- Star
- 4.7k
- Fork
- 980
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 422
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PyRIT
-
BUG: Garak and ML-VLSU loaders still load one example when max_examples is 0 or negativeCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: SeedDatasetFilter matches harm_categories, modalities and size case-sensitively, unlike tagsCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Conversation drawer shows the previous attack's conversations after switching attacksCó thể đã có người làm @ManoharPaturi đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/PyRIT#3575 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Conversation draft turns permanently dirty when applied conversions match no pieceCó thể đã có người làm @ManoharPaturi đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
microsoft/PyRIT#3573 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Analytics page treats a bare # fragment as a malformed link and disables the dashboardCó thể đã có người làm @ManoharPaturi đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
microsoft/PyRIT#3571 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
backlog
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
EchoTools/nevr-runtime#1108 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
parse names a key after a top-level multi() threshold Bitcoin Core v31.1 refuses as not validĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
btclib-org/btclib-wallet#587 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Judgment-Pack/judgment-pack-spec#275 ·
Maintainer thường phản hồi trong vòng 1 ngày