File size: 1,442 Bytes
89b236a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f4b2303
89b236a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a6e2c41
89b236a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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"]