@oxiaom/adoremix 1.0.49 → 1.0.51

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxiaom/adoremix",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "AdoreMix broadcast server - cross-platform installer, runner and service manager",
5
5
  "bin": {
6
6
  "adoremix": "./bin/adoremix.js"
@@ -205,6 +205,12 @@ function systemInstallCmd(pkgMgr, pkgs) {
205
205
  }
206
206
 
207
207
  function buildSystemdUnit() {
208
+ // Audio8 onnx_runtime 需要 numpy 2.4.3(需 Python ≥ 3.11),Ubuntu 22.04 默认 3.10
209
+ // 自动探测 python3.11(PPA/官方包),fallback 到 python3
210
+ const pyBin = (function(){
211
+ try { execFileSync('command -v python3.11', { stdio: 'pipe' }); return 'python3.11'; }
212
+ catch (e) { return 'python3'; }
213
+ })();
208
214
  return `[Unit]
209
215
  Description=Audio8 TTS (AdoreMix)
210
216
  After=network.target
@@ -214,7 +220,7 @@ Type=simple
214
220
  User=root
215
221
  WorkingDirectory=${AUDIO8_DEPLOY_DIR}/onnx_runtime
216
222
  Environment=PATH=${AUDIO8_VENV_DIR}/bin:/usr/bin:/bin
217
- ExecStart=${AUDIO8_VENV_DIR}/bin/python -m arktts_runtime.service --model-dir ./model --voices-dir ./model/voices --port ${AUDIO8_DEFAULT_PORT}
223
+ ExecStart=${AUDIO8_VENV_DIR}/bin/${pyBin} -m arktts_runtime.service --model-dir ./model --voices-dir ./model/voices --port ${AUDIO8_DEFAULT_PORT}
218
224
  Restart=on-failure
219
225
  RestartSec=5
220
226
 
@@ -298,11 +304,11 @@ function install(opts) {
298
304
  }
299
305
  }
300
306
 
301
- // git clone(带重试和国内镜像备选,github 在公司网常断)
307
+ // 拉 Audio8_TTS 源码:先试 git clone(多个镜像),全失败再走 codeload tarball(最后备选)
302
308
  const MIRRORS = [
303
- AUDIO8_REPO, // 官方
309
+ AUDIO8_REPO, // 官方 https
304
310
  'https://ghproxy.cn/https://github.com/Audio8-AI/Audio8_TTS.git', // 国内代理
305
- 'https://mirror.ghproxy.com/https://github.com/Audio8-AI/Audio8_TTS.git'
311
+ 'https://hub.fastgit.xyz/Audio8-AI/Audio8_TTS.git' // fastgit 镜像
306
312
  ];
307
313
  let cloned = false;
308
314
  for (let attempt = 1; attempt <= 2; attempt++) {
@@ -321,17 +327,31 @@ function install(opts) {
321
327
  if (cloned) break;
322
328
  execSync('sleep 5', { stdio: 'ignore', shell: '/bin/bash' });
323
329
  }
330
+ // 备选:codeload 直接下 master 分支 tarball(绕过 git,HTTP 而已,国内更稳定)
331
+ if (!cloned) {
332
+ try {
333
+ logger.log('=== 备选:codeload github tarball ===');
334
+ execSync(`rm -rf ~/audio8 && mkdir -p ~/audio8 && cd /tmp && curl -fL --retry 3 --connect-timeout 10 https://codeload.github.com/Audio8-AI/Audio8_TTS/tar.gz/master -o audio8.tar.gz && tar xzf audio8.tar.gz --strip-components=1 -C ~/audio8 && rm -f audio8.tar.gz && ls ~/audio8 | head -3`, { stdio: 'inherit', shell: '/bin/bash' });
335
+ cloned = true;
336
+ } catch (e) {
337
+ logger.error('codeload 也失败:' + String(e.message).slice(0, 200));
338
+ }
339
+ }
324
340
  if (!cloned) {
325
341
  logger.error('所有镜像和重试都失败,无法克隆 Audio8_TTS 仓库');
326
342
  logger.warn('解决:手动在 ~/audio8 下放好 Audio8_TTS 源码再重试 install(跳过 git clone 步骤)');
327
343
  return 1;
328
344
  }
329
345
 
330
- // venv + pip install
346
+ // venv + pip install(Python 3.11+,numpy 2.4.3 需要)
347
+ const pyBase = (function(){
348
+ try { execFileSync('command -v python3.11', { stdio: 'pipe' }); return 'python3.11'; }
349
+ catch (e) { return 'python3'; }
350
+ })();
331
351
  try {
332
- logger.log('=== 创建 venv 并安装 Python 依赖(首次需 5-10 分钟下载 torch 等)===');
333
- execSync('python3 -m venv ~/.audio8_venv', { stdio: 'inherit', shell: '/bin/bash' });
334
- execSync('source ~/.audio8_venv/bin/activate && pip install -U pip --quiet && pip install -r ~/audio8/onnx_runtime/requirements.txt --quiet', { stdio: 'inherit', shell: '/bin/bash' });
352
+ logger.log('=== 创建 venv 并安装 Python 依赖(首次需 5-10 分钟下载 torch 等,Python=' + pyBase + ')===');
353
+ execSync(`${pyBase} -m venv ~/.audio8_venv`, { stdio: 'inherit', shell: '/bin/bash' });
354
+ execSync(`source ~/.audio8_venv/bin/activate && pip install -U pip --quiet && pip install -r ~/audio8/onnx_runtime/requirements.txt --quiet`, { stdio: 'inherit', shell: '/bin/bash' });
335
355
  } catch (e) {
336
356
  logger.error('Python 依赖安装失败: ' + e.message.slice(0, 200));
337
357
  return 1;