Download Dockerfile from nexusbert/Heart: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/spaces/nexusbert/Heart/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/nexusbert/Heart/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/nexusbert/Heart/resolve/main/Dockerfile
1.22 kB
| FROM python:3.11-slim | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 | |
| WORKDIR /code | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| git \ | |
| curl \ | |
| libopenblas-dev \ | |
| libomp-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Fix for TabFM: Install from source to avoid PyPI weights compatibility issues | |
| RUN git clone https://github.com/google-research/tabfm.git /tmp/tabfm && \ | |
| cd /tmp/tabfm && \ | |
| pip install .[pytorch] && \ | |
| rm -rf /tmp/tabfm | |
| RUN pip install --no-cache-dir huggingface-hub sentencepiece accelerate fasttext | |
| ENV HF_HOME=/models/huggingface \ | |
| TRANSFORMERS_CACHE=/models/huggingface \ | |
| HUGGINGFACE_HUB_CACHE=/models/huggingface \ | |
| HF_HUB_CACHE=/models/huggingface \ | |
| TRITON_CACHE_DIR=/tmp/.triton | |
| RUN mkdir -p /models/huggingface && chmod -R 777 /models/huggingface | |
| COPY . . | |
| RUN python download_models.py | |
| EXPOSE 7860 | |
| ENV OMP_NUM_THREADS=4 \ | |
| MKL_NUM_THREADS=4 \ | |
| NUMEXPR_NUM_THREADS=4 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--timeout-keep-alive", "30"] | |