Skip to content

Commit 4ff2003

Browse files
committed
chore: update demo Dockerfile
1 parent a77a282 commit 4ff2003

File tree

2 files changed

+99
-1
lines changed

2 files changed

+99
-1
lines changed

Dockerfile.demo

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

5-
# Demo image: CPU-only with Helsinki translation, all core plugins, and sample pipelines
5+
# Demo image: CPU-only with all core plugins (including Pocket TTS and Supertonic) and sample pipelines
66
# syntax=docker/dockerfile:1
77

88
# Version configuration
@@ -441,6 +441,86 @@ RUN PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install --no-cache-dir \
441441
tokenizers && \
442442
python3 plugins/native/helsinki/download-models.py
443443

444+
# Stage 11: Build Pocket TTS plugin
445+
FROM rust:1.92-slim-bookworm AS pocket-tts-builder
446+
447+
WORKDIR /build
448+
449+
# Install build dependencies
450+
RUN apt-get update && apt-get install -y \
451+
pkg-config \
452+
libssl-dev \
453+
g++ \
454+
cmake \
455+
curl \
456+
libclang-dev \
457+
clang \
458+
git \
459+
&& rm -rf /var/lib/apt/lists/*
460+
461+
# Copy only what's needed to build pocket-tts plugin
462+
COPY Cargo.toml Cargo.lock ./
463+
COPY crates/core ./crates/core
464+
COPY sdks/plugin-sdk ./sdks/plugin-sdk
465+
COPY plugins/native/pocket-tts ./plugins/native/pocket-tts
466+
467+
# Build pocket-tts plugin
468+
RUN --mount=type=cache,id=cargo-registry-pocket-tts,target=/usr/local/cargo/registry \
469+
--mount=type=cache,id=cargo-git-pocket-tts,target=/usr/local/cargo/git \
470+
--mount=type=cache,id=pocket-tts-target,target=/build/plugins/native/pocket-tts/target \
471+
cd plugins/native/pocket-tts && \
472+
cargo build --release --target-dir target && \
473+
mkdir -p /build/plugins/native && \
474+
cp target/release/libpocket_tts.so /build/plugins/native/
475+
476+
# Download Pocket TTS models
477+
RUN mkdir -p /build/models && \
478+
cd /build/models && \
479+
curl -L -o pocket-tts-b6369a24.tar.bz2 \
480+
https://huggingface.co/streamkit/pocket-tts-models/resolve/main/pocket-tts-b6369a24.tar.bz2 && \
481+
tar xf pocket-tts-b6369a24.tar.bz2 && \
482+
rm pocket-tts-b6369a24.tar.bz2
483+
484+
# Stage 12: Build Supertonic TTS plugin
485+
FROM rust:1.92-slim-bookworm AS supertonic-builder
486+
487+
WORKDIR /build
488+
489+
# Install build dependencies
490+
RUN apt-get update && apt-get install -y \
491+
pkg-config \
492+
libssl-dev \
493+
g++ \
494+
cmake \
495+
curl \
496+
libclang-dev \
497+
clang \
498+
git \
499+
&& rm -rf /var/lib/apt/lists/*
500+
501+
# Copy only what's needed to build supertonic plugin
502+
COPY Cargo.toml Cargo.lock ./
503+
COPY crates/core ./crates/core
504+
COPY sdks/plugin-sdk ./sdks/plugin-sdk
505+
COPY plugins/native/supertonic ./plugins/native/supertonic
506+
507+
# Build supertonic plugin
508+
RUN --mount=type=cache,id=cargo-registry-supertonic,target=/usr/local/cargo/registry \
509+
--mount=type=cache,id=cargo-git-supertonic,target=/usr/local/cargo/git \
510+
--mount=type=cache,id=supertonic-target,target=/build/plugins/native/supertonic/target \
511+
cd plugins/native/supertonic && \
512+
cargo build --release --target-dir target && \
513+
mkdir -p /build/plugins/native && \
514+
cp target/release/libsupertonic.so /build/plugins/native/
515+
516+
# Download Supertonic models
517+
RUN mkdir -p /build/models && \
518+
cd /build/models && \
519+
curl -L -o supertonic-v2-onnx.tar.bz2 \
520+
https://huggingface.co/streamkit/supertonic-models/resolve/main/supertonic-v2-onnx.tar.bz2 && \
521+
tar xf supertonic-v2-onnx.tar.bz2 && \
522+
rm supertonic-v2-onnx.tar.bz2
523+
444524
# Runtime stage
445525
FROM debian:bookworm-slim
446526

@@ -494,6 +574,14 @@ COPY --from=vad-builder /build/models/ten-vad.onnx /opt/streamkit/models/ten-vad
494574
COPY --from=matcha-builder /build/plugins/native/* /opt/streamkit/plugins/native/
495575
COPY --from=matcha-builder /build/models/matcha-icefall-en_US-ljspeech /opt/streamkit/models/matcha-icefall-en_US-ljspeech
496576

577+
# Copy pocket-tts plugin and models
578+
COPY --from=pocket-tts-builder /build/plugins/native/* /opt/streamkit/plugins/native/
579+
COPY --from=pocket-tts-builder /build/models/pocket-tts /opt/streamkit/models/pocket-tts
580+
581+
# Copy supertonic plugin and models
582+
COPY --from=supertonic-builder /build/plugins/native/* /opt/streamkit/plugins/native/
583+
COPY --from=supertonic-builder /build/models/supertonic-v2-onnx /opt/streamkit/models/supertonic-v2-onnx
584+
497585
# Copy sample pipelines + small bundled audio samples (Opus/Ogg only)
498586
COPY --chown=app:app samples/pipelines /opt/streamkit/samples/pipelines
499587
COPY --chown=app:app samples/audio/system/*.ogg samples/audio/system/*.ogg.license /opt/streamkit/samples/audio/system/

docker-skit-demo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ params = { model_dir = "models/matcha-icefall-en_US-ljspeech", speaker_id = 0, s
9393
kind = "plugin::native::sensevoice"
9494
params = { model_dir = "models/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-int8-2025-09-09", language = "auto", num_threads = 4, execution_provider = "cpu", use_vad = true, vad_model_path = "models/silero_vad.onnx" }
9595

96+
# Pocket TTS
97+
[[resources.prewarm.plugins]]
98+
kind = "plugin::native::pocket-tts"
99+
params = { weights_path = "models/pocket-tts/tts_b6369a24.safetensors", tokenizer_path = "models/pocket-tts/tokenizer.model", voice_embeddings_dir = "models/pocket-tts/embeddings", voice = "alba", temperature = 0.7 }
100+
101+
# Supertonic TTS
102+
[[resources.prewarm.plugins]]
103+
kind = "plugin::native::supertonic"
104+
params = { model_dir = "models/supertonic-v2-onnx", lang = "en", voice_style = "M1", total_step = 5, speed = 1.05 }
105+
96106
# Script node configuration for OpenAI/weather pipelines
97107
[script]
98108

0 commit comments

Comments
 (0)