From 1fc2f9c90944c6365940d3e2f92c871e589caa82 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Sat, 30 May 2026 14:40:23 +0200 Subject: [PATCH] fix: add --max-seq-len to patch and remove || true from Dockerfile The upstream openai_server.py gained --max-seq-len after v5 was built. Add it to the patch so every build gets explicit sequence length control. Also add max_seq_len=args.max_seq_len to FasterQwen3TTS.from_pretrained() so the argument is actually used. Remove || true from git apply so patch failures fail the build instead of silently producing a broken image. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 2 +- patches/openai_server.patch | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d80bb0b..47e3521 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN git clone --depth 1 --branch ${FASTER_QWEN3_TTS_REF} \ # Apply DGX Spark patches (non_streaming_mode=True, per-voice temperature/top_k/top_p) COPY patches/openai_server.patch /tmp/ -RUN cd /app && git apply /tmp/openai_server.patch || true +RUN cd /app && git apply /tmp/openai_server.patch # Create virtual environment (Ubuntu 24.04 enforces PEP 668) ENV VIRTUAL_ENV=/opt/venv diff --git a/patches/openai_server.patch b/patches/openai_server.patch index 3841df3..2923672 100644 --- a/patches/openai_server.patch +++ b/patches/openai_server.patch @@ -23,5 +23,19 @@ index 61047ea..2b0c8bb 100644 + top_k=voice_cfg.get("top_k", 50), + top_p=voice_cfg.get("top_p", 0.9), ) - + audio_arrays, sr = await loop.run_in_executor(None, _generate) +@@ -306,4 +309,5 @@ def _parse_args(): + p.add_argument("--host", default="0.0.0.0", help="Bind host (default: 0.0.0.0)") + p.add_argument("--port", type=int, default=8000, help="Bind port (default: 8000)") + p.add_argument("--device", default="cuda", help="Torch device (default: cuda)") ++ p.add_argument("--max-seq-len", type=int, default=4096, help="Max sequence length for CUDA graph static cache (default: 4096)") + return p.parse_args() +@@ -341,6 +349,7 @@ def main(): + logger.info("Loading model %s on %s …", args.model, args.device) + tts_model = FasterQwen3TTS.from_pretrained( + args.model, + device=args.device, + dtype=torch.bfloat16, ++ max_seq_len=args.max_seq_len, + )