Files
meetrec/server/whisper-server/Dockerfile
T
fegger 76611af7e0 M3d: speaker labels via tinydiarize two-pass merge
- whisper-server stack: second container (port 8086) running the
  English-trained small.en-tdrz model with -tdrz; image patched
  (speaker-turn.patch) to expose speaker_turn_next per segment in
  verbose_json like the cli example does
- core/whisper Diarization: merges the tdrz pass's TURN TIMES onto the
  quality transcript as alternating 'Sprecher 1/2:' labels, splitting
  segments when a turn falls inside them; no turns detected = no
  labels (never mislabels); 6 unit tests
- RemoteWhisperEngine gains a diarize flag (sends tinydiarize=true,
  parses speaker_turn_next); WhisperEngine.Segment carries the flag
- RecorderService: optional second pass on the diarize server after the
  final pass; failures keep the unlabeled transcript
- Settings: Diarize server URL (persisted; empty disables)
- validated infrastructure locally: patched image builds, tdrz model
  downloads from akashmjn/tinydiarize-whisper.cpp, speaker_turn_next
  present in responses; synthetic espeak audio does not trigger the
  model's turn tokens — real two-person speech needed for the
  end-to-end check
2026-09-08 17:07:31 +02:00

47 lines
1.8 KiB
Docker

# whisper.cpp inference server for meetrec.
#
# Built from the same pinned whisper.cpp release (v1.9.3) as the Android
# app's JNI layer, compiled statically WITH the Vulkan GPU backend for
# AMD GPUs (Radeon AI PRO R9700 / RDNA, also NVIDIA/Intel). Without a GPU
# present it transparently falls back to CPU.
#
# Note: ggml builds with -march=native by default, so build the image ON
# the machine that will run it (docker compose build on the server).
FROM debian:12-slim AS build
RUN apt-get update && apt-get install -y --no-install-recommends \
git cmake build-essential ca-certificates curl \
libvulkan-dev glslang-tools \
&& rm -rf /var/lib/apt/lists/*
ARG WHISPER_TAG=v1.9.3
RUN git clone --depth 1 --branch ${WHISPER_TAG} \
https://github.com/ggml-org/whisper.cpp /src
# expose tinydiarize speaker_turn_next in verbose_json (see patch header)
COPY speaker-turn.patch /src/
RUN git -C /src apply speaker-turn.patch
RUN cmake -S /src -B /src/build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DWHISPER_BUILD_EXAMPLES=ON \
-DWHISPER_BUILD_TESTS=OFF \
-DWHISPER_BUILD_SERVER=ON \
-DWHISPER_VULKAN=ON \
&& cmake --build /src/build --target whisper-server -j"$(nproc)"
FROM debian:12-slim
# libvulkan1 + mesa-vulkan-drivers: the AMD RADV Vulkan driver used by
# the R9700. GPU access is granted via /dev/dri in docker-compose.yml.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 ca-certificates curl libvulkan1 mesa-vulkan-drivers \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /src/build/bin/whisper-server /usr/local/bin/whisper-server
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
EXPOSE 8085
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]