From 3cd129134cbb46b99453ad0ff6dd20cf99ef1c22 Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Thu, 19 Sep 2024 14:45:37 -0400 Subject: [PATCH] Download model outside container build --- examples/whisper/Dockerfile | 2 -- examples/whisper/cmd.sh | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/whisper/Dockerfile b/examples/whisper/Dockerfile index bca4693..6fa53db 100644 --- a/examples/whisper/Dockerfile +++ b/examples/whisper/Dockerfile @@ -3,8 +3,6 @@ ARG DOCKER_REPOSITORY=local FROM ${DOCKER_REPOSITORY}/scyllaridae:${TAG} AS scyllaridae FROM ghcr.io/ggerganov/whisper.cpp:main-cuda -RUN bash ./models/download-ggml-model.sh base.en - COPY --from=scyllaridae /app /app COPY scyllaridae.yml /app COPY cmd.sh /app diff --git a/examples/whisper/cmd.sh b/examples/whisper/cmd.sh index c458c34..219673c 100755 --- a/examples/whisper/cmd.sh +++ b/examples/whisper/cmd.sh @@ -4,12 +4,16 @@ set -eou pipefail +if [ ! -f /app/models/ggml-medium.en.bin ]; then + bash ./models/download-ggml-model.sh medium.en +fi + input_temp=$(mktemp /tmp/whisper-input-XXXXXX) cat > "$input_temp" /app/main \ - -m /app/models/ggml-base.en.bin \ + -m /app/models/ggml-medium.en.bin \ --output-vtt \ -f "$input_temp" \ --output-file "$input_temp" > /dev/null 2>&1