@oxiaom/adoremix 1.0.53 → 1.0.55
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 +13 -6
package/package.json
CHANGED
package/tts/providers/audio8.js
CHANGED
|
@@ -178,7 +178,7 @@ const AUDIO8_MODEL_DIR = '~/audio8_models/audio8-TTS-0.1B-ONNX-INT8';
|
|
|
178
178
|
function detectPkgMgr() {
|
|
179
179
|
function exists(cmd) {
|
|
180
180
|
try {
|
|
181
|
-
const out = execSync('
|
|
181
|
+
const out = execSync('which ' + cmd + ' 2>/dev/null || echo NOT_FOUND', { shell: '/bin/bash', encoding: 'utf8' });
|
|
182
182
|
const t = out.trim();
|
|
183
183
|
return t !== '' && t !== 'NOT_FOUND';
|
|
184
184
|
} catch (e) { return false; }
|
|
@@ -208,9 +208,16 @@ function buildSystemdUnit() {
|
|
|
208
208
|
// Audio8 onnx_runtime 需要 numpy 2.4.3(需 Python ≥ 3.11),Ubuntu 22.04 默认 3.10
|
|
209
209
|
// 自动探测 python3.11(PPA/官方包),fallback 到 python3
|
|
210
210
|
const pyBin = (function(){
|
|
211
|
-
try {
|
|
211
|
+
try { execSync('command -v python3.11 2>/dev/null', { shell: '/bin/bash', stdio: 'pipe' }); return 'python3.11'; }
|
|
212
212
|
catch (e) { return 'python3'; }
|
|
213
213
|
})();
|
|
214
|
+
// systemd 不展开 ~,必须用绝对路径(root 下 $HOME=/root)
|
|
215
|
+
const home = (function(){
|
|
216
|
+
try { return execSync('/bin/bash -c "echo $HOME"', { shell: '/bin/bash', stdio: 'pipe', encoding: 'utf8' }).trim() || '/root'; }
|
|
217
|
+
catch (e) { return '/root'; }
|
|
218
|
+
})();
|
|
219
|
+
const deployDir = AUDIO8_DEPLOY_DIR.replace(/^~/, home);
|
|
220
|
+
const venvDir = AUDIO8_VENV_DIR.replace(/^~/, home);
|
|
214
221
|
return `[Unit]
|
|
215
222
|
Description=Audio8 TTS (AdoreMix)
|
|
216
223
|
After=network.target
|
|
@@ -218,9 +225,9 @@ After=network.target
|
|
|
218
225
|
[Service]
|
|
219
226
|
Type=simple
|
|
220
227
|
User=root
|
|
221
|
-
WorkingDirectory=${
|
|
222
|
-
Environment=PATH=${
|
|
223
|
-
ExecStart=${
|
|
228
|
+
WorkingDirectory=${deployDir}/onnx_runtime
|
|
229
|
+
Environment=PATH=${venvDir}/bin:/usr/bin:/bin
|
|
230
|
+
ExecStart=${venvDir}/bin/${pyBin} -m arktts_runtime.service --model-dir ./model --voices-dir ./model/voices --port ${AUDIO8_DEFAULT_PORT}
|
|
224
231
|
Restart=on-failure
|
|
225
232
|
RestartSec=5
|
|
226
233
|
|
|
@@ -345,7 +352,7 @@ function install(opts) {
|
|
|
345
352
|
|
|
346
353
|
// venv + pip install(Python 3.11+,numpy 2.4.3 需要)
|
|
347
354
|
const pyBase = (function(){
|
|
348
|
-
try {
|
|
355
|
+
try { execSync('command -v python3.11 2>/dev/null', { shell: '/bin/bash', stdio: 'pipe' }); return 'python3.11'; }
|
|
349
356
|
catch (e) { return 'python3'; }
|
|
350
357
|
})();
|
|
351
358
|
try {
|