|
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu20.04 |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \ |
|
TZ=Europe/Paris |
|
|
|
RUN rm -f /etc/apt/sources.list.d/*.list && \ |
|
apt-get update && apt-get install -y --no-install-recommends \ |
|
sudo \ |
|
git \ |
|
curl \ |
|
wget \ |
|
ffmpeg libsm6 libxext6 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
WORKDIR /app |
|
|
|
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ |
|
&& chown -R user:user /app \ |
|
&& echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user |
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
CONDA_AUTO_UPDATE_CONDA=false |
|
ENV PATH=$HOME/miniconda/bin:$PATH |
|
RUN mkdir $HOME/.cache $HOME/.config \ |
|
&& chmod -R 777 $HOME \ |
|
&& curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py310_24.5.0-0-Linux-x86_64.sh \ |
|
&& chmod +x ~/miniconda.sh \ |
|
&& ~/miniconda.sh -b -p ~/miniconda \ |
|
&& rm ~/miniconda.sh \ |
|
&& conda clean -ya |
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir gdown && \ |
|
mkdir -p ./pretrained_models/GLIP/checkpoints && \ |
|
mkdir -p ./pretrained_models/GLIP/configs && \ |
|
mkdir -p ./pretrained_models/xvlm && \ |
|
wget -nc -q -P ./pretrained_models/GLIP/checkpoints https://huggingface.co/GLIPModel/GLIP/resolve/main/glip_large_model.pth && \ |
|
wget -nc -q -P ./pretrained_models/GLIP/configs https://raw.githubusercontent.com/microsoft/GLIP/main/configs/pretrain/glip_Swin_L.yaml && \ |
|
gdown "https://drive.google.com/u/0/uc?id=1bv6_pZOsXW53EhlwU0ZgSk03uzFI61pN" -O ./pretrained_models/xvlm/retrieval_mscoco_checkpoint_9.pth |
|
|
|
|
|
RUN --mount=target=requirements.txt,source=requirements.txt \ |
|
pip install --no-cache-dir torch torchvision && \ |
|
pip install --no-cache-dir git+https://github.com/openai/CLIP.git && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
RUN python -c "from transformers import AutoModel; _ = AutoModel.from_pretrained('codellama/CodeLlama-7b-Python-hf')" |
|
RUN python -c "from transformers import AutoModel; _ = AutoModel.from_pretrained('VDebugger/VDebugger-critic-generalist-7B')" |
|
RUN python -c "from transformers import AutoModel; _ = AutoModel.from_pretrained('VDebugger/VDebugger-refiner-generalist-7B')" |
|
|
|
|
|
RUN git clone https://github.com/sachit-menon/GLIP |
|
|
|
|
|
COPY --link --chown=1000 ./ /app |
|
EXPOSE 7860 |
|
ENV GRADIO_SERVER_NAME="0.0.0.0" |
|
CMD ["bash", "app.sh"] |
|
|