cortico-world-fish-sing 0.4.13 → 0.4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循语义化。
4
4
 
5
+ ## [0.4.15] - 2026-11-03
6
+
7
+ ### 修复
8
+ - **「停止训练」触发假警报"训练中断:查不到任务"**:0.4.8 复盘找到了根因——停止生效的那一瞬间机器有一次网络/响应抖动(连 snowluma 都短暂 fetch failed),而任务的轮询循环把**任何响应残缺都当成"任务不存在"**直接抛错,于是弹了条假"训练中断"还发了通知。现在:
9
+ - 只有 worker **明确**回答"没有这个任务"(HTTP 404,比如 worker 重启过)才算真没了;
10
+ - 网络抖动/响应残缺容忍 30 秒(每 0.7 秒重试),持续不了才报"worker 连不上/响应异常已持续 30 秒";
11
+ - **手动停止(已取消/已手动停止)不再发"训练中断"通知**,只记一条 info 日志。
12
+ - 顺带确认:这次的「停止训练」完全正常——日志显示"取消请求已送达",训练日志停在 18:07(第 38 轮 24% 处),0.4.8 的修复有效。
13
+
14
+ ## [0.4.14] - 2026-11-03
15
+
16
+ ### 改进(训练页第二轮,全部来自用户实测反馈)
17
+ - 整个插件页面**居中**(最宽 980px),不再拉满全屏。
18
+ - 折叠块**默认全收起**,谁在跑自动展开谁(训练在跑展开②、切片在跑展开①),空闲就全收起。
19
+ - **顶部进度条/状态行跟随当前任务**:切页回来不再显示上一次操作的残留文案(之前训练一跑,切个页回来顶栏就变成"数据集导入成功")。
20
+ - 「数据集」「已有模型」「切片方式」三个下拉改成**看得出来的下拉框**。
21
+ - 「导入已有模型」移到「开始切片」按钮下方(显眼)。
22
+ - **打开目录只留一个**(数据集旁边的),素材行那个去掉了。
23
+ - 「追加到当前数据集」「选模对比」「低音增强」**都不再默认勾选**。
24
+ - 数据集下拉**默认留空**("(选择数据集)"),选中才显示信息和按钮。
25
+ - 有没训完的记录、且当前没在训练 → 自动勾上「从上次存档继续」(每个实验只代勾一次)。
26
+ - 低音增强的说明改准确:「有限改善…不能根治」。
27
+ - 「测试通知」从训练页挪到**「大肥鱼模型-环境自行管理」页**(配置页的「完成通知」是 Coo 渲染的表单,塞不进按钮;环境页放了个一键测试 + 指路文案)。
28
+
5
29
  ## [0.4.13] - 2026-11-03
6
30
 
7
31
  ### 改进
@@ -10,13 +10,14 @@
10
10
  */
11
11
 
12
12
  const CSS = `
13
- .fs-wrap{display:flex;flex-direction:column;gap:10px;font:13px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
13
+ .fs-wrap{display:flex;flex-direction:column;gap:10px;width:100%;max-width:980px;margin:0 auto;font:13px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
14
14
  .fs-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
15
15
  .fs-bar .fs-grow{flex:1}
16
16
  .fs-btn{appearance:none;border:1px solid rgba(127,127,127,.35);background:transparent;color:inherit;
17
17
  border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer}
18
18
  .fs-btn:hover{background:rgba(127,127,127,.12)}
19
19
  .fs-btn:disabled{opacity:.4;cursor:default}
20
+ select.fs-btn{appearance:auto;-webkit-appearance:menulist;padding:4px 8px;max-width:560px}
20
21
  .fs-btn.danger{border-color:rgba(220,80,80,.5);color:#d05555}
21
22
  .fs-input{flex:0 0 200px;padding:4px 8px;border-radius:6px;border:1px solid rgba(127,127,127,.35);
22
23
  background:transparent;color:inherit;font-size:12px}
@@ -364,7 +365,23 @@ function mountSetup(ctx) {
364
365
  + '运行时是 Python 环境:GPU 版下载约 2.5 GB、装完约 6 GB(55 秒的歌约 8 秒换完);'
365
366
  + 'CPU 版只要约 200 MB,但慢 6~8 倍。已经装好 torch 的不会被覆盖。';
366
367
 
367
- root.append(cards, bar, prog, msg, list, hint);
368
+ // ---- 通知渠道测试(配置页的「完成通知」里填目标,这里一键验证)
369
+ const nbar = el('div', 'fs-bar');
370
+ const nbtn = el('button', 'fs-btn', '测试通知');
371
+ nbtn.title = '立刻发一条测试通知:QQ 通就发 QQ,不通就退桌宠';
372
+ nbtn.addEventListener('click', async () => {
373
+ nbtn.disabled = true;
374
+ try {
375
+ const r = await ctx.invoke('trainNotifyTest', []);
376
+ say(`通知:${(r && r.note) || '已发'}${r && r.via ? `(${r.via})` : ''}`);
377
+ } catch (e) {
378
+ say((e && e.message) || String(e), true);
379
+ }
380
+ nbtn.disabled = false;
381
+ });
382
+ nbar.append(nbtn, el('span', 'fs-meta',
383
+ 'QQ 目标在 Coo 设置 → 插件配置 → 完成通知 里填(group:群号 / private:QQ号,直接填号码也行)'));
384
+ root.append(cards, bar, prog, msg, list, nbar, hint);
368
385
 
369
386
  let timer = null;
370
387
  let lastJob = '';
@@ -733,9 +750,7 @@ function mountTrain(ctx) {
733
750
  const pathIn = el('input', 'fs-tpath');
734
751
  pathIn.placeholder = '粘贴素材文件夹或单个文件路径,可多个用 ; 分隔';
735
752
  const scanBtn = el('button', 'fs-btn', '扫描');
736
- const notifyTest = el('button', 'fs-btn', '测试通知');
737
- notifyTest.title = '立刻发一条测试通知:QQ 通就发 QQ,不通就退桌宠——点了就知道渠道状态';
738
- bar.append(pathIn, scanBtn, notifyTest);
753
+ bar.append(pathIn, scanBtn);
739
754
 
740
755
  const dsBar = el('div', 'fs-bar');
741
756
  const dsSel = el('select', 'fs-btn');
@@ -769,15 +784,14 @@ function mountTrain(ctx) {
769
784
  startBtn.disabled = true;
770
785
  const stopBtn = el('button', 'fs-btn danger', '停止');
771
786
  stopBtn.disabled = true;
772
- const revealBtn = el('button', 'fs-btn', '打开目录');
773
787
  const appendChk = el('input', 'fs-ck');
774
788
  appendChk.type = 'checkbox';
775
- appendChk.checked = true;
789
+ appendChk.checked = false; // 用户要求:不默认追加,切片时自己勾
776
790
  appendChk.disabled = true;
777
791
  const appendLabel = el('label', 'fs-meta', '追加到当前数据集');
778
792
  appendLabel.style.display = 'none';
779
793
 
780
- bar2.append(modeSel, lenIn, startBtn, stopBtn, appendChk, appendLabel, el('span', 'fs-grow'), revealBtn);
794
+ bar2.append(modeSel, lenIn, startBtn, stopBtn, appendChk, appendLabel, el('span', 'fs-grow'));
781
795
 
782
796
  const msg = el('div', 'fs-msg');
783
797
  const prog = el('div', 'fs-prog');
@@ -802,10 +816,10 @@ function mountTrain(ctx) {
802
816
  return { d, body };
803
817
  };
804
818
 
805
- const secA = mkSec('① 素材 → 数据集', '把歌放进来、扫描、切成训练用的片', true);
806
- secA.body.append(bar, bar2, listBox, resultBox, dsBar, importBar);
819
+ const secA = mkSec('① 素材 → 数据集', '把歌放进来、扫描、切成训练用的片', false);
820
+ secA.body.append(bar, bar2, importBar, listBox, resultBox, dsBar);
807
821
 
808
- const secB = mkSec('② 训练', '一般只需要改「轮次」,其余都在展开项里', true);
822
+ const secB = mkSec('② 训练', '一般只需要改「轮次」,其余都在展开项里', false);
809
823
  secB.body.append(trainBox);
810
824
 
811
825
  const secC = mkSec('③ 高级:低音增强 / 音域加权', '给数据加降调副本、按音域调采样权重(有效但有限)', false);
@@ -817,6 +831,8 @@ function mountTrain(ctx) {
817
831
  let checked = new Set();
818
832
  let timer = null;
819
833
  let lastDir = '';
834
+ let lastSecState = '';
835
+ let lastResumeAuto = '';
820
836
 
821
837
  const say = (t, bad) => {
822
838
  msg.textContent = t || '';
@@ -1245,16 +1261,16 @@ function mountTrain(ctx) {
1245
1261
  pruneAfterLbl.title = '按下面「每 N 轮留一个」保留,其余删掉。不勾就只是提醒你手动清。';
1246
1262
  const abChk = el('input', 'fs-ck');
1247
1263
  abChk.type = 'checkbox';
1248
- abChk.checked = true;
1264
+ abChk.checked = false; // 用户要求:不默认勾,想要就自己点
1249
1265
  const abLbl = el('label', 'fs-meta', '训练完生成选模对比');
1250
1266
  abLbl.prepend(abChk);
1251
1267
  abLbl.title = '用同一句训练切片,final 和最后两个中间档各唱一遍,进作品库对比听';
1252
1268
  const lowChk = el('input', 'fs-ck');
1253
1269
  lowChk.type = 'checkbox';
1254
- lowChk.checked = true;
1270
+ lowChk.checked = false; // 用户要求:不默认勾(实测只是有限改善)
1255
1271
  const lowLbl = el('label', 'fs-meta', '低音增强');
1256
1272
  lowLbl.prepend(lowChk);
1257
- lowLbl.title = '把每个切片合成 -2/-4 半音的低音数据一起训练,治"低音不像"。F0/特征提取时间约 ×3';
1273
+ lowLbl.title = '有限改善:把每个切片合成 -2/-4 半音的副本一起训练。实测只能缓解、不能根治"低音不像"(模型在低音区本来就没有音色记忆),且 F0/特征提取时间约 ×3';
1258
1274
  chkRow.append(resumeLbl, rebuildLbl, pruneAfterLbl, abLbl, lowLbl, el('span', 'fs-grow'), startT, stopT);
1259
1275
 
1260
1276
  const tProg = el('div', 'fs-prog');
@@ -1386,6 +1402,19 @@ function mountTrain(ctx) {
1386
1402
  const log = st.log || { done: 0, losses: [], latest: null, secPerEpoch: null, error: '' };
1387
1403
  const total = st.total || 0;
1388
1404
 
1405
+ // 分区自动展开:谁在跑就展开谁;都空闲就全收起(用户手动展开的不动)
1406
+ const secState = running ? 'train' : (st.datasetBusy ? 'ds' : 'idle');
1407
+ if (secState !== lastSecState) {
1408
+ lastSecState = secState;
1409
+ secB.d.open = secState === 'train';
1410
+ secA.d.open = secState === 'ds';
1411
+ }
1412
+ // 有没训完的记录、当前又没在训练 → 自动勾「从上次存档继续」(每个实验只代勾一次)
1413
+ if (!running && log.done > 0 && st.exp && lastResumeAuto !== st.exp) {
1414
+ resumeChk.checked = true;
1415
+ lastResumeAuto = st.exp;
1416
+ }
1417
+
1389
1418
  startT.disabled = running || st.datasetBusy;
1390
1419
  // 即使不是本次启动的也能停:/stop 取消的是 worker 当前任务,跟谁提交的无关
1391
1420
  stopT.disabled = !running;
@@ -1429,6 +1458,17 @@ function mountTrain(ctx) {
1429
1458
  tMsg.classList.add('bad');
1430
1459
  }
1431
1460
 
1461
+ // 顶栏状态始终反映正在进行的任务;空闲时不动(保留上一次操作的反馈)
1462
+ if (running) {
1463
+ msg.textContent = tMsg.textContent;
1464
+ msg.classList.toggle('bad', tMsg.classList.contains('bad'));
1465
+ fill.style.width = tFill.style.width;
1466
+ } else if (st.datasetBusy) {
1467
+ fill.style.width = '96%';
1468
+ msg.textContent = '数据集任务进行中…(切片中,取决于素材时长)';
1469
+ msg.classList.remove('bad');
1470
+ }
1471
+
1432
1472
  paintLoss(log);
1433
1473
 
1434
1474
  tModels.replaceChildren();
@@ -1559,19 +1599,6 @@ function mountTrain(ctx) {
1559
1599
  appendLabel.textContent = appendChk.checked ? '追加到当前数据集' : '新建数据集';
1560
1600
  });
1561
1601
 
1562
- notifyTest.addEventListener('click', async () => {
1563
- notifyTest.disabled = true;
1564
- notifyTest.textContent = '发送中…';
1565
- try {
1566
- const r = await ctx.invoke('trainNotifyTest');
1567
- say((r && r.note) ? `通知:${r.note}${r.via ? `(${r.via})` : ''}` : '通知已发');
1568
- } catch (e) {
1569
- say(`测试通知失败:${(e && e.message) || e}`, true);
1570
- } finally {
1571
- notifyTest.disabled = false;
1572
- notifyTest.textContent = '测试通知';
1573
- }
1574
- });
1575
1602
 
1576
1603
  scanBtn.addEventListener('click', async () => {
1577
1604
  const raw = String(pathIn.value || '').trim();
@@ -1618,7 +1645,6 @@ function mountTrain(ctx) {
1618
1645
  });
1619
1646
 
1620
1647
  stopBtn.addEventListener('click', () => void call('cancel', []).then(() => poll()));
1621
- revealBtn.addEventListener('click', () => void call('reveal', []).catch(() => {}));
1622
1648
 
1623
1649
  void poll();
1624
1650
  void loadDatasets();
package/dist/webui.js CHANGED
@@ -10,13 +10,14 @@
10
10
  */
11
11
 
12
12
  const CSS = `
13
- .fs-wrap{display:flex;flex-direction:column;gap:10px;font:13px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
13
+ .fs-wrap{display:flex;flex-direction:column;gap:10px;width:100%;max-width:980px;margin:0 auto;font:13px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
14
14
  .fs-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
15
15
  .fs-bar .fs-grow{flex:1}
16
16
  .fs-btn{appearance:none;border:1px solid rgba(127,127,127,.35);background:transparent;color:inherit;
17
17
  border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer}
18
18
  .fs-btn:hover{background:rgba(127,127,127,.12)}
19
19
  .fs-btn:disabled{opacity:.4;cursor:default}
20
+ select.fs-btn{appearance:auto;-webkit-appearance:menulist;padding:4px 8px;max-width:560px}
20
21
  .fs-btn.danger{border-color:rgba(220,80,80,.5);color:#d05555}
21
22
  .fs-input{flex:0 0 200px;padding:4px 8px;border-radius:6px;border:1px solid rgba(127,127,127,.35);
22
23
  background:transparent;color:inherit;font-size:12px}
@@ -364,7 +365,23 @@ function mountSetup(ctx) {
364
365
  + '运行时是 Python 环境:GPU 版下载约 2.5 GB、装完约 6 GB(55 秒的歌约 8 秒换完);'
365
366
  + 'CPU 版只要约 200 MB,但慢 6~8 倍。已经装好 torch 的不会被覆盖。';
366
367
 
367
- root.append(cards, bar, prog, msg, list, hint);
368
+ // ---- 通知渠道测试(配置页的「完成通知」里填目标,这里一键验证)
369
+ const nbar = el('div', 'fs-bar');
370
+ const nbtn = el('button', 'fs-btn', '测试通知');
371
+ nbtn.title = '立刻发一条测试通知:QQ 通就发 QQ,不通就退桌宠';
372
+ nbtn.addEventListener('click', async () => {
373
+ nbtn.disabled = true;
374
+ try {
375
+ const r = await ctx.invoke('trainNotifyTest', []);
376
+ say(`通知:${(r && r.note) || '已发'}${r && r.via ? `(${r.via})` : ''}`);
377
+ } catch (e) {
378
+ say((e && e.message) || String(e), true);
379
+ }
380
+ nbtn.disabled = false;
381
+ });
382
+ nbar.append(nbtn, el('span', 'fs-meta',
383
+ 'QQ 目标在 Coo 设置 → 插件配置 → 完成通知 里填(group:群号 / private:QQ号,直接填号码也行)'));
384
+ root.append(cards, bar, prog, msg, list, nbar, hint);
368
385
 
369
386
  let timer = null;
370
387
  let lastJob = '';
@@ -733,9 +750,7 @@ function mountTrain(ctx) {
733
750
  const pathIn = el('input', 'fs-tpath');
734
751
  pathIn.placeholder = '粘贴素材文件夹或单个文件路径,可多个用 ; 分隔';
735
752
  const scanBtn = el('button', 'fs-btn', '扫描');
736
- const notifyTest = el('button', 'fs-btn', '测试通知');
737
- notifyTest.title = '立刻发一条测试通知:QQ 通就发 QQ,不通就退桌宠——点了就知道渠道状态';
738
- bar.append(pathIn, scanBtn, notifyTest);
753
+ bar.append(pathIn, scanBtn);
739
754
 
740
755
  const dsBar = el('div', 'fs-bar');
741
756
  const dsSel = el('select', 'fs-btn');
@@ -769,15 +784,14 @@ function mountTrain(ctx) {
769
784
  startBtn.disabled = true;
770
785
  const stopBtn = el('button', 'fs-btn danger', '停止');
771
786
  stopBtn.disabled = true;
772
- const revealBtn = el('button', 'fs-btn', '打开目录');
773
787
  const appendChk = el('input', 'fs-ck');
774
788
  appendChk.type = 'checkbox';
775
- appendChk.checked = true;
789
+ appendChk.checked = false; // 用户要求:不默认追加,切片时自己勾
776
790
  appendChk.disabled = true;
777
791
  const appendLabel = el('label', 'fs-meta', '追加到当前数据集');
778
792
  appendLabel.style.display = 'none';
779
793
 
780
- bar2.append(modeSel, lenIn, startBtn, stopBtn, appendChk, appendLabel, el('span', 'fs-grow'), revealBtn);
794
+ bar2.append(modeSel, lenIn, startBtn, stopBtn, appendChk, appendLabel, el('span', 'fs-grow'));
781
795
 
782
796
  const msg = el('div', 'fs-msg');
783
797
  const prog = el('div', 'fs-prog');
@@ -802,10 +816,10 @@ function mountTrain(ctx) {
802
816
  return { d, body };
803
817
  };
804
818
 
805
- const secA = mkSec('① 素材 → 数据集', '把歌放进来、扫描、切成训练用的片', true);
806
- secA.body.append(bar, bar2, listBox, resultBox, dsBar, importBar);
819
+ const secA = mkSec('① 素材 → 数据集', '把歌放进来、扫描、切成训练用的片', false);
820
+ secA.body.append(bar, bar2, importBar, listBox, resultBox, dsBar);
807
821
 
808
- const secB = mkSec('② 训练', '一般只需要改「轮次」,其余都在展开项里', true);
822
+ const secB = mkSec('② 训练', '一般只需要改「轮次」,其余都在展开项里', false);
809
823
  secB.body.append(trainBox);
810
824
 
811
825
  const secC = mkSec('③ 高级:低音增强 / 音域加权', '给数据加降调副本、按音域调采样权重(有效但有限)', false);
@@ -817,6 +831,8 @@ function mountTrain(ctx) {
817
831
  let checked = new Set();
818
832
  let timer = null;
819
833
  let lastDir = '';
834
+ let lastSecState = '';
835
+ let lastResumeAuto = '';
820
836
 
821
837
  const say = (t, bad) => {
822
838
  msg.textContent = t || '';
@@ -1245,16 +1261,16 @@ function mountTrain(ctx) {
1245
1261
  pruneAfterLbl.title = '按下面「每 N 轮留一个」保留,其余删掉。不勾就只是提醒你手动清。';
1246
1262
  const abChk = el('input', 'fs-ck');
1247
1263
  abChk.type = 'checkbox';
1248
- abChk.checked = true;
1264
+ abChk.checked = false; // 用户要求:不默认勾,想要就自己点
1249
1265
  const abLbl = el('label', 'fs-meta', '训练完生成选模对比');
1250
1266
  abLbl.prepend(abChk);
1251
1267
  abLbl.title = '用同一句训练切片,final 和最后两个中间档各唱一遍,进作品库对比听';
1252
1268
  const lowChk = el('input', 'fs-ck');
1253
1269
  lowChk.type = 'checkbox';
1254
- lowChk.checked = true;
1270
+ lowChk.checked = false; // 用户要求:不默认勾(实测只是有限改善)
1255
1271
  const lowLbl = el('label', 'fs-meta', '低音增强');
1256
1272
  lowLbl.prepend(lowChk);
1257
- lowLbl.title = '把每个切片合成 -2/-4 半音的低音数据一起训练,治"低音不像"。F0/特征提取时间约 ×3';
1273
+ lowLbl.title = '有限改善:把每个切片合成 -2/-4 半音的副本一起训练。实测只能缓解、不能根治"低音不像"(模型在低音区本来就没有音色记忆),且 F0/特征提取时间约 ×3';
1258
1274
  chkRow.append(resumeLbl, rebuildLbl, pruneAfterLbl, abLbl, lowLbl, el('span', 'fs-grow'), startT, stopT);
1259
1275
 
1260
1276
  const tProg = el('div', 'fs-prog');
@@ -1386,6 +1402,19 @@ function mountTrain(ctx) {
1386
1402
  const log = st.log || { done: 0, losses: [], latest: null, secPerEpoch: null, error: '' };
1387
1403
  const total = st.total || 0;
1388
1404
 
1405
+ // 分区自动展开:谁在跑就展开谁;都空闲就全收起(用户手动展开的不动)
1406
+ const secState = running ? 'train' : (st.datasetBusy ? 'ds' : 'idle');
1407
+ if (secState !== lastSecState) {
1408
+ lastSecState = secState;
1409
+ secB.d.open = secState === 'train';
1410
+ secA.d.open = secState === 'ds';
1411
+ }
1412
+ // 有没训完的记录、当前又没在训练 → 自动勾「从上次存档继续」(每个实验只代勾一次)
1413
+ if (!running && log.done > 0 && st.exp && lastResumeAuto !== st.exp) {
1414
+ resumeChk.checked = true;
1415
+ lastResumeAuto = st.exp;
1416
+ }
1417
+
1389
1418
  startT.disabled = running || st.datasetBusy;
1390
1419
  // 即使不是本次启动的也能停:/stop 取消的是 worker 当前任务,跟谁提交的无关
1391
1420
  stopT.disabled = !running;
@@ -1429,6 +1458,17 @@ function mountTrain(ctx) {
1429
1458
  tMsg.classList.add('bad');
1430
1459
  }
1431
1460
 
1461
+ // 顶栏状态始终反映正在进行的任务;空闲时不动(保留上一次操作的反馈)
1462
+ if (running) {
1463
+ msg.textContent = tMsg.textContent;
1464
+ msg.classList.toggle('bad', tMsg.classList.contains('bad'));
1465
+ fill.style.width = tFill.style.width;
1466
+ } else if (st.datasetBusy) {
1467
+ fill.style.width = '96%';
1468
+ msg.textContent = '数据集任务进行中…(切片中,取决于素材时长)';
1469
+ msg.classList.remove('bad');
1470
+ }
1471
+
1432
1472
  paintLoss(log);
1433
1473
 
1434
1474
  tModels.replaceChildren();
@@ -1559,19 +1599,6 @@ function mountTrain(ctx) {
1559
1599
  appendLabel.textContent = appendChk.checked ? '追加到当前数据集' : '新建数据集';
1560
1600
  });
1561
1601
 
1562
- notifyTest.addEventListener('click', async () => {
1563
- notifyTest.disabled = true;
1564
- notifyTest.textContent = '发送中…';
1565
- try {
1566
- const r = await ctx.invoke('trainNotifyTest');
1567
- say((r && r.note) ? `通知:${r.note}${r.via ? `(${r.via})` : ''}` : '通知已发');
1568
- } catch (e) {
1569
- say(`测试通知失败:${(e && e.message) || e}`, true);
1570
- } finally {
1571
- notifyTest.disabled = false;
1572
- notifyTest.textContent = '测试通知';
1573
- }
1574
- });
1575
1602
 
1576
1603
  scanBtn.addEventListener('click', async () => {
1577
1604
  const raw = String(pathIn.value || '').trim();
@@ -1618,7 +1645,6 @@ function mountTrain(ctx) {
1618
1645
  });
1619
1646
 
1620
1647
  stopBtn.addEventListener('click', () => void call('cancel', []).then(() => poll()));
1621
- revealBtn.addEventListener('click', () => void call('reveal', []).catch(() => {}));
1622
1648
 
1623
1649
  void poll();
1624
1650
  void loadDatasets();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-fish-sing",
3
- "version": "0.4.13",
3
+ "version": "0.4.15",
4
4
  "description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -36,7 +36,7 @@
36
36
  "local"
37
37
  ],
38
38
  "describe": "describe.json",
39
- "webUiClient": "dist/webui-554b9bbb.js"
39
+ "webUiClient": "dist/webui-ba6b0f93.js"
40
40
  },
41
41
  "scripts": {
42
42
  "doctor": "node tools/doctor.mjs"
package/src/worker.ts CHANGED
@@ -272,12 +272,38 @@ export class WorkerClient {
272
272
  let lastChange = Date.now();
273
273
  let lastMsg = '';
274
274
  let lastPct = -1;
275
+ let badSince = 0;
275
276
 
276
277
  for (;;) {
277
- const res = await fetch(`${this.baseUrl}/job/${id}`, { signal: AbortSignal.timeout(10_000) });
278
- const body = (await res.json().catch(() => ({}))) as { ok?: boolean; job?: JobState };
279
- const job = body.job;
280
- if (!job) throw new Error(`查不到任务 ${id}`);
278
+ let job: JobState | undefined;
279
+ try {
280
+ const res = await fetch(`${this.baseUrl}/job/${id}`, { signal: AbortSignal.timeout(10_000) });
281
+ if (res.status === 404) {
282
+ // 只有 worker 明确说"没有这个任务"才算真没了(比如 worker 重启过、内存记录清空)。
283
+ // 网络抖动/响应残缺不能算——0.4.14 实测:停止训练的那一瞬间机器卡了一下,
284
+ // 拿到残缺响应就报"训练中断:查不到任务",其实任务好好地在。
285
+ throw new Error(`查不到任务 ${id}`);
286
+ }
287
+ const body = (await res.json().catch(() => null)) as { ok?: boolean; job?: JobState } | null;
288
+ job = body?.job;
289
+ } catch (e) {
290
+ if (e instanceof Error && e.message.startsWith('查不到任务')) throw e; // worker 明确说没有,才是真没有
291
+ if (!badSince) badSince = Date.now();
292
+ if (Date.now() - badSince > 30_000) {
293
+ throw new Error(`worker 连不上/响应异常已持续 30 秒:${e instanceof Error ? e.message : String(e)}`);
294
+ }
295
+ await new Promise((r) => setTimeout(r, 700));
296
+ continue;
297
+ }
298
+ badSince = 0;
299
+ if (!job) {
300
+ if (!badSince) badSince = Date.now();
301
+ if (Date.now() - badSince > 30_000) {
302
+ throw new Error('worker 响应异常(任务字段缺失)已持续 30 秒');
303
+ }
304
+ await new Promise((r) => setTimeout(r, 700));
305
+ continue;
306
+ }
281
307
 
282
308
  const pct = job.progress ?? 0;
283
309
  if ((job.message && job.message !== lastMsg) || Math.abs(pct - lastPct) > 1e-6) {
package/src/world.ts CHANGED
@@ -1120,6 +1120,12 @@ export class FishSingWorld implements World {
1120
1120
  job.state = 'error';
1121
1121
  job.error = e instanceof Error ? e.message : String(e);
1122
1122
  job.msg = job.error;
1123
+ if (job.error === '已取消' || job.error === '已手动停止') {
1124
+ // 用户自己点的停止不算"中断",也用不着通知(0.4.14 之前点停止也会收到
1125
+ // 一条"训练中断"推送,纯属噪音)
1126
+ this.host?.log.info(`[fish-sing] 训练已停止(${job.error})`);
1127
+ return;
1128
+ }
1123
1129
  this.host?.log.warn(`[fish-sing] 训练中断:${job.error}`);
1124
1130
  void this.notifyEvent(`训练中断:${exp}`, job.error);
1125
1131
  });