dsh-livebench-panel 0.1.13 → 0.1.15
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 +51 -51
- package/package.json +43 -43
package/lib/client.js
CHANGED
|
@@ -13,7 +13,8 @@ window.__ModuleLoader__.load({
|
|
|
13
13
|
.dlb_head h2{margin:0;font-size:16px;font-weight:600}
|
|
14
14
|
.dlb_sub{color:var(--dsw-alias-label-tertiary);font-size:12px}
|
|
15
15
|
.dlb_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:10px;padding:14px;display:flex;flex-direction:column;gap:12px}
|
|
16
|
-
.dlb_grid{display:grid;grid-template-columns:repeat(
|
|
16
|
+
.dlb_grid{display:grid;grid-template-columns:repeat(12,1fr);gap:10px}
|
|
17
|
+
@media (max-width:860px){.dlb_grid>.dlb_field{grid-column:1/-1 !important}}
|
|
17
18
|
.dlb_field{display:flex;flex-direction:column;gap:4px;min-width:0}
|
|
18
19
|
.dlb_label{color:var(--dsw-alias-label-tertiary);font-size:11px;text-transform:uppercase;letter-spacing:.02em}
|
|
19
20
|
.dlb_select,.dlb_input{height:34px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;border-radius:8px;padding:0 8px;outline:none;min-width:0}
|
|
@@ -92,7 +93,7 @@ window.__ModuleLoader__.load({
|
|
|
92
93
|
function LiveBenchView() {
|
|
93
94
|
const [config, setConfig] = useState(null);
|
|
94
95
|
const [configError, setConfigError] = useState(null);
|
|
95
|
-
const [sel, setSel] = useState({ models: [],
|
|
96
|
+
const [sel, setSel] = useState({ models: [], efforts: {}, cats: [], tasks: [], release: "2024-11-25", begin: "", end: "", maxTokens: "32000" });
|
|
96
97
|
const [modelDdOpen, setModelDdOpen] = useState(false);
|
|
97
98
|
const modelDdRef = useRef(null);
|
|
98
99
|
const [busy, setBusy] = useState(false);
|
|
@@ -199,24 +200,14 @@ window.__ModuleLoader__.load({
|
|
|
199
200
|
const next = list.includes(value) ? list.filter((v) => v !== value) : [...list, value];
|
|
200
201
|
return { ...prev, [key]: next };
|
|
201
202
|
});
|
|
202
|
-
// 已选模型(provider::model 值列表)的解析与 effort
|
|
203
|
+
// 已选模型(provider::model 值列表)的解析与 per-model effort
|
|
203
204
|
const selectedModelEntries = useMemo(() => sel.models.map((value) => {
|
|
204
205
|
const [pid, ...rest] = value.split("::");
|
|
205
206
|
const mid = rest.join("::");
|
|
206
207
|
const provider = config?.providers.find((p) => p.id === pid) ?? null;
|
|
207
208
|
const model = provider?.models.find((m) => m.id === mid) ?? null;
|
|
208
|
-
return { providerId: pid, modelId: mid, efforts: model?.efforts ?? [] };
|
|
209
|
+
return { providerId: pid, modelId: mid, modelValue: value, efforts: model?.efforts ?? [] };
|
|
209
210
|
}).filter((entry) => entry.modelId !== ""), [sel.models, config]);
|
|
210
|
-
const effortOptions = useMemo(() => {
|
|
211
|
-
const seen = new Set();
|
|
212
|
-
const union = [];
|
|
213
|
-
for (const entry of selectedModelEntries) {
|
|
214
|
-
for (const e of entry.efforts) {
|
|
215
|
-
if (!seen.has(e)) { seen.add(e); union.push({ value: e, label: e === "off" ? "off(关闭思考)" : e }); }
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return union;
|
|
219
|
-
}, [selectedModelEntries]);
|
|
220
211
|
|
|
221
212
|
const onStart = async () => {
|
|
222
213
|
setStartError(null);
|
|
@@ -239,7 +230,8 @@ window.__ModuleLoader__.load({
|
|
|
239
230
|
}
|
|
240
231
|
setBusy(true);
|
|
241
232
|
try {
|
|
242
|
-
// 每个 selected
|
|
233
|
+
// 每个 selected 模型并发启动一个评测(服务端有并发上限保护),
|
|
234
|
+
// 推理强度按各模型在次级下拉中的选择逐个下发
|
|
243
235
|
const failures = [];
|
|
244
236
|
const launches = selectedModelEntries.map(async (entry) => {
|
|
245
237
|
const payload = await api("/start", {
|
|
@@ -248,7 +240,7 @@ window.__ModuleLoader__.load({
|
|
|
248
240
|
body: JSON.stringify({
|
|
249
241
|
provider: entry.providerId,
|
|
250
242
|
model: entry.modelId,
|
|
251
|
-
reasoningEffort: sel.
|
|
243
|
+
reasoningEffort: sel.efforts[entry.modelValue] ?? "default",
|
|
252
244
|
benchNames,
|
|
253
245
|
release: sel.release,
|
|
254
246
|
begin: sel.begin,
|
|
@@ -396,8 +388,8 @@ window.__ModuleLoader__.load({
|
|
|
396
388
|
configError !== null && h("p", { className: c("error") }, `加载配置失败:${configError}`),
|
|
397
389
|
h("div", { className: c("card") },
|
|
398
390
|
h("div", { className: c("grid") },
|
|
399
|
-
h("div", { className: c("field"), ref: modelDdRef, style: {
|
|
400
|
-
h("label", { className: c("label") }, "模型(harness
|
|
391
|
+
h("div", { className: c("field"), ref: modelDdRef, style: { gridColumn: "span 6" } },
|
|
392
|
+
h("label", { className: c("label") }, "模型(harness 全部模型,可多选;勾选后可在行内单独设定推理强度)"),
|
|
401
393
|
h("button", {
|
|
402
394
|
type: "button", className: c("select"), style: { textAlign: "left", width: "100%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
403
395
|
onClick: () => setModelDdOpen((v) => !v),
|
|
@@ -408,10 +400,8 @@ window.__ModuleLoader__.load({
|
|
|
408
400
|
: `已选 ${sel.models.length} 个模型`),
|
|
409
401
|
modelDdOpen && h("div", {
|
|
410
402
|
style: {
|
|
411
|
-
|
|
412
|
-
maxHeight: "320px", overflowY: "auto", border: "1px solid var(--dsw-alias-border-l2)",
|
|
403
|
+
marginTop: "6px", maxHeight: "340px", overflowY: "auto", border: "1px solid var(--dsw-alias-border-l2)",
|
|
413
404
|
borderRadius: "8px", background: "var(--dsw-alias-bg-layer-1)", padding: "6px",
|
|
414
|
-
boxShadow: "var(--dsw-shadow-lv1, 0 4px 16px rgba(0,0,0,.25))",
|
|
415
405
|
},
|
|
416
406
|
},
|
|
417
407
|
(config?.providers ?? []).map((p) => h("div", { key: p.id, style: { marginBottom: "4px" } },
|
|
@@ -420,31 +410,52 @@ window.__ModuleLoader__.load({
|
|
|
420
410
|
p.models.map((m) => {
|
|
421
411
|
const value = p.id + "::" + m.id;
|
|
422
412
|
const checked = sel.models.includes(value);
|
|
423
|
-
return h("
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
413
|
+
return h("div", { key: value, style: { borderBottom: "1px solid var(--dsw-alias-border-l2)", padding: "3px 4px" } },
|
|
414
|
+
h("div", {
|
|
415
|
+
style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer" },
|
|
416
|
+
onClick: () => {
|
|
417
|
+
setSel((prev) => {
|
|
418
|
+
const set = new Set(prev.models);
|
|
419
|
+
const nextEfforts = { ...prev.efforts };
|
|
420
|
+
if (set.has(value)) { set.delete(value); delete nextEfforts[value]; }
|
|
421
|
+
else set.add(value);
|
|
422
|
+
return { ...prev, models: [...set], efforts: nextEfforts };
|
|
423
|
+
});
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
h("input", { type: "checkbox", checked, readOnly: true, style: { cursor: "pointer" } }),
|
|
427
|
+
h("span", { style: { fontSize: "12.5px", flex: 1 } }, m.name)),
|
|
428
|
+
checked && m.efforts.length > 0 && h("div", { style: { display: "flex", alignItems: "center", gap: "6px", padding: "4px 0 2px 26px" } },
|
|
429
|
+
h("span", { style: { fontSize: "11px", color: "var(--dsw-alias-label-tertiary)", whiteSpace: "nowrap" } }, "推理强度"),
|
|
430
|
+
h("select", {
|
|
431
|
+
className: c("select"), style: { height: "28px", fontSize: "12px", flex: 1 },
|
|
432
|
+
value: sel.efforts[value] ?? "default",
|
|
433
|
+
onClick: (event) => event.stopPropagation(),
|
|
434
|
+
onChange: (event) => {
|
|
435
|
+
const v = event.target.value;
|
|
436
|
+
setSel((prev) => ({ ...prev, efforts: { ...prev.efforts, [value]: v } }));
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
h("option", { value: "default" }, "(模型默认)"),
|
|
440
|
+
m.efforts.map((e) => h("option", { key: e, value: e }, e === "off" ? "off(关闭思考)" : e)))));
|
|
435
441
|
}))),
|
|
436
442
|
),
|
|
437
|
-
h("div", { className: c("field") },
|
|
438
|
-
h("label", { className: c("label") }, "推理强度"),
|
|
439
|
-
h("select", { className: c("select"), value: sel.reasoning, onChange: setField("reasoning"), disabled: effortOptions.length === 0 },
|
|
440
|
-
h("option", { value: "default" }, effortOptions.length === 0 ? "(按模型默认)" : "(模型默认)"),
|
|
441
|
-
effortOptions.map((e) => h("option", { key: e.value, value: e.value }, e.label))),
|
|
442
|
-
),
|
|
443
|
-
h("div", { className: c("field") },
|
|
443
|
+
h("div", { className: c("field"), style: { gridColumn: "span 2" } },
|
|
444
444
|
h("label", { className: c("label") }, "题集 release"),
|
|
445
445
|
h("select", { className: c("select"), value: sel.release, onChange: setField("release") },
|
|
446
446
|
(config?.releases ?? ["2024-11-25"]).map((r) => h("option", { key: r, value: r }, r))),
|
|
447
447
|
),
|
|
448
|
+
h("div", { className: c("field"), style: { gridColumn: "span 2" } },
|
|
449
|
+
h("label", { className: c("label") }, "题目序号范围(可选)"),
|
|
450
|
+
h("div", { className: c("row") },
|
|
451
|
+
h("input", { className: c("input"), type: "number", min: 0, placeholder: "起", value: sel.begin, onChange: setField("begin"), style: { width: "50%" } }),
|
|
452
|
+
h("input", { className: c("input"), type: "number", min: 0, placeholder: "止", value: sel.end, onChange: setField("end"), style: { width: "50%" } }),
|
|
453
|
+
),
|
|
454
|
+
),
|
|
455
|
+
h("div", { className: c("field"), style: { gridColumn: "span 2" } },
|
|
456
|
+
h("label", { className: c("label") }, "max-tokens(默认 32000)"),
|
|
457
|
+
h("input", { className: c("input"), type: "number", min: 256, max: 32768, value: sel.maxTokens, onChange: setField("maxTokens") }),
|
|
458
|
+
),
|
|
448
459
|
h("div", { className: c("field"), style: { gridColumn: "1 / -1" } },
|
|
449
460
|
h("label", { className: c("label") }, "分类(可多选,不选 = 全部分类;括号内为该 release 下有效题数)"),
|
|
450
461
|
h("div", { className: c("chips") },
|
|
@@ -471,17 +482,6 @@ window.__ModuleLoader__.load({
|
|
|
471
482
|
}, `${task}(${n})`);
|
|
472
483
|
})),
|
|
473
484
|
),
|
|
474
|
-
h("div", { className: c("field") },
|
|
475
|
-
h("label", { className: c("label") }, "题目序号范围(可选)"),
|
|
476
|
-
h("div", { className: c("row") },
|
|
477
|
-
h("input", { className: c("input"), type: "number", min: 0, placeholder: "起", value: sel.begin, onChange: setField("begin"), style: { width: "50%" } }),
|
|
478
|
-
h("input", { className: c("input"), type: "number", min: 0, placeholder: "止", value: sel.end, onChange: setField("end"), style: { width: "50%" } }),
|
|
479
|
-
),
|
|
480
|
-
),
|
|
481
|
-
h("div", { className: c("field") },
|
|
482
|
-
h("label", { className: c("label") }, "max-tokens(默认 32000)"),
|
|
483
|
-
h("input", { className: c("input"), type: "number", min: 256, max: 32768, value: sel.maxTokens, onChange: setField("maxTokens") }),
|
|
484
|
-
),
|
|
485
485
|
),
|
|
486
486
|
h("div", { className: c("row") },
|
|
487
487
|
h("button", { className: c("btn"), onClick: onStart, disabled: busy || running || !config?.available || sel.models.length === 0 },
|
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-livebench-panel",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "lib/index.js",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": "./lib/index.js",
|
|
10
|
-
"./client": "./lib/client.js",
|
|
11
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
12
|
-
"./package.json": "./package.json"
|
|
13
|
-
},
|
|
14
|
-
"engines": {
|
|
15
|
-
"node": ">=20"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"lib",
|
|
19
|
-
"cordis.patch.yml",
|
|
20
|
-
"README.md"
|
|
21
|
-
],
|
|
22
|
-
"keywords": [
|
|
23
|
-
"dsh-plugin",
|
|
24
|
-
"deepseek-harness",
|
|
25
|
-
"livebench",
|
|
26
|
-
"benchmark",
|
|
27
|
-
"evaluation"
|
|
28
|
-
],
|
|
29
|
-
"dsh": {
|
|
30
|
-
"bundle": {
|
|
31
|
-
"patch": "./cordis.patch.yml"
|
|
32
|
-
},
|
|
33
|
-
"client": {
|
|
34
|
-
"platform": "web",
|
|
35
|
-
"inject": [
|
|
36
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
37
|
-
"@deepseek-ai/dsh-client-locale",
|
|
38
|
-
"@deepseek-ai/dsh-client-ui-slots",
|
|
39
|
-
"@deepseek-ai/dsh-client-ui-conversation"
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-livebench-panel",
|
|
3
|
+
"version": "0.1.15",
|
|
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
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./lib/index.js",
|
|
10
|
+
"./client": "./lib/client.js",
|
|
11
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"lib",
|
|
19
|
+
"cordis.patch.yml",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"dsh-plugin",
|
|
24
|
+
"deepseek-harness",
|
|
25
|
+
"livebench",
|
|
26
|
+
"benchmark",
|
|
27
|
+
"evaluation"
|
|
28
|
+
],
|
|
29
|
+
"dsh": {
|
|
30
|
+
"bundle": {
|
|
31
|
+
"patch": "./cordis.patch.yml"
|
|
32
|
+
},
|
|
33
|
+
"client": {
|
|
34
|
+
"platform": "web",
|
|
35
|
+
"inject": [
|
|
36
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
37
|
+
"@deepseek-ai/dsh-client-locale",
|
|
38
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
39
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|