Spaces:
Restarting
Restarting
File size: 1,940 Bytes
cde96b8 2dd2041 35c9c3f 2dd2041 9dc5ce7 cde96b8 5b29906 cde96b8 |
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# Use an official Python runtime as a parent image
FROM python:3.10.12-slim
# Install required packages for building eSpeak and general utilities
RUN apt-get update && apt-get install -y \
build-essential \
autoconf \
automake \
libtool \
pkg-config \
git \
cmake \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# eSpeak install
RUN git clone -b dev-ca https://github.com/projecte-aina/espeak-ng
RUN pip install --upgrade pip && \
cd espeak-ng && \
./autogen.sh && \
./configure --prefix=/usr && \
make && \
make install
RUN mkdir -p cache && chmod 777 cache
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Onnx install
COPY --chown=user requirements.txt $HOME/app/
RUN pip install -r requirements.txt
# download from hf hub
RUN huggingface-cli download BSC-LT/matcha-tts-cat-multiaccent matcha_multispeaker_cat_bal_opset_15_10_steps.onnx --local-dir $HOME/app/
RUN huggingface-cli download BSC-LT/matcha-tts-cat-multiaccent matcha_multispeaker_cat_occ_opset_15_10_steps.onnx --local-dir $HOME/app/
RUN huggingface-cli download BSC-LT/matcha-tts-cat-multiaccent matcha_multispeaker_cat_val_opset_15_10_steps.onnx --local-dir $HOME/app/
RUN huggingface-cli download BSC-LT/matcha-tts-cat-multiaccent matcha_multispeaker_cat_cen_opset_15_10_steps.onnx --local-dir $HOME/app/
RUN huggingface-cli download BSC-LT/matcha-tts-cat-multiaccent config.yaml--local-dir $HOME/app/
RUN huggingface-cli download BSC-LT/vocos-mel-22khz-cat mel_spec_22khz_cat.onnx --local-dir $HOME/app/
RUN huggingface-cli download BSC-LT/vocos-mel-22khz-cat config.yaml --local-dir $HOME/app/
COPY --chown=user . $HOME/app/
# Fix ownership issues
USER root
RUN chown -R user:user $HOME/app
USER user
EXPOSE 7860
CMD ["python3", "-u", "infer_onnx.py"]
|