# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker # you will also find guides on how best to write your Dockerfile FROM python:3.12-slim # Install system dependencies for torch and audio RUN apt-get update && apt-get install -y \ ffmpeg \ git \ git-lfs \ && rm -rf /var/lib/apt/lists/* # --- Settings you can override in the Space "Build arguments" --- ARG REPO_URL="https://github.com/Alimjoo/VibeVoice.git" ARG REPO_REF="main" # or a tag/commit for reproducibility # Clone the source into /app RUN git clone --depth 1 --branch "${REPO_REF}" "${REPO_URL}" /app RUN git lfs install RUN pip install transformers RUN --mount=type=secret,id=HF_TOKEN,required=false bash -lc '\ set -euo pipefail; \ if [ -f /run/secrets/HF_TOKEN ]; then export HF_TOKEN="$(cat /run/secrets/HF_TOKEN)"; fi; \ mkdir -p /app/VV_CV_Unique_Ug; \ hf download "piyazon/VV_CV_Unique_Ug" --repo-type model --local-dir /app/VV_CV_Unique_Ug \ ' RUN --mount=type=secret,id=HF_TOKEN,required=false bash -lc '\ set -euo pipefail; \ if [ -f /run/secrets/HF_TOKEN ]; then export HF_TOKEN="$(cat /run/secrets/HF_TOKEN)"; fi; \ mkdir -p /app/VV_Radio_RVC_ALI_Ug; \ hf download "piyazon/VV_Radio_RVC_ALI_Ug" --repo-type model --local-dir /app/VV_Radio_RVC_ALI_Ug \ ' WORKDIR /app # Editable install RUN pip install --no-cache-dir -e . RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt COPY --chown=user . /app CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]