BUG: LLMGenericTextConverter identifier changes between processes for set-valued template parameters
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue nà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
- 75/100
Hướng nghiên cứu
Bắt đầu tại _describe_template_value trong llm_generic_text_converter.py, khoảng dòng 67, nơi các giá trị set và frozenset được xử lý như list. Chạy script tái hiện hai lần, với PYTHONHASHSEED đặt là 1 và 2, rồi so sánh đầu ra của định danh. Hoàn thành khi định danh giống nhau giữa các seed và việc render template không thay đổi, như issue yêu cầ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
_describe_template_value handles set and frozenset like a list (llm_generic_text_converter.py:67), so the identifier follows set iteration order. That order depends on PYTHONHASHSEED, so the same configuration gets a different hash in each process.
Steps/Code to Reproduce
Run on main at 5fb4fb977, once with PYTHONHASHSEED=1 and once with PYTHONHASHSEED=2.
import asyncio
from pyrit.converter import LLMGenericTextConverter
from pyrit.models import SeedPrompt
from pyrit.prompt_target import OpenAIChatTarget
from pyrit.setup import IN_MEMORY, initialize_pyrit_async
async def main() -> None:
await initialize_pyrit_async(memory_db_type=IN_MEMORY, silent=True)
target = OpenAIChatTarget(endpoint="https://example.invalid/v1", api_key="unused", model_name="model-a")
converter = LLMGenericTextConverter(
converter_target=target,
system_prompt_template=SeedPrompt(value="Use one of these tones: {{ tone }}", parameters=["tone"]),
tone={"alpha", "beta", "gamma", "delta", "epsilon", "zeta"},
)
print(converter.get_identifier().unique_name)
asyncio.run(main())
Expected Results
The same identifier in both runs.
Actual Results
PYTHONHASHSEED=1 LLMGenericTextConverter::34b80fa1
PYTHONHASHSEED=2 LLMGenericTextConverter::9136bd54
Versions
- OS: Windows 11
- Python version: 3.12.0
- PyRIT version: source checkout of
mainat5fb4fb977
System:
python: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
executable: C:\dev\pyr-main\Scripts\python.exe
machine: Windows-11-10.0.26300-SP0
Python dependencies:
pyrit: 1.2.0.dev0
Cython: None
numpy: 2.4.6
openai: 2.54.0
packaging: 26.3
pip: 23.2.1
scipy: 1.17.1
setuptools: 84.2.1
sqlite3: None
torch: None
transformers: 5.20.2
The rendered prompt moves too when a template prints the set: {{ tone }} gives a different order under each seed. Sorting inside _describe_template_value fixes the identifier. Rendering is a separate call: leave it, or reject sets as template parameters.
- Ngôn ngữ chính
- Python
- Star
- 4.7k
- Fork
- 1k
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 450
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: SelfAskGeneral scorers leave their output keys out of the identifierCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởBug: triage
Độ 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 2 ngày
-
Description-only preset edits split comma-containing exact goals into separate goalsCó thể đã có người làm @MRX-72 đã nhận 2 ngày trước. Đang mởhelp wanted
Độ 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
-
GUI rejects valid empty-string SearchReplaceConverter settings, preventing deletion convertersCó thể đã có người làm @Darshika140 đã nhận 1 ngày trước. Đang mởhelp wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/PyRIT#3749 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
HTML scenario export replaces an intentionally empty converted message with the original textCó thể đã có người làm @VISHNU0906 đã nhận 2 ngày trước. Đang mởhelp wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
microsoft/PyRIT#3741 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
ReferenceField has no component tests and only 42.4% line coverageCó thể đã có người làm @ppcvote đã nhận 1 ngày trước. Đang mởhelp wanted
Độ 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 2 ngày
Tất cả issue của microsoft/PyRIT
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
unionai-oss/pandera#2640 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
JdeRobot/RoboticsInfrastructure#843 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automated endpoint-dead needs-curation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
almanac-data/climate-almanac#122 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:harness enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
evarness-ai/iris-harness#420 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
suitenumerique/find#206 ·
Maintainer thường phản hồi trong vòng 2 ngày