FROM python:3.11-slim WORKDIR /app # System deps for audio decoding RUN apt-get update && apt-get install -y --no-install-recommends \ libsndfile1 ffmpeg git \ && rm -rf /var/lib/apt/lists/* # Python deps — CPU-only torch (smaller image, faster build) RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir 'datasets<4' librosa soundfile huggingface_hub # Copy project COPY src/ src/ COPY app.py . COPY recipes.yaml . # Cache 1750h recipe and upload to HF Dataset repo # HF_TOKEN must be set as a Space secret for upload CMD ["python", "-u", "app.py", "cache", \ "--recipe", "1750h", \ "--cache-dir", "mel_cache", \ "--repo", "tisaconundrum/grassmann-mel-cache"]