2cent-tts / Dockerfile
taylorchu's picture
chmod more
f4b2303
FROM alpine AS onnxruntime
ADD https://github.com/microsoft/onnxruntime/releases/download/v1.21.0/onnxruntime-linux-x64-1.21.0.tgz /
RUN tar -xvf /onnxruntime-linux-x64-1.21.0.tgz
FROM ghcr.io/ggml-org/llama.cpp:server-b5318
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests \
espeak-ng && \
rm -rf /var/lib/apt/lists/*
COPY --from=onnxruntime /onnxruntime-linux-x64-1.21.0/lib/libonnxruntime.so libonnxruntime.so
ENV ONNX_PATH=/app/libonnxruntime.so
ADD https://huggingface.co/onnx-community/snac_24khz-ONNX/resolve/main/onnx/decoder_model.onnx snac.onnx
ADD https://github.com/taylorchu/2cent-tts/releases/download/v0.2.0/2cent.gguf 2cent.gguf
ADD https://github.com/taylorchu/2cent-tts/releases/download/v0.2.0/tokenizer.json tokenizer.json
ADD https://github.com/taylorchu/2cent-tts/releases/download/v0.2.0/tts-http-server tts-http-server
RUN chmod 0777 tts-http-server tokenizer.json snac.onnx 2cent.gguf /app/libonnxruntime.so
ENV PATH="$PATH:/app"
# For huggingface
RUN \
apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests \
python3-pip && \
rm -rf /var/lib/apt/lists/*
# Install necessary packages for the web UI
RUN pip install gradio requests
# Copy the app file
COPY app.py app.py
# Expose the ports
EXPOSE 7860
ENV LISTEN_ADDR=:8080
# Start both the TTS server and the Gradio interface
ENTRYPOINT ["python3", "-u", "app.py"]