diff --git a/Dockerfile.rocm b/Dockerfile.rocm index 84b04a3..ef9a626 100644 --- a/Dockerfile.rocm +++ b/Dockerfile.rocm @@ -17,6 +17,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /app +COPY perth_stub.py . + # Step 1: Install ROCm-compatible PyTorch stack first. # This must happen before anything else to prevent pip from pulling CPU wheels. COPY requirements-rocm-init.txt . @@ -26,15 +28,14 @@ RUN pip3 install -r requirements-rocm-init.txt COPY 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. 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 COPY engine.py config.py wyoming_handler.py wyoming_voices.py main.py ./ diff --git a/perth_stub.py b/perth_stub.py new file mode 100644 index 0000000..7b3322c --- /dev/null +++ b/perth_stub.py @@ -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 diff --git a/requirements-rocm.txt b/requirements-rocm.txt index f66ca9f..6f7e9c5 100644 --- a/requirements-rocm.txt +++ b/requirements-rocm.txt @@ -12,7 +12,7 @@ huggingface-hub omegaconf # 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 s3tokenizer spacy-pkuseg