# DubLab — Hugging Face Spaces (Docker SDK) # Secrets (Space Settings -> Variables and secrets): # GEMINI_API_KEY (required) — translation + Gemini TTS fallback # GEMINI_TTS_API_KEYS (optional) — comma-separated rotation keys # DUBLAB_ADMIN_KEY (optional) — password for /admin reviews page FROM python:3.12-slim # ffmpeg: DubLab shells out to it for audio extract/mux RUN apt-get update \ && apt-get install -y --no-install-recommends ffmpeg \ && rm -rf /var/lib/apt/lists/* WORKDIR /srv/dublab COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Nara Mini voices, Shoon + Ko Banyar only (~365 MB), from the public # model repo YeeNyunn/nara-mini-v1 — same source Spain uses. RUN python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='YeeNyunn/nara-mini-v1', local_dir='nara-mini', allow_patterns=['config.json', 'frontend/*', 'onnx/shoon/*', 'onnx/ko-banyar/*'])" COPY app.py dub.py gemini.py gemini_tts.py luna.py nara_tts.py transliterate.py nllb_translate.py alerts.py edge_probe.py ./ COPY templates/ templates/ COPY static/ static/ # No OpenCode agent on HF, so Luna translation is skipped (Gemini direct). # NLLB is intentionally NOT bundled (613 MB model) — if Gemini fails the # job reports the Gemini error instead of silently degrading. ENV DUBLAB_NO_LUNA=1 NARA_THREADS=2 EXPOSE 7860 CMD ["waitress-serve", "--listen=0.0.0.0:7860", "--threads=8", "app:app"]