FROM nvcr.io/nvidia/pytorch:22.10-py3 ARG DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 RUN apt-get update && apt-get install --no-install-recommends -y \ build-essential \ git \ ffmpeg \ libsm6 libxext6 libxrender-dev \ wget \ && apt-get clean && rm -rf /var/lib/apt/lists/* WORKDIR /home/user RUN git clone https://github.com/microsoft/unilm.git . # Set up a new user named "user" with user ID 1000 RUN useradd -m -u 1000 user # Switch to the "user" user # Set home to the user's home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH \ GRADIO_ALLOW_FLAGGING=never \ GRADIO_NUM_PORTS=1 \ GRADIO_SERVER_NAME=0.0.0.0 \ GRADIO_THEME=huggingface \ SYSTEM=spaces RUN mkdir ./kosmos-g/kosmosg_checkpoints # RUN wget -q https://huggingface.co/radames/Kosmos-G/resolve/main/ViT-L-14-sd.pt -P ./kosmos-g/kosmosg_checkpoints # RUN wget -q https://huggingface.co/radames/Kosmos-G/resolve/main/checkpoint_stage1.pt -P ./kosmos-g/kosmosg_checkpoints # RUN wget -q https://huggingface.co/radames/Kosmos-G/resolve/main/checkpoint_stage1.pt -P ./kosmos-g/kosmosg_checkpoints RUN wget -q https://huggingface.co/radames/Kosmos-G/resolve/main/checkpoint_final.pt -P ./kosmos-g/kosmosg_checkpoints/ RUN chown -R user:user /home/user/ WORKDIR $HOME/kosmos-g RUN bash vl_setup.sh USER user COPY --chown=user . $HOME/kosmos-g CMD ["bash", "run.sh"]