TemplateSegmentConverter crashes on prompts shorter than the template parameter count
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
TemplateSegmentConverter から始め、issue に記載された2語・5パラメータのケースを再現します。内部の分割点のサンプリングと、残りのセグメントの文書化された処理を調べます。短いプロンプトで ValueError が発生しなくなり、利用可能なすべての内部点で分割され、残りの Template パラメータが空のままになれば完了です。
索引モデルが issue の本文から書いたものです。
説明
what happens
TemplateSegmentConverter raises ValueError: Sample larger than population or is negative for any prompt whose word count is between 2 and N-1 when the template has N parameters. the code samples min(len(words), N-1) interior split points but the population is only len(words)-1, so a 2-word prompt against a 5-parameter template tries to sample 2 from a population of 1.
the docstring promises empty leftover segments for short prompts, so this contradicts the documented behavior.
repro
words = ["attack", "target"]
num_params = 5
random.sample(range(1, len(words)), min(len(words), num_params - 1))
# ValueError: Sample larger than population
any converter template with more parameters than the prompt has words minus one hits it.
expected
short prompts split at every available interior point and leave the remaining template parameters empty, as documented.
env: main 5503ecb
- 主要言語
- Python
- スター
- 4.5k
- フォーク
- 896
- 平均マージ
- 2日 19時間
- マージ済み PR(30日)
- 206
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/PyRIT のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/PyRIT#2888 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
Bug: triage GUI help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
microsoft/PyRIT#2868 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/PyRIT の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
bot-found bug priority: P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
madenvel/KalinkaPlayer#179 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ls1intum/edutelligence#1098 ·
メンテナーはふだん 1 日以内に返信