models: 完整权重按新目录名入库(LFS),清理 qwen3 命名与旧路径

- models/{small_model,large_model,large_model_lora} 整树入库,权重/分词器走 Git LFS(约 17 GB)
- .gitattributes 改用 models/** 通配;.gitignore 放行 models 下的 tokenizer_config.json
- config: llm[].file 指向 models/small_model,删除含 qwen3 的注释
- docs/plugins.md、tests/test_config.py 同步新路径;LoRA 卡去掉 base_model 私有路径字段
- 补入 intent_bench / shieldagent_review / result.json 等实验脚本与结果
This commit is contained in:
agcl committed 2026-11-27 13:41:00 +00:00
1 parent 594dc0f6b2
commit a372a7b285
55 files changed
+164063 -93

No files matched your search

+6 -6
View File
@@ -227,14 +227,14 @@ local result = host.http.request({
The optional `guard` dependency (`pip install -e ".[guard]"`) enables local Transformers guard models. Model definitions live at the top level and plugins explicitly allow model IDs:
模型的 `llm[].file` 指向包含权重、`config.json` 和分词器文件的目录。相对路径以进程当前工作目录为基准:从 `/service` 启动时,`models/guard_model` 解析为 `/service/models/guard_model`,与 `--config` 文件所在位置无关;绝对路径直接使用。Docker 镜像设置了 `WORKDIR /service`,模型文件需挂载到对应的容器目录。原来依赖配置文件目录的模型相对路径需要按工作目录调整,或改用绝对路径。插件的 `plugins[].file` 仍相对于配置文件目录解析。
模型的 `llm[].file` 指向包含权重、`config.json` 和分词器文件的目录。相对路径以进程当前工作目录为基准:从 `/service` 启动时,`models/small_model` 解析为 `/service/models/small_model`,与 `--config` 文件所在位置无关;绝对路径直接使用。Docker 镜像设置了 `WORKDIR /service`,模型文件需挂载到对应的容器目录。原来依赖配置文件目录的模型相对路径需要按工作目录调整,或改用绝对路径。插件的 `plugins[].file` 仍相对于配置文件目录解析。
```yaml
llm:
- id: Qwen3Guard-Gen-0.6B
- id: guard_model
type: guard
backend: transformers
file: /models/Qwen3Guard-Gen-0.6B
file: /models/small_model
enabled: true
load:
device: cpu
@@ -249,9 +249,9 @@ plugins:
- id: response-guard
file: plugins/response_guard.lua
llm:
allow: [Qwen3Guard-Gen-0.6B]
allow: [guard_model]
config:
model: Qwen3Guard-Gen-0.6B
model: guard_model
```
A Lua plugin receives only the authorized model metadata:
@@ -260,7 +260,7 @@ A Lua plugin receives only the authorized model metadata:
for _, model in ipairs(host.llm.list()) do
-- model.id, model.type, model.capabilities
end
local result = host.llm("Qwen3Guard-Gen-0.6B", {
local result = host.llm("guard_model", {
task = "response_moderation",
prompt = prompt,
response = text,