File size: 1,412 Bytes
260c01a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77aaed3
 
260c01a
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
COPY --chown=user install.sh .
RUN bash install.sh

USER user
COPY --chown=user . $HOME/kosmos-g

CMD ["bash", "run.sh"]