cortico-world-fish-sing 0.4.8 → 0.4.9
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 +5 -0
- package/package.json +1 -1
- package/src/world.ts +31 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循语义化。
|
|
4
4
|
|
|
5
|
+
## [0.4.9] - 2026-11-02
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
- **训练完成后选模对比静默跳过**("只有一个可用存档(中间档可能被清理了)"):`save_every_weights=1` 时 RVC 把存档点导出成 `assets/weights/<实验>_e<N>_s<X>.pth`,logs 里只留滚动的 `G_2333333`(与 final 重复)。原实现只查 logs 里的 `G_<步数>.pth`,所以永远凑不齐两档。现在优先从 weights 目录取最近两个导出档(自动跳过与 final 重复的那个),老实验才退回查 logs。
|
|
9
|
+
|
|
5
10
|
## [0.4.8] - 2026-11-02
|
|
6
11
|
|
|
7
12
|
### 修复
|
package/package.json
CHANGED
package/src/world.ts
CHANGED
|
@@ -329,15 +329,38 @@ export class FishSingWorld implements World {
|
|
|
329
329
|
};
|
|
330
330
|
const variants: { ckpt: string; label: string; index: string }[] = [];
|
|
331
331
|
const finalPth = join(weights, `${exp}.pth`);
|
|
332
|
-
|
|
332
|
+
const hasFinal = existsSync(finalPth);
|
|
333
|
+
if (hasFinal) variants.push({ ckpt: finalPth, label: 'final', index: indexOf(logDir) });
|
|
333
334
|
try {
|
|
334
|
-
// 中间档从新到旧取 2
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
335
|
+
// 中间档从新到旧取 2 个。
|
|
336
|
+
// 注意:save_every_weights=1 时 RVC 把每个存档点导出成 weights/<exp>_e<N>_s<X>.pth,
|
|
337
|
+
// logs 里只剩滚动的 G_2333333(跟 final 重复)——所以必须优先看 weights 目录。
|
|
338
|
+
// (0.4.8 之前只查 logs 里的 G_<步数>.pth,结果永远"只有一个存档",选模对比被静默跳过。)
|
|
339
|
+
const esc = exp.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
340
|
+
const re = new RegExp(`^${esc}_e(\\d+)_s\\d+\\.pth$`);
|
|
341
|
+
const exported = readdirSync(weights)
|
|
342
|
+
.map((f) => re.exec(f))
|
|
343
|
+
.filter((m): m is RegExpExecArray => Boolean(m))
|
|
344
|
+
.map((m) => ({ epoch: Number(m[1]), file: m[0] }))
|
|
345
|
+
.sort((a, b) => b.epoch - a.epoch);
|
|
346
|
+
// 最新一个导出的存档通常就等于 final,跳过它(否则同一份权重会比两次)
|
|
347
|
+
const pool = hasFinal ? exported.slice(1) : exported;
|
|
348
|
+
for (const it of pool.slice(0, 2)) {
|
|
349
|
+
variants.push({
|
|
350
|
+
ckpt: join(weights, it.file),
|
|
351
|
+
label: `e${it.epoch}`,
|
|
352
|
+
index: indexOf(logDir),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (variants.length < 2) {
|
|
356
|
+
// 老实验没有导出文件时退回 logs 里的 G_<步数>.pth
|
|
357
|
+
const gs = readdirSync(logDir)
|
|
358
|
+
.map((f) => /^G_(\d+)\.pth$/.exec(f))
|
|
359
|
+
.filter((m): m is RegExpExecArray => Boolean(m) && m[1] !== '2333333')
|
|
360
|
+
.sort((a, b) => Number(b[1]) - Number(a[1]))
|
|
361
|
+
.slice(0, 2);
|
|
362
|
+
for (const m of gs) variants.push({ ckpt: join(logDir, m[0]), label: `e${m[1]}`, index: indexOf(logDir) });
|
|
363
|
+
}
|
|
341
364
|
} catch {
|
|
342
365
|
/* 没有中间档就只用 final */
|
|
343
366
|
}
|