File size: 1,103 Bytes
eb21fb1 502938b 21f0309 502938b eb21fb1 502938b eb21fb1 502938b 21f0309 e081d43 21f0309 502938b eb21fb1 e081d43 eb21fb1 | 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 | 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"] |