Spaces:
Sleeping
Sleeping
Download Dockerfile from 101Frost/MobileCLIP: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/101Frost/MobileCLIP/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/101Frost/MobileCLIP/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/101Frost/MobileCLIP/resolve/main/Dockerfile
1.01 kB
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Fix for numpy and torch compatibility | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| build-essential \ | |
| libopenblas-dev \ | |
| liblapack-dev \ | |
| libffi-dev \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create cache dirs | |
| RUN mkdir -p /app/.cache && chmod 777 /app/.cache | |
| RUN mkdir -p /app/.cache/torch && chmod 777 /app/.cache/torch | |
| RUN mkdir -p /app/.cache/transformers && chmod 777 /app/.cache/transformers | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN git clone https://github.com/apple/ml-mobileclip.git && \ | |
| cd ml-mobileclip && \ | |
| pip install -e . --no-deps && \ | |
| cd .. && \ | |
| rm -rf ml-mobileclip/.git | |
| COPY app.py . | |
| EXPOSE 7860 | |
| ENV PYTHONPATH=/app | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV HF_HOME=/app/.cache | |
| ENV TORCH_HOME=/app/.cache/torch | |
| ENV TRANSFORMERS_CACHE=/app/.cache/transformers | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |