guard: 修正本地守卫模型的输入形态(Qwen3Guard 直接收原文)
上一版把自定义指令塞进 prompt、并在 response_moderation 里丢了用户提问,与 Qwen3Guard-Gen 的实际用法不符: - 输入:prompt 就是待审原文,不再加指令和 <BEGIN CONTENT> 包裹 - 输出:prompt=用户原问题(截断 2000 字节)、response=模型输出,恢复问答上下文 - 自定义指令改为可选的 prompt_prefix,默认不发送 宿主的 parse_guard_output 与九个类别名逐字对应 Qwen3Guard-Gen,已在注释和自检脚本里写明必须用该族模型。 验证:verify_plugins.py 104 项全通过;用假模型目录跑 load_settings + LLMRegistry, 确认 5 插件/1 启用、guard_model adapter 与两项能力正常建立;luac -p 通过。
This commit is contained in:
1 parent
d239cf584c
commit
6d9ab4fbf8
5 files changed
+69
-53
No files matched your search
+3
-2
@@ -15,8 +15,9 @@ limits:
|
||||
attachment_timeout_seconds: 30
|
||||
max_attachment_reads: 64
|
||||
|
||||
# 本地守卫模型。file 必须是 HuggingFace 目录:config.json + 权重 + tokenizer。
|
||||
# 目录不存在时宿主启动即失败(不会降级成放行)。部署前跑 tools/check_local_model.py。
|
||||
# 本地守卫模型。必须是 Qwen3Guard-Gen(0.6B/4B/8B):宿主的 parse_guard_output 按它的
|
||||
# "Safety: / Categories: / Refusal:" 格式与九个类别名解析,换别的模型会全部 503。
|
||||
# file 指向 HuggingFace 目录(config.json + 权重 + tokenizer),缺失时宿主启动即失败。
|
||||
llm:
|
||||
- id: guard_model
|
||||
type: guard
|
||||
|
||||
Reference in new issue
Block a user