dmitriitochilkin commited on
Commit
38bbc60
1 Parent(s): db20d3e

switch to docker

Browse files
Files changed (4) hide show
  1. Dockerfile +61 -0
  2. README.md +3 -3
  3. pre-requirements.txt +0 -1
  4. requirements.txt +1 -0
Dockerfile ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.8.0-devel-ubuntu20.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6"
8
+ ENV TCNN_CUDA_ARCHITECTURES=86;80;75;70;61;60
9
+ ENV FORCE_CUDA=1
10
+
11
+ ENV CUDA_HOME=/usr/local/cuda
12
+ ENV PATH=${CUDA_HOME}/bin:/home/${USER_NAME}/.local/bin:${PATH}
13
+ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
14
+ ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
15
+
16
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
17
+ build-essential \
18
+ curl \
19
+ git \
20
+ libegl1-mesa-dev \
21
+ libgl1-mesa-dev \
22
+ libgles2-mesa-dev \
23
+ libglib2.0-0 \
24
+ libsm6 \
25
+ libxext6 \
26
+ libxrender1 \
27
+ python-is-python3 \
28
+ python3-dev \
29
+ python3-pip \
30
+ wget \
31
+ && rm -rf /var/lib/apt/lists/*
32
+
33
+ # Set up a new user named "user" with user ID 1000
34
+ RUN useradd -m -u 1000 user
35
+ # Switch to the "user" user
36
+ USER user
37
+ # Set home to the user's home directory
38
+ ENV HOME=/home/user \
39
+ PATH=/home/user/.local/bin:$PATH \
40
+ PYTHONPATH=$HOME/app \
41
+ PYTHONUNBUFFERED=1 \
42
+ GRADIO_ALLOW_FLAGGING=never \
43
+ GRADIO_NUM_PORTS=1 \
44
+ GRADIO_SERVER_NAME=0.0.0.0 \
45
+ GRADIO_THEME=huggingface \
46
+ SYSTEM=spaces
47
+
48
+ RUN pip install --upgrade pip setuptools ninja
49
+ RUN pip install torch==2.2.1 --extra-index-url https://download.pytorch.org/whl/cu118
50
+
51
+ RUN python -c "import torch; print(torch.version.cuda)"
52
+ COPY requirements.txt /tmp
53
+ RUN cd /tmp && pip install -r requirements.txt
54
+
55
+ # Set the working directory to the user's home directory
56
+ WORKDIR $HOME/app
57
+
58
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
59
+ COPY --chown=user . $HOME/app
60
+
61
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  title: TripoSR
3
- emoji: 🏃
4
  colorFrom: gray
5
  colorTo: red
6
- sdk: gradio
7
- sdk_version: 4.19.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
1
  ---
2
  title: TripoSR
3
+ emoji: 🐳
4
  colorFrom: gray
5
  colorTo: red
6
+ sdk: docker
7
+ # sdk_version: 4.19.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
pre-requirements.txt DELETED
@@ -1 +0,0 @@
1
- torch==2.1.2
 
 
requirements.txt CHANGED
@@ -6,3 +6,4 @@ transformers==4.35.0
6
  trimesh==4.0.5
7
  rembg
8
  huggingface-hub
 
 
6
  trimesh==4.0.5
7
  rembg
8
  huggingface-hub
9
+ gradio