Spaces:
Paused
Paused
Download Dockerfile from Fandresenar6/stem-separator: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/Fandresenar6/stem-separator/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Fandresenar6/stem-separator/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Fandresenar6/stem-separator/resolve/main/Dockerfile
1.05 kB
| FROM python:3.11-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Torch CPU uniquement : évite ~2 Go de dépendances CUDA inutiles sur un Space CPU. | |
| RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \ | |
| torch==2.3.1 torchaudio==2.3.1 | |
| COPY requirements.txt /tmp/requirements.txt | |
| RUN pip install --no-cache-dir -r /tmp/requirements.txt | |
| # Les Spaces tournent avec l'utilisateur 1000. | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| TORCH_HOME=/home/user/.cache/torch \ | |
| OUTPUT_DIR=/tmp/stem-outputs \ | |
| PYTHONUNBUFFERED=1 | |
| WORKDIR /home/user/app | |
| # Poids du modèle intégrés à l'image : rien à télécharger au démarrage. | |
| ARG DEMUCS_MODEL=htdemucs | |
| ENV DEMUCS_MODEL=${DEMUCS_MODEL} | |
| RUN python -c "from demucs.pretrained import get_model; get_model('${DEMUCS_MODEL}')" | |
| COPY --chown=user app.py . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers", "--forwarded-allow-ips", "*"] | |