coding / Dockerfile
yash184's picture
Update Dockerfile
21f0309 verified
Raw History Blame Contribute Delete
1.1 kB
FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
git ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH" \
HF_HOME=/home/user/.cache/huggingface \
PYTHONUNBUFFERED=1
WORKDIR /home/user/app
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
# Hindi config ko "append_terminal_punctuation: false" chahiye, isliye GitHub ka latest pocket-tts
RUN pip install --no-cache-dir "git+https://github.com/kyutai-labs/pocket-tts.git" \
fastapi "uvicorn[standard]" numpy huggingface_hub
# config.yaml local folder me, weights aur tokenizer HF cache me (build time par hi download)
RUN python -c "from huggingface_hub import hf_hub_download as d; r='saryps-labs/pocket-tts-hindi'; d(r,'config.yaml',local_dir='/home/user/hindi_model'); d(r,'model.safetensors'); d(r,'tokenizer.model')" || true
COPY --chown=user . /home/user/app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]