dsh-livebench-panel 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +59 -4
- package/lib/index.js +15 -8
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -36,7 +36,16 @@ window.__ModuleLoader__.load({
|
|
|
36
36
|
.dlb_notice{border-color:color-mix(in srgb,var(--dsw-alias-state-error-primary) 45%,transparent)}
|
|
37
37
|
.dlb_noticeTitle{margin:0;font-size:13px;font-weight:600;color:var(--dsw-alias-state-error-primary)}
|
|
38
38
|
.dlb_steps{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;font-size:12px;line-height:1.6;color:var(--dsw-alias-label-secondary)}
|
|
39
|
-
.dlb_code{display:block;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;color:var(--dsw-alias-label-primary);padding:4px 8px;margin-top:3px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;word-break:break-all;user-select:all}
|
|
39
|
+
.dlb_code{display:block;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:6px;color:var(--dsw-alias-label-primary);padding:4px 8px;margin-top:3px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;word-break:break-all;user-select:all}
|
|
40
|
+
.dlb_details{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);padding:10px 14px}
|
|
41
|
+
.dlb_details summary{cursor:pointer;font-size:12.5px;color:var(--dsw-alias-label-secondary);user-select:none}
|
|
42
|
+
.dlb_details summary:hover{color:var(--dsw-alias-label-primary)}
|
|
43
|
+
.dlb_details[open] summary{margin-bottom:10px;color:var(--dsw-alias-label-primary)}
|
|
44
|
+
.dlb_helpTable{width:100%;border-collapse:collapse;font-size:12px}
|
|
45
|
+
.dlb_helpTable th,.dlb_helpTable td{text-align:left;vertical-align:top;padding:5px 8px;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
46
|
+
.dlb_helpTable th{color:var(--dsw-alias-label-tertiary);font-weight:500;white-space:nowrap}
|
|
47
|
+
.dlb_helpTable td{color:var(--dsw-alias-label-secondary);line-height:1.55}
|
|
48
|
+
.dlb_helpP{margin:0 0 8px;font-size:12px;color:var(--dsw-alias-label-secondary);line-height:1.6}`;
|
|
40
49
|
const tagId = "dsh-livebench-panel/panel.css";
|
|
41
50
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
42
51
|
const tag = document.createElement("style");
|
|
@@ -151,8 +160,21 @@ window.__ModuleLoader__.load({
|
|
|
151
160
|
const categories = useMemo(() => (config ? Object.keys(config.tasks) : []), [config]);
|
|
152
161
|
const taskList = useMemo(() => {
|
|
153
162
|
if (!config || sel.category.length === 0) return [];
|
|
154
|
-
return config.tasks[sel.category] ??
|
|
163
|
+
return Object.keys(config.tasks[sel.category] ?? {});
|
|
155
164
|
}, [config, sel.category]);
|
|
165
|
+
// 有效题数:LiveBench 会丢弃「发布晚于所选 release」和「在所选 release
|
|
166
|
+
// 前已退役」的题目,这里按题目桶 (发布日, 移除日) 精确复算。
|
|
167
|
+
const countFor = useCallback((category, task) => {
|
|
168
|
+
if (!config || category.length === 0) return null;
|
|
169
|
+
const meta = (config.tasks[category] ?? {})[task];
|
|
170
|
+
if (!meta || !Array.isArray(meta.buckets)) return null;
|
|
171
|
+
const option = sel.release;
|
|
172
|
+
return meta.buckets.reduce((sum, b) => {
|
|
173
|
+
const releasedOk = b.r !== "" && b.r <= option;
|
|
174
|
+
const notRemoved = b.rm === "" || b.rm > option;
|
|
175
|
+
return sum + (releasedOk && notRemoved ? b.n : 0);
|
|
176
|
+
}, 0);
|
|
177
|
+
}, [config, sel.release]);
|
|
156
178
|
const selectedProvider = useMemo(
|
|
157
179
|
() => (config ? config.providers.find((p) => p.id === sel.provider) ?? null : null),
|
|
158
180
|
[config, sel.provider],
|
|
@@ -168,6 +190,10 @@ window.__ModuleLoader__.load({
|
|
|
168
190
|
|
|
169
191
|
const onStart = async () => {
|
|
170
192
|
setStartError(null);
|
|
193
|
+
if (sel.category !== "" && sel.task !== "" && countFor(sel.category, sel.task) === 0) {
|
|
194
|
+
setStartError(`任务 ${sel.task} 在 release ${sel.release} 下没有可用题目(该批题目已退役)。请换一个 release 或任务。`);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
171
197
|
setBusy(true);
|
|
172
198
|
try {
|
|
173
199
|
const payload = await api("/start", {
|
|
@@ -263,7 +289,11 @@ window.__ModuleLoader__.load({
|
|
|
263
289
|
h("label", { className: c("label") }, "任务"),
|
|
264
290
|
h("select", { className: c("select"), value: sel.task, onChange: setField("task") },
|
|
265
291
|
h("option", { value: "" }, sel.category === "" ? "(先选分类)" : "全部任务"),
|
|
266
|
-
taskList.map((task) =>
|
|
292
|
+
taskList.map((task) => {
|
|
293
|
+
const n = countFor(sel.category, task);
|
|
294
|
+
const label = n === null ? task : `${task}(${n} 题)`;
|
|
295
|
+
return h("option", { key: task, value: task, disabled: n === 0 }, n === 0 ? `${task}(此release无题)` : label);
|
|
296
|
+
})),
|
|
267
297
|
),
|
|
268
298
|
h("div", { className: c("field") },
|
|
269
299
|
h("label", { className: c("label") }, "题目序号范围(可选)"),
|
|
@@ -326,7 +356,32 @@ window.__ModuleLoader__.load({
|
|
|
326
356
|
h("br", null),
|
|
327
357
|
"若装在其它目录:设置系统环境变量 ", h("code", { className: c("code") }, "DSH_LIVEBENCH_HOME=你的LiveBench目录"), " 后再重启 dsh web。"),
|
|
328
358
|
),
|
|
329
|
-
h("p", { className: c("hint") },
|
|
359
|
+
h("p", { className: c("hint") },
|
|
360
|
+
"除 LiveBench 外无需其它配置:评测所需的 API Key 会自动从 harness 凭据库读取并注入;npm 安装本插件时可一并执行 dsh plugin --profile web add dsh-livebench-panel。完整说明见插件目录内 README:~\\.dsh\\plugins\\dsh-livebench-panel\\README.md"),
|
|
361
|
+
),
|
|
362
|
+
h("details", { className: c("details") },
|
|
363
|
+
h("summary", null, "❓ 使用说明 · 选项含义与选择建议(点击展开)"),
|
|
364
|
+
h("p", { className: c("helpP") },
|
|
365
|
+
"操作流程:选择参数 → 点「开始评测」→ 日志区实时显示运行进度 → 结束后成绩表自动刷新(运行中可「停止」)。全部判分均为客观比对(文本/符号执行/测试用例),不使用 AI 评分。"),
|
|
366
|
+
h("table", { className: c("helpTable") },
|
|
367
|
+
h("thead", null, h("tr", null, h("th", null, "选项"), h("th", null, "含义与选择建议"))),
|
|
368
|
+
h("tbody", null,
|
|
369
|
+
h("tr", null, h("th", null, "模型"), h("td", null,
|
|
370
|
+
"harness 全部 provider 的全部模型(含内置 DeepSeek 官方)。API Key 自动从 harness 凭据库读取并注入,无需手工配置;名字带「·未接LiveBench」的 provider 无法自动路由,评测会按模型名原生尝试。")),
|
|
371
|
+
h("tr", null, h("th", null, "推理强度"), h("td", null,
|
|
372
|
+
"模型的思考深度(off=关闭思考)。强度会编码进条目名(如 glm-5.3@max),不同强度在成绩表中是独立条目,方便对比。想省成本选 low,追求质量选 high/max。")),
|
|
373
|
+
h("tr", null, h("th", null, "题集 release"), h("td", null,
|
|
374
|
+
"题目发布批次。推荐 2024-11-25(公开题目最全)。LiveBench 每月换题:新批次下老任务会陆续退役,任务下拉括号内就是该批次下的有效题数。")),
|
|
375
|
+
h("tr", null, h("th", null, "分类 / 任务"), h("td", null,
|
|
376
|
+
"六大类共 18 个任务:coding(代码生成/补全)、math(竞赛数学等)、reasoning(空间推理/逻辑谜题)、language(拼写/连线/语义)、data_analysis(表格操作)、instruction_following(指令遵循)。首次验证推荐 language → typos。")),
|
|
377
|
+
h("tr", null, h("th", null, "题目序号范围"), h("td", null,
|
|
378
|
+
"从 0 起。冒烟测试填 0 到 2(只跑 3 题);2 题得分噪声很大(对一题就是 0↔100 的波动),想看真实水平建议 20 题以上。")),
|
|
379
|
+
h("tr", null, h("th", null, "max-tokens"), h("td", null,
|
|
380
|
+
"单题回答的 token 上限,默认 32000。推理模型思考也占 token,不要低于 8192,否则思考被截断、答案为空会记 0 分。")),
|
|
381
|
+
),
|
|
382
|
+
),
|
|
383
|
+
h("p", { className: c("helpP"), style: { marginTop: "10px" } },
|
|
384
|
+
"提示:回答为 $ERROR$ 表示该题 API 调用失败(网络/鉴权/参数问题)计 0 分,可在上方日志区查看具体错误;zebra_puzzle(逻辑谜题)是公认最难的任务,低分属正常现象。"),
|
|
330
385
|
),
|
|
331
386
|
h("p", { className: c("hint") },
|
|
332
387
|
"评分读取 LiveBench 的 ground_truth_judgment.jsonl;正式榜单可用 release 2024-11-25。多选题集请在「分类/任务」中缩小范围,避免长时间运行。"),
|
package/lib/index.js
CHANGED
|
@@ -227,18 +227,25 @@ function livebenchLayout() {
|
|
|
227
227
|
function scanCategoryTasks(dataDir) {
|
|
228
228
|
const tasks = {};
|
|
229
229
|
if (!existsSync(dataDir)) return tasks;
|
|
230
|
-
|
|
231
|
-
try {
|
|
232
|
-
categoryDirs = readDirSafe(dataDir);
|
|
233
|
-
} catch {
|
|
234
|
-
return tasks;
|
|
235
|
-
}
|
|
230
|
+
const categoryDirs = readDirSafe(dataDir);
|
|
236
231
|
for (const category of categoryDirs) {
|
|
237
232
|
const catDir = join(dataDir, category);
|
|
238
233
|
for (const task of readDirSafe(catDir)) {
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
const questionFile = join(catDir, task, "question.jsonl");
|
|
235
|
+
if (!existsSync(questionFile)) continue;
|
|
236
|
+
// Bucket questions by (release date, removal date) so the UI can
|
|
237
|
+
// compute how many questions survive a chosen release option:
|
|
238
|
+
// LiveBench drops questions released after the option and questions
|
|
239
|
+
// removed at or before the option.
|
|
240
|
+
const buckets = [];
|
|
241
|
+
for (const q of readJsonl(questionFile)) {
|
|
242
|
+
const r = typeof q.livebench_release_date === "string" ? q.livebench_release_date : "";
|
|
243
|
+
const rm = typeof q.livebench_removal_date === "string" ? q.livebench_removal_date : "";
|
|
244
|
+
const bucket = buckets.find((b) => b.r === r && b.rm === rm);
|
|
245
|
+
if (bucket) bucket.n += 1;
|
|
246
|
+
else buckets.push({ r, rm, n: 1 });
|
|
241
247
|
}
|
|
248
|
+
((tasks[category] ??= {})[task] = { buckets, total: buckets.reduce((sum, b) => sum + b.n, 0) });
|
|
242
249
|
}
|
|
243
250
|
}
|
|
244
251
|
return tasks;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-livebench-panel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "DSH web plugin: a LiveBench tab in the Trajectory view (right of 对话/轨迹). Run LiveBench evaluations against every model configured in the DeepSeek Harness — pick provider/model, category, task, release and question range from dropdowns, watch progress, and read scores in place.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|