Spaces:
Sleeping
Sleeping
Download Dockerfile from rizzdeep/phi3-ds-expert: direct link, hf CLI and curl.
- Browser
- Download file 917 Bytes
-
https://huggingface.co/spaces/rizzdeep/phi3-ds-expert/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/rizzdeep/phi3-ds-expert/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/rizzdeep/phi3-ds-expert/resolve/main/Dockerfile
917 Bytes
| FROM python:3.11-slim | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN pip install --no-cache-dir huggingface_hub | |
| # Set cache directory | |
| ENV HF_HOME=/data/hf_cache | |
| # Create offload directory with correct permissions | |
| RUN mkdir -p /data/model_offload && chmod -R 777 /data/model_offload | |
| # Create cache directory with writable permissions for runtime | |
| RUN mkdir -p /data/hf_cache/hub/models--microsoft--Phi-3-mini-4k-instruct/blobs && chmod -R 777 /data/hf_cache | |
| # Pre-download base model to cache | |
| RUN python -c "from huggingface_hub import snapshot_download; \ | |
| snapshot_download(repo_id='microsoft/Phi-3-mini-4k-instruct', local_dir='/data/hf_cache/models--microsoft--Phi-3-mini-4k-instruct')" | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host=0.0.0.0", "--port=7860"] | |