Update Dockerfile
Browse files12345678910111213144 unmodified lines1920212223242526FROM python:3.10-slim# BasicsRUN apt-get update && apt-get install -y --no-install-recommends \curl ca-certificates libsndfile1 \&& rm -rf /var/lib/apt/lists/*WORKDIR /code# Install CPU-only torch FIRST from the CPU index to avoid CUDA deps# Pin a stable CPU build that plays nicely with Transformers 4.46.xRUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \torch==2.3.14 unmodified lines# AppCOPY app.py .# Space variables (optional but nice for absolute URLs)ENV SPACE_HOST=${SPACE_ID}.hf.space# RunCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]1234567891011121314151617181920214 unmodified lines2627282930313233FROM python:3.10-slim# System depsRUN apt-get update && apt-get install -y --no-install-recommends \curl ca-certificates libsndfile1 \&& rm -rf /var/lib/apt/lists/*WORKDIR /code# Make writable caches (Spaces persists /data)ENV TRANSFORMERS_CACHE=/data/transformers \HF_HOME=/data/huggingface \HUGGINGFACE_HUB_CACHE=/data/hfhub \PYTHONUNBUFFERED=1RUN mkdir -p /data/transformers /data/huggingface /data/hfhub# Install CPU-only torch FIRST to avoid pulling CUDA blobsRUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu \torch==2.3.14 unmodified lines# AppCOPY app.py .# If you want fully-qualified URLs back, expose your space host like this:# (HF sets SPACE_ID automatically; this builds a FQDN inside the app)ENV SPACE_HOST=${SPACE_ID}.hf.spaceCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+12-5