master
parent
0f5c41259b
commit
5f21ed8fc4
18
Dockerfile
18
Dockerfile
|
@ -1,30 +1,29 @@
|
|||
FROM ubuntu:22.04 AS build
|
||||
FROM ubuntu:22.04 AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
wget \
|
||||
cmake \
|
||||
make \
|
||||
g++ \
|
||||
python3 \
|
||||
python3-pip \
|
||||
ffmpeg \
|
||||
wget \
|
||||
libavcodec-dev \
|
||||
libavformat-dev \
|
||||
libavutil-dev \
|
||||
libswresample-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Clone whisper.cpp
|
||||
# Clone and build whisper.cpp
|
||||
RUN git clone https://github.com/ggerganov/whisper.cpp.git /whisper.cpp
|
||||
WORKDIR /whisper.cpp
|
||||
|
||||
# Build whisper.cpp
|
||||
RUN make
|
||||
|
||||
# Download a model (base.en in this example)
|
||||
RUN ./models/download-ggml-model.sh base.en
|
||||
# Download model
|
||||
RUN mkdir -p models && \
|
||||
wget https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin -O models/ggml-base.en.bin
|
||||
|
||||
FROM ubuntu:22.04 AS runtime
|
||||
|
||||
|
@ -39,8 +38,9 @@ RUN apt-get update && apt-get install -y \
|
|||
libswresample-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy built whisper.cpp and model
|
||||
COPY --from=build /whisper.cpp /whisper.cpp
|
||||
# Copy only necessary files from builder
|
||||
COPY --from=builder /whisper.cpp/main /whisper.cpp/main
|
||||
COPY --from=builder /whisper.cpp/models /whisper.cpp/models
|
||||
WORKDIR /whisper.cpp
|
||||
|
||||
# Install Python dependencies
|
||||
|
|
Loading…
Reference in New Issue