snsbhg commited on
Commit
782f68a
·
verified ·
1 Parent(s): 43aece8

Upload 3 files

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -6
  2. README.md +13 -4
Dockerfile CHANGED
@@ -1,9 +1,11 @@
1
- # Base image with PyTorch + CUDA 12.1 runtime
2
- FROM pytorch/pytorch:2.5.1-cuda12.1-cudnn9-runtime
3
 
4
  ENV PYTHONUNBUFFERED=1 \
5
  PIP_DISABLE_PIP_VERSION_CHECK=1 \
6
- PIP_PREFER_BINARY=1
 
 
7
 
8
  WORKDIR /app
9
 
@@ -12,15 +14,17 @@ RUN apt-get update && \
12
  apt-get install -y --no-install-recommends \
13
  ffmpeg libsox-dev git \
14
  build-essential cmake ninja-build pkg-config && \
15
- rm -rf /var/lib/apt/lists/*
 
16
 
17
- # Get GPT-SoVITS source
18
  RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git /app
19
 
20
  # Python deps
21
  RUN pip install --upgrade pip && \
22
- pip install --no-deps --no-cache-dir -r /app/extra-req.txt && \
23
  pip install --no-cache-dir -r /app/requirements.txt && \
 
 
24
  pip install --no-cache-dir fastapi uvicorn soundfile huggingface_hub ffmpeg-python
25
 
26
  # Pre-download essentials
 
1
+ # Python 3.10 base (works well with librosa 0.9.2 + numba 0.56.4)
2
+ FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
3
 
4
  ENV PYTHONUNBUFFERED=1 \
5
  PIP_DISABLE_PIP_VERSION_CHECK=1 \
6
+ PIP_PREFER_BINARY=1 \
7
+ NUMBA_CACHE_DIR=/tmp/numba_cache
8
+ # NUMBA_DISABLE_JIT=1 # ← 若仍报 numba JIT 缓存错误,可取消注释完全禁用 JIT(更稳,稍慢)
9
 
10
  WORKDIR /app
11
 
 
14
  apt-get install -y --no-install-recommends \
15
  ffmpeg libsox-dev git \
16
  build-essential cmake ninja-build pkg-config && \
17
+ rm -rf /var/lib/apt/lists/* && \
18
+ mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache
19
 
20
+ # Clone GPT-SoVITS
21
  RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git /app
22
 
23
  # Python deps
24
  RUN pip install --upgrade pip && \
 
25
  pip install --no-cache-dir -r /app/requirements.txt && \
26
+ # 为防 requirements 中把 librosa/numba 升级,这里再次强制 pin 到兼容版本
27
+ pip install --no-cache-dir --force-reinstall --no-deps librosa==0.9.2 numba==0.56.4 && \
28
  pip install --no-cache-dir fastapi uvicorn soundfile huggingface_hub ffmpeg-python
29
 
30
  # Pre-download essentials
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: GPT-SoVITS API (v2 ProPlus) for AstrBot
3
  emoji: 🗣️
4
  colorFrom: yellow
5
  colorTo: red
@@ -8,9 +8,18 @@ app_port: 7860
8
  license: mit
9
  ---
10
 
11
- # GPT‑SoVITS v2 ProPlus — REST API for AstrBot (Docker Space)
12
 
13
- ## 放置你的文件(统一命名,避免中文/空格/加号)
 
 
 
 
14
  - GPT 权重 → `weights/shantianliang_proplus_e32.ckpt`
15
  - SoVITS 权重 → `weights/shantianliang_proplus_e8_s192.pth`
16
- - 参考音频 → `reference_audio/ref_shantianliang_1.wav`(当前是 1 秒静音占位,请替换)
 
 
 
 
 
 
1
  ---
2
+ title: GPT-SoVITS API (v2 ProPlus) for AstrBot (Py3.10 fix)
3
  emoji: 🗣️
4
  colorFrom: yellow
5
  colorTo: red
 
8
  license: mit
9
  ---
10
 
11
+ # GPT‑SoVITS v2 ProPlus — REST API for AstrBot (Python 3.10 base)
12
 
13
+ > 该版本改用 **Python 3.10** 的 PyTorch 官方镜像(`pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime`),
14
+ > 并在 **安装完仓库 requirements 之后** 强制重装 `librosa==0.9.2`、`numba==0.56.4`,
15
+ > 再结合 `NUMBA_CACHE_DIR=/tmp/numba_cache` 来规避你遇到的 `numba/librosa` 缓存错误。
16
+
17
+ ## 放置你的文件
18
  - GPT 权重 → `weights/shantianliang_proplus_e32.ckpt`
19
  - SoVITS 权重 → `weights/shantianliang_proplus_e8_s192.pth`
20
+ - 参考音频 → `reference_audio/ref_shantianliang_1.wav`(1 秒静音占位,建议替换)
21
+
22
+ ## 启动后测试(举例)
23
+ - 切 SoVITS:`/set_sovits_weights?weights_path=/app/pretrained_models/shantianliang/shantianliang_proplus_e8_s192.pth`
24
+ - 切 GPT:`/set_gpt_weights?weights_path=/app/pretrained_models/shantianliang/shantianliang_proplus_e32.ckpt`
25
+ - 合成:`/tts`(POST JSON,支持流式/整段)