@oxiaom/adoremix 1.0.61 → 1.0.62
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/package.json +1 -1
- package/tts/providers/audio8.js +18 -10
package/package.json
CHANGED
package/tts/providers/audio8.js
CHANGED
|
@@ -313,16 +313,11 @@ function install(opts) {
|
|
|
313
313
|
const cfg = require(path.join(__dirname, '..', '..', 'src', 'config'));
|
|
314
314
|
modelDir = cfg.getConfigValue(configWorkdir(), 'TTS.audio8_model_dir') || '';
|
|
315
315
|
} catch (e) {}
|
|
316
|
-
const modelLink = `~/audio8/${AUDIO8_RUNTIME_DIR}/model`; // Audio8 期望的模型目录
|
|
317
|
-
//
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
execSync(`mkdir -p $(dirname ${modelLink}) && rm -rf ${modelLink} && ln -s ${modelDir} ${modelLink}`, { stdio: 'inherit', shell: '/bin/bash' });
|
|
322
|
-
} catch (e) {
|
|
323
|
-
logger.warn('链接模型失败: ' + e.message);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
316
|
+
const modelLink = `~/audio8/${AUDIO8_RUNTIME_DIR}/model`; // Audio8 期望的模型目录(软链在源码就位后建)
|
|
317
|
+
// 重装保护:已有 model/voices(423MB+)先挪 /tmp 暂存,源码解压后还原——重跑 install 不用重新下模型
|
|
318
|
+
execSync(`rm -rf /tmp/audio8-keep && mkdir -p /tmp/audio8-keep; ` +
|
|
319
|
+
`for d in model voices; do if [ -e ~/audio8/${AUDIO8_RUNTIME_DIR}/$d ]; then mv ~/audio8/${AUDIO8_RUNTIME_DIR}/$d /tmp/audio8-keep/$d; fi; done; true`,
|
|
320
|
+
{ stdio: 'pipe', shell: '/bin/bash' });
|
|
326
321
|
|
|
327
322
|
// 拉 Audio8_TTS 源码:先试内置 tarball(主包 audio8-assets/audio8-tts.tgz,离线),再 git 镜像,最后 codeload
|
|
328
323
|
let cloned = false;
|
|
@@ -398,6 +393,19 @@ function install(opts) {
|
|
|
398
393
|
logger.log('当前内容: ' + execSync('ls ~/audio8', { shell: '/bin/bash', encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim().replace(/\n/g, ' '));
|
|
399
394
|
return 1;
|
|
400
395
|
}
|
|
396
|
+
// 还原暂存的 model/voices(重装保护的后半段;新装机没有暂存则跳过)
|
|
397
|
+
execSync(`for d in model voices; do if [ -e /tmp/audio8-keep/$d ]; then mkdir -p ~/audio8/${AUDIO8_RUNTIME_DIR}; mv /tmp/audio8-keep/$d ~/audio8/${AUDIO8_RUNTIME_DIR}/$d; fi; done; rm -rf /tmp/audio8-keep; true`,
|
|
398
|
+
{ stdio: 'pipe', shell: '/bin/bash' });
|
|
399
|
+
|
|
400
|
+
// config 配了预托管模型目录(audio8_model_dir)则软链覆盖(优先级高于还原的模型)
|
|
401
|
+
if (modelDir) {
|
|
402
|
+
try {
|
|
403
|
+
logger.log('=== 链接预托管模型 ' + modelDir + ' → ' + modelLink + ' ===');
|
|
404
|
+
execSync(`mkdir -p $(dirname ${modelLink}) && rm -rf ${modelLink} && ln -s ${modelDir} ${modelLink}`, { stdio: 'inherit', shell: '/bin/bash' });
|
|
405
|
+
} catch (e) {
|
|
406
|
+
logger.warn('链接模型失败: ' + e.message);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
401
409
|
|
|
402
410
|
// venv + pip install(Python 3.11+,numpy 2.4.3 需要)
|
|
403
411
|
// venv 路径必须与 AUDIO8_VENV_DIR/buildSystemdUnit 一致(~/audio8/onnx_runtime_0_1b_int8/.venv),
|