BUG: SelfAskGeneral scorers leave their output keys out of the identifier
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
pyrit/score/self_ask_general_true_false_scorer.py(136行目付近)の _build_identifier と、pyrit/score/self_ask_general_float_scale_scorer.py(137行目付近)の対応するメソッドから始め、5つの *_output_key 引数のうちどれがすでに記録されているかを確認してください。不足しているキーを両方の識別子に追加し、その後 issue の再現スクリプトを実行して、異なる出力キーが異なる unique_name ハッシュを生成するようになったことを確認してください。両方のスコアラーの識別子がキーごとに異なり、既存のスコアラーのテストが引き続き通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The five *_output_key arguments of SelfAskGeneralTrueFalseScorer and SelfAskGeneralFloatScaleScorer decide which field of the judge's JSON becomes the score, the rationale and the rest. _build_identifier records none of them (self_ask_general_true_false_scorer.py:136, self_ask_general_float_scale_scorer.py:137), so two scorers that read different fields share one hash. Split out of #3477, which only closes the converter side.
Steps/Code to Reproduce
Run on main at 5fb4fb977.
import asyncio
from pyrit.prompt_target import OpenAIChatTarget
from pyrit.score import NumericRange, SelfAskGeneralFloatScaleScorer, SelfAskGeneralTrueFalseScorer
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")
for key in ("score_value", "verdict"):
kwargs = {"chat_target": target, "system_prompt_format_string": "Score this.", "score_value_output_key": key}
print(key, SelfAskGeneralTrueFalseScorer(**kwargs).get_identifier().unique_name)
print(key, SelfAskGeneralFloatScaleScorer(scale=NumericRange(minimum_value=0, maximum_value=100), **kwargs).get_identifier().unique_name)
asyncio.run(main())
Expected Results
Different output keys, different identifiers.
Actual Results
score_value SelfAskGeneralTrueFalseScorer::ddd340c4
score_value SelfAskGeneralFloatScaleScorer::61870892
verdict SelfAskGeneralTrueFalseScorer::ddd340c4
verdict SelfAskGeneralFloatScaleScorer::61870892
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 scorer side of the registry-wide test can pick this up once #3312 lands.
- 主要言語
- Python
- スター
- 4.7k
- フォーク
- 1k
- 平均マージ
- 2日 3時間
- マージ済み PR(30日)
- 450
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/PyRIT のほかの issue
-
BUG: LLMGenericTextConverter identifier changes between processes for set-valued template parametersオープンBug: triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
Description-only preset edits split comma-containing exact goals into separate goals対応中かも @MRX-72 が 2 日前に担当しました。 オープンhelp wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
GUI rejects valid empty-string SearchReplaceConverter settings, preventing deletion converters対応中かも @Darshika140 が 1 日前に担当しました。 オープンhelp wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/PyRIT#3749 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
HTML scenario export replaces an intentionally empty converted message with the original text対応中かも @VISHNU0906 が 2 日前に担当しました。 オープンhelp wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
microsoft/PyRIT#3741 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
ReferenceField has no component tests and only 42.4% line coverage対応中かも @ppcvote が 1 日前に担当しました。 オープンhelp wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
microsoft/PyRIT の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
unionai-oss/pandera#2640 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JdeRobot/RoboticsInfrastructure#843 ·
メンテナーはふだん 1 日以内に返信
-
automated endpoint-dead needs-curation
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
almanac-data/climate-almanac#122 ·
メンテナーはふだん 1 日以内に返信
-
area:harness enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
evarness-ai/iris-harness#420 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
suitenumerique/find#206 ·
メンテナーはふだん 2 日以内に返信