|
|
|
|
|
|
|
FROM hircoir/piper-exporter:latest |
|
RUN useradd -m -u 1000 app |
|
RUN ls |
|
|
|
|
|
|
|
|
|
ENV TOKEN=aGZfaXhscFBXd1lCT0NRa3lMWFlEeFZkUHlidllPTGt5UmtTVg== |
|
|
|
ENV REPO_ID=HirCoir/piper-laura-neuronal |
|
|
|
ENV MODELNAME=es_MX_laura-high |
|
|
|
USER root |
|
WORKDIR /root/piper/src/python |
|
COPY download-model.py . |
|
COPY upload-onnx.py . |
|
COPY upload-onnx.py . |
|
COPY server.py /home/app/ |
|
RUN python3 download-model.py |
|
RUN python3 -m piper_train.export_onnx model.ckpt ${MODELNAME}.onnx |
|
RUN rm -f model.ckpt |
|
RUN python3 upload-onnx.py |
|
RUN mv ${MODELNAME}.onnx /home/app/${MODELNAME}.onnx |
|
RUN mv ${MODELNAME}.onnx.json /home/app/${MODELNAME}.onnx.json |
|
|
|
RUN apt install -y wget curl |
|
|
|
ENV DOWNLOAD_URL_BASE=https://github.com/rhasspy/piper/releases/download/2023.11.14-2/ |
|
WORKDIR /home/app |
|
|
|
|
|
RUN dpkgArch="$(dpkg --print-architecture)" && \ |
|
case "${dpkgArch##*-}" in \ |
|
amd64) DOWNLOAD_URL=${DOWNLOAD_URL_BASE}piper_linux_x86_64.tar.gz ;; \ |
|
armhf) DOWNLOAD_URL=${DOWNLOAD_URL_BASE}piper_linux_armv7l.tar.gz ;; \ |
|
arm64) DOWNLOAD_URL=${DOWNLOAD_URL_BASE}piper_linux_aarch64.tar.gz ;; \ |
|
*) echo "Unsupported architecture: ${dpkgArch}"; exit 1 ;; \ |
|
esac && \ |
|
curl -SL ${DOWNLOAD_URL} | tar -xzC ./ && \ |
|
mv piper piper_temp && \ |
|
mv piper_temp/* . && \ |
|
rm -rf piper_temp piper_*.tar.gz |
|
|
|
RUN pip install flask |
|
COPY index.html templates/index.html |
|
COPY app.py app.py |
|
RUN mkdir temp_audio |
|
USER app |
|
CMD python3 app.py |