Download Dockerfile from UnKnownStrangeSapien/voxsplit: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/UnKnownStrangeSapien/voxsplit/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/UnKnownStrangeSapien/voxsplit/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/UnKnownStrangeSapien/voxsplit/resolve/main/Dockerfile
1.03 kB
| FROM python:3.11-slim | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| HF_HOME=/app/.cache/huggingface \ | |
| UPLOAD_DIR=/tmp/uploads \ | |
| PORT=7860 | |
| WORKDIR /app | |
| # System libs needed by soundfile / librosa for audio decoding. | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libsndfile1 ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install -r requirements.txt | |
| COPY backend ./backend | |
| COPY frontend ./frontend | |
| # Pre-download the gender model so the first request isn't slow. | |
| RUN python -c "from transformers import Wav2Vec2ForSequenceClassification, Wav2Vec2FeatureExtractor as F; M='prithivMLmods/Common-Voice-Gender-Detection'; Wav2Vec2ForSequenceClassification.from_pretrained(M); F.from_pretrained(M)" | |
| # Make caches/uploads writable for non-root hosts (e.g. HF Spaces runs as uid 1000). | |
| RUN mkdir -p /tmp/uploads "$HF_HOME" && chmod -R 777 /app/.cache /tmp/uploads | |
| EXPOSE 7860 | |
| CMD ["sh", "-c", "uvicorn backend.main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |