lolout1 commited on
Commit
7a2ef79
·
1 Parent(s): a626343

requirements.txt changes

Browse files
Files changed (2) hide show
  1. Dockerfile +19 -53
  2. requirements.txt +0 -5
Dockerfile CHANGED
@@ -1,61 +1,27 @@
1
- FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04
2
- CMD nvidia-smi
3
 
4
- ENV DEBIAN_FRONTEND noninteractive
5
- RUN apt-get update && apt-get install -y \
6
- git \
7
- make build-essential libssl-dev zlib1g-dev \
8
- libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
9
- libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
10
- ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- RUN useradd -ms /bin/bash user
14
- USER user
15
 
16
- ENV HOME=/home/user \
17
- PATH=/home/user/.local/bin:$PATH
 
 
 
18
 
19
- RUN curl https://pyenv.run | bash
20
- ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
21
- RUN pyenv install 3.8.15 && \
22
- pyenv global 3.8.15 && \
23
- pyenv rehash && \
24
- pip install --no-cache-dir --upgrade pip setuptools wheel
25
 
26
- ENV WORKDIR=/code
27
- WORKDIR $WORKDIR
28
- RUN chown -R user:user $WORKDIR
29
- RUN chmod -R 777 $WORKDIR
30
 
31
- COPY requirements.txt $WORKDIR/requirements.txt
32
- RUN pip install --no-cache-dir --upgrade -r $WORKDIR/requirements.txt
33
- RUN pip install ninja
34
 
 
35
  COPY . .
36
 
37
- ARG TORCH_CUDA_ARCH_LIST=7.5+PTX
38
-
39
- USER root
40
- RUN chown -R user:user $HOME
41
- RUN chmod -R 777 $HOME
42
- RUN chown -R user:user $WORKDIR
43
- RUN chmod -R 777 $WORKDIR
44
-
45
- USER user
46
- RUN ln -s $WORKDIR/oneformer/modeling/pixel_decoder/ops/ $WORKDIR/ && ls && cd ops/ && FORCE_CUDA=1 python setup.py build --build-base=$WORKDIR/ install --user && cd ..
47
- RUN sh deform_setup.sh
48
-
49
- USER user
50
- RUN sh deform_setup.sh
51
-
52
- RUN mkdir -p examples
53
- RUN wget https://praeclarumjj3.github.io/files/ade20k.jpeg -P $WORKDIR/examples/
54
- RUN wget https://praeclarumjj3.github.io/files/cityscapes.png -P $WORKDIR/examples/
55
- RUN wget https://praeclarumjj3.github.io/files/coco.jpeg -P $WORKDIR/examples/
56
-
57
- USER user
58
-
59
- EXPOSE 7860
60
-
61
- ENTRYPOINT ["python", "gradio_app.py"]
 
1
+ FROM python:3.10
 
2
 
3
+ WORKDIR /app
 
 
 
 
 
 
 
 
 
 
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ build-essential \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install torch CPU version first
12
+ RUN pip install torch==2.0.1+cpu torchvision==0.15.2+cpu torchaudio==2.0.2+cpu \
13
+ --extra-index-url https://download.pytorch.org/whl/cpu
 
 
 
14
 
15
+ # Clone and install detectron2
16
+ RUN git clone https://github.com/facebookresearch/detectron2 && \
17
+ pip install -e detectron2
 
18
 
19
+ # Copy requirements and install
20
+ COPY requirements.txt .
21
+ RUN pip install -r requirements.txt
22
 
23
+ # Copy app files
24
  COPY . .
25
 
26
+ # Run the app
27
+ CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,12 +1,7 @@
1
- --extra-index-url https://download.pytorch.org/whl/cpu
2
 
3
  # Core dependencies - PyTorch first
4
- torch==2.0.1+cpu
5
- torchvision==0.15.2+cpu
6
- torchaudio==2.0.2+cpu
7
 
8
  # CRITICAL: Use pre-built detectron2 wheel for torch 2.0 CPU
9
- detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch2.0/index.html
10
 
11
  # Rest of your dependencies
12
  numpy>=1.23.0
 
 
1
 
2
  # Core dependencies - PyTorch first
 
 
 
3
 
4
  # CRITICAL: Use pre-built detectron2 wheel for torch 2.0 CPU
 
5
 
6
  # Rest of your dependencies
7
  numpy>=1.23.0