Lance / Dockerfile
ffy2000's picture
Prepare Lance for Hugging Face Space
46a9d20
FROM pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_SERVER_PORT=7860 \
LANCE_AUTO_DOWNLOAD=1 \
LANCE_MODEL_BASE_DIR=/data/lance_models \
LANCE_GRADIO_TMP_ROOT=/tmp/lance_gradio
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
git \
libgl1 \
libglib2.0-0 \
libsndfile1 \
libsm6 \
libxext6 \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app/requirements.txt
RUN python -m pip install --upgrade pip setuptools wheel \
&& python -m pip install -r requirements.txt \
&& python -m pip install --no-cache-dir --no-deps --force-reinstall "https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3%2Bcu12torch2.5cxx11abiFALSE-cp311-cp311-linux_x86_64.whl"
COPY . /app
EXPOSE 7860
CMD ["python", "app.py"]