Replace resemble-perth with a no-op stub
All checks were successful
Build ROCm Image / build (push) Successful in 17m32s

resemble-perth uses uv-build which is incompatible with the old system
pip in the ROCm base image. Since watermarking is unnecessary for
self-hosted private use, stub out the perth module so chatterbox's
import is satisfied without any build complexity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 11:16:08 -04:00
parent dc7a3cf769
commit de6156a336
3 changed files with 19 additions and 7 deletions

View File

@@ -17,6 +17,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /app WORKDIR /app
COPY perth_stub.py .
# Step 1: Install ROCm-compatible PyTorch stack first. # Step 1: Install ROCm-compatible PyTorch stack first.
# This must happen before anything else to prevent pip from pulling CPU wheels. # This must happen before anything else to prevent pip from pulling CPU wheels.
COPY requirements-rocm-init.txt . COPY requirements-rocm-init.txt .
@@ -26,15 +28,14 @@ RUN pip3 install -r requirements-rocm-init.txt
COPY requirements-rocm.txt . COPY requirements-rocm.txt .
RUN pip3 install -r requirements-rocm.txt RUN pip3 install -r requirements-rocm.txt
# Step 3: Install resemble-perth with --no-build-isolation so pip uses the
# already-installed uv binary instead of an isolated env where it can't find it.
RUN pip3 install uv && \
pip3 install --no-build-isolation \
"resemble-perth @ git+https://github.com/resemble-ai/Perth.git@master"
# Step 3: Install chatterbox with --no-deps so pip cannot replace ROCm torch. # Step 3: Install chatterbox with --no-deps so pip cannot replace ROCm torch.
RUN pip3 install --no-deps chatterbox-tts RUN pip3 install --no-deps chatterbox-tts
# Stub out resemble-perth (audio watermarking, unnecessary for self-hosted use).
# Install as 'perth' module to satisfy chatterbox's import.
RUN python3 -c "import site; print(site.getsitepackages()[0])" | \
xargs -I{} cp /app/perth_stub.py {}/perth.py
# Application source # Application source
COPY engine.py config.py wyoming_handler.py wyoming_voices.py main.py ./ COPY engine.py config.py wyoming_handler.py wyoming_voices.py main.py ./

11
perth_stub.py Normal file
View File

@@ -0,0 +1,11 @@
# Stub for resemble-perth audio watermarking.
# Watermarking is unnecessary for self-hosted/private deployments.
# This stub satisfies chatterbox's import without the build complexity.
class PerthImplicitWatermarker:
def apply_watermark(self, audio, sample_rate):
return audio
class PerthImperceptibleWatermarker:
def apply_watermark(self, audio, sample_rate):
return audio

View File

@@ -12,7 +12,7 @@ huggingface-hub
omegaconf omegaconf
# Chatterbox dependencies (installed separately since chatterbox uses --no-deps) # Chatterbox dependencies (installed separately since chatterbox uses --no-deps)
# Note: resemble-perth is installed in a separate Dockerfile step with --no-build-isolation # Note: resemble-perth is stubbed out in perth_stub.py (watermarking unneeded for self-hosted use)
conformer==0.3.2 conformer==0.3.2
s3tokenizer s3tokenizer
spacy-pkuseg spacy-pkuseg