From b9f637faa49802872d0a12e02d9d9657e6328346 Mon Sep 17 00:00:00 2001 From: javis-bot Date: Tue, 23 Jun 2026 01:02:43 +0900 Subject: [PATCH] fix: stop hardcoding MELO_SPEED so the .env override reaches the worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit supervisord.conf passed MELO_DEVICE through as %(ENV_MELO_DEVICE)s but pinned MELO_SPEED="1.5", so lowering MELO_SPEED in .env had no effect — the worker always got 1.5. Pass MELO_SPEED through with %(ENV_MELO_SPEED)s and set a compose default (MELO_SPEED=${MELO_SPEED:-1.5}, same pattern as MELO_DEVICE) so the supervisord expansion always resolves and an .env value actually changes the speaking rate. Default rate is unchanged (1.5). melo_worker logs the resolved speed at startup, so the env->worker path is verifiable. Verified: _resolve_speed() returns 1.1 for MELO_SPEED=1.1 (1.5 otherwise), and `MELO_SPEED=1.1 docker compose config` renders MELO_SPEED: "1.1" into the env. Co-Authored-By: Claude Opus 4.7 --- docker-compose.yml | 4 ++++ docker/supervisord.conf | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index be8024d..9f63909 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,6 +69,10 @@ services: # MeloTTS on the GPU (cu128 torch baked by docker/setup-melo.sh). CPU synth # serialised under load and pushed TTS to 7-8s; GPU does ~0.3s/sentence. MELO_DEVICE: ${MELO_DEVICE:-cuda} + # Speaking rate for MeloTTS. Set here (with a default) so supervisord's + # %(ENV_MELO_SPEED)s passthrough always resolves and an .env override + # actually reaches the melo-worker. Lower it (e.g. 1.1) for a calmer pace. + MELO_SPEED: ${MELO_SPEED:-1.5} # Optional single-language lock for replies (empty = user's own language). OUTPUT_LANGUAGE: ${OUTPUT_LANGUAGE:-ko} # Drop the pre-loop planner LLM call to cut voice-reply latency on small diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 9b49315..c512e1f 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -61,10 +61,13 @@ directory=/app ; HF_HUB_OFFLINE/TRANSFORMERS_OFFLINE force pure-cache reads: the pinned old ; transformers/huggingface_hub otherwise retry the network on every load and ; error out instead of falling back to the (complete) baked cache. -; MELO_DEVICE inherits from the container env (compose sets it; default cuda) -; so the worker runs MeloTTS on the GPU. supervisord interpolates %(ENV_x)s -; from its own environment, which is the container's. -environment=MELO_LANGUAGE="KR",MELO_SPEED="1.5",MELO_DEVICE="%(ENV_MELO_DEVICE)s",MELO_WORKER_HOST="127.0.0.1",MELO_WORKER_PORT="8770",HF_HOME="/opt/melo-cache",HF_HUB_OFFLINE="1",TRANSFORMERS_OFFLINE="1" +; MELO_DEVICE and MELO_SPEED inherit from the container env (compose sets both +; with defaults: cuda / 1.5) so the worker runs MeloTTS on the GPU at the +; configured rate. supervisord interpolates %(ENV_x)s from its own environment, +; which is the container's — so MELO_SPEED must always be set in the env +; (compose guarantees it) or this expansion fails at startup. Hardcoding 1.5 +; here previously shadowed the .env value, so lowering MELO_SPEED had no effect. +environment=MELO_LANGUAGE="KR",MELO_SPEED="%(ENV_MELO_SPEED)s",MELO_DEVICE="%(ENV_MELO_DEVICE)s",MELO_WORKER_HOST="127.0.0.1",MELO_WORKER_PORT="8770",HF_HOME="/opt/melo-cache",HF_HUB_OFFLINE="1",TRANSFORMERS_OFFLINE="1" priority=280 autorestart=true stdout_logfile=/dev/stdout