BUG: ColloquialWordswapConverter identifier ignores custom substitution values
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
- 25/100
Hướng nghiên cứu
Read ColloquialWordswapConverter's identifier construction and compare it with LeetspeakConverter, which the issue identifies as handling full custom mappings. Check how the converter's identifier is tested; done means configurations with identical keys but different substitution values have different identifiers and both can register. A linked open pull request indicates this work is already underway.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
ColloquialWordswapConverter identifies custom_substitutions only by their keys (substitution_keys). Two converters whose custom dictionaries have the same words but different substitutions produce different output but share one hash.
Because the default registry name comes from that hash, registering a second configuration without a custom name raises a duplicate-name error, and memory and analytics cannot tell the configurations apart. LeetspeakConverter already handles the same case by adding a custom_substitutions_hash of the full mapping. This is the same kind of problem as #3242 and #3244.
Steps/Code to Reproduce
import asyncio
from pyrit.converter import ColloquialWordswapConverter
from pyrit.registry import ConverterRegistry
papa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["papa"]})
bapa = ColloquialWordswapConverter(deterministic=True, custom_substitutions={"father": ["bapa"]})
print(papa.get_identifier().unique_name, bapa.get_identifier().unique_name)
print(asyncio.run(papa.convert_async(prompt="my father")).output_text)
print(asyncio.run(bapa.convert_async(prompt="my father")).output_text)
registry = ConverterRegistry()
registry.instances.register(papa)
registry.instances.register(bapa)
Expected Results
The two converters have different identifiers, and both register.
Actual Results
ColloquialWordswapConverter::ab18d07b ColloquialWordswapConverter::ab18d07b
my papa
my bapa
ValueError: Instance 'ColloquialWordswapConverter::ab18d07b' already exists
Screenshots
N/A
Versions
- OS: Windows 11
- Python version: 3.11.9
- PyRIT version: installed from main (5b594e00) in editable mode
- Ngôn ngữ chính
- Python
- Star
- 4.6k
- Fork
- 962
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 354
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: label queries only return the final conversation of an attackCó thể đã có người làm @u7k4rs6 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/PyRIT#3095 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
microsoft/PyRIT#3325 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Detection coverage gaps: 47 missed payload classes across 9 output scorersCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 53/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 46/100
Maintainer thường phản hồi trong vòng 2 ngày
-
BUG: Tone, Tense, Translation, Noise, ScientificTranslation and Variation converter identifiers ignore a custom prompt_templateCó thể đã có người làm @ShivamSharma43 đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
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ự
-
Pull-through from gcr.io returns 500 when pulling using podman/buildahCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởIssue Triage-Needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pulp/pulp_container#2581 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4040 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
ClanGenOfficial/clangen#6313 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJobCó thể đã có người làm @avanishkasar đã 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
kubeflow/sdk#879 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày