xVASynth-TTS / Dockerfile
Pendrokar's picture
torchmoji model pointer to file
5c24e0a verified
FROM python:3.9
# Pre-install numpy
RUN --mount=target=/tmp/pre-requirements.txt,source=pre-requirements.txt \
pip install --no-cache-dir -r /tmp/pre-requirements.txt
# numpy #RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt pip install --no-cache-dir -r pre-requirements.txt
RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
RUN pip install --no-cache-dir gradio[oauth]==4.18.0 "uvicorn>=0.14.0" spaces
RUN useradd -m -u 1000 user
#RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install
# Install everything else, but handle pkuseg specially
RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
pip install --no-cache-dir -r /tmp/requirements.txt && \
pip install --no-build-isolation "pkuseg==0.0.25"
#COPY --link --chown=1000 --from=lfs /app /home/user/app
WORKDIR /home/user/app
RUN --mount=target=/root/packages.txt,source=packages.txt apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
RUN pip freeze > /tmp/freeze.txt
COPY --link --chown=1000 ./ /home/user/app
#COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt .
#RUN huggingface-cli download Pendrokar/TorchMoji --local-dir /root/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07
# && wget -O /vocabulary.json https://raw.githubusercontent.com/.../vocabulary.json
RUN mkdir -p /home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07/
RUN wget -O /home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07/vocabulary.json https://huggingface.co/Pendrokar/TorchMoji/raw/main/vocabulary.json
RUN wget -O /home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07/config.json https://huggingface.co/Pendrokar/TorchMoji/raw/main/config.json
RUN wget -O /home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07/tokenizer.json https://huggingface.co/Pendrokar/TorchMoji/raw/main/tokenizer.json
RUN wget -O /home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07/tokenizer_config.json https://huggingface.co/Pendrokar/TorchMoji/raw/main/tokenizer_config.json
# torchmoji model
RUN wget -O /home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/d438a69fc2948598f8ca851fbe5659d9348f6b07/pytorch_model.bin \
https://huggingface.co/Pendrokar/TorchMoji/resolve/main/pytorch_model.bin
CMD ["python", "app.py"]