|
|
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04 |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \ |
|
|
PIP_NO_CACHE_DIR=1 \ |
|
|
PYTHONUNBUFFERED=1 \ |
|
|
CUDA_HOME=/usr/local/cuda \ |
|
|
FORCE_CUDA=1 \ |
|
|
TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;8.9" \ |
|
|
CMAKE_BUILD_PARALLEL_LEVEL=8 \ |
|
|
|
|
|
HF_HOME=/tmp/hf \ |
|
|
HUGGINGFACE_HUB_CACHE=/tmp/hf/hub \ |
|
|
TRANSFORMERS_CACHE=/tmp/hf/transformers \ |
|
|
XDG_CACHE_HOME=/tmp/.cache \ |
|
|
MPLCONFIGDIR=/tmp/mpl \ |
|
|
|
|
|
TOKENIZERS_PARALLELISM=false \ |
|
|
OMP_NUM_THREADS=1 |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
|
python3.11 python3.11-venv python3.11-dev python3-pip \ |
|
|
git git-lfs build-essential ninja-build cmake pkg-config \ |
|
|
libgl1 libsm6 libxext6 ffmpeg \ |
|
|
libcairo2-dev libpango1.0-dev libffi-dev \ |
|
|
&& rm -rf /var/lib/apt/lists/* && git lfs install \ |
|
|
&& ln -sf /usr/bin/python3.11 /usr/bin/python \ |
|
|
&& python -m pip install -U pip wheel setuptools packaging pybind11 psutil \ |
|
|
&& mkdir -p /tmp/hf/hub /tmp/hf/transformers /tmp/.cache /tmp/mpl \ |
|
|
&& chmod -R 777 /tmp |
|
|
|
|
|
WORKDIR /app |
|
|
COPY requirements.txt /app/requirements.txt |
|
|
|
|
|
|
|
|
RUN pip install --index-url https://download.pytorch.org/whl/cu121 \ |
|
|
torch==2.5.1 torchvision==0.20.1 |
|
|
|
|
|
|
|
|
RUN pip install --no-build-isolation --no-cache-dir flash-attn==2.7.3 |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir pycairo==1.26.0 rlpycairo==0.4.0 svglib==1.6.0 |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir git+https://github.com/joanrod/star-vector.git@main |
|
|
|
|
|
|
|
|
COPY . /app |
|
|
|
|
|
ENV PORT=7860 |
|
|
EXPOSE 7860 |
|
|
CMD ["python", "app.py"] |
|
|
|