BUG: HuggingFaceChatTarget runs model.generate() on the event loop
維護者通常 2 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
研究方向
找出 HuggingFaceChatTarget._send_prompt_to_target_async,並檢查它呼叫 self.model.generate(...) 的位置;issue #2211 可能提供將模型工作移出事件迴圈的背景資訊。透過修補 generate 使其等待一個 threading.Event,同時讓另一個工作嘗試在 asyncio.sleep(0.05) 後釋放該事件,來重現停滯。生成期間其他 asyncio 工作能夠執行時,即為完成。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
HuggingFaceChatTarget._send_prompt_to_target_async calls self.model.generate(...) directly inside the async method. Local generation can take seconds to minutes, and it blocks the event loop the whole time, so every other attack, scorer and target call in the same run stalls. #2211 moved model loading off the event loop, but generation still runs on it.
Steps/Code to Reproduce
In a unit test, patch the loaded model's generate to wait on a threading.Event, then send a prompt while another task tries to set that event after asyncio.sleep(0.05). The other task never runs until generate returns.
Expected Results
Other tasks keep running while the model generates.
Actual Results
The event loop is blocked for the full generation time.
Versions
PyRIT main.
- 主要語言
- Python
- 星號
- 4.7k
- 分支
- 1k
- 平均合併
- 2 天 7 小時
- 30 天內合併 PR
- 512
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/PyRIT 的其他 Issue
-
BUG: StaticPromptInjectionScorer misses modern frontier chat template delimiters (DeepSeek, Cohere Command R, Mistral)可能已有人在做 @Kaap10 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 2 天內回覆
-
Parameter required status is lost after wire round-trip可能已有人在做 @its-amann 於 5 天前認領。 未關閉Bug: triage help wanted
難度 2/5 1-3 小時 新手友好度 72/100
microsoft/PyRIT#3854 · 2 則留言 · 已指派 1 人 ·
維護者通常 2 天內回覆
-
BUG: LLMGenericTextConverter identifier changes between processes for set-valued template parameters可能已有人在做 @samrudhi03 於 5 天前認領。 未關閉Bug: triage
難度 2/5 1-3 小時 新手友好度 75/100
microsoft/PyRIT#3841 · 1 則留言 · 已指派 1 人 ·
維護者通常 2 天內回覆
-
BUG: SelfAskGeneral scorers leave their output keys out of the identifier可能已有人在做 @Hrushikesh-ramilla 於 6 天前認領。 未關閉Bug: triage
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 2 天內回覆
-
HTML scenario export replaces an intentionally empty converted message with the original text可能已有人在做 @VISHNU0906 於 8 天前認領。 未關閉help wanted
難度 2/5 1-3 小時 新手友好度 77/100
microsoft/PyRIT#3741 · 1 則留言 · 已指派 1 人 ·
維護者通常 2 天內回覆
相似的 Issue
-
area:models enhancement
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
SACGF/variantgrid#2737 · 1 則留言 ·
維護者通常 1 天內回覆
-
RedisStorage writes can persist a key without its sliding TTL可能已有人在做 @lianbie 今天認領。 未關閉triage/confirmed
難度 2/5 1-3 小時 新手友好度 78/100
agentscope-ai/agentscope#3878 · 1 則留言 ·
維護者通常 2 天內回覆
-
core
難度 2/5 1-3 小時 新手友好度 86/100
vectorize-io/hindsight#6458 ·
維護者通常 1 天內回覆