anas commited on
Commit
b7ae41e
·
1 Parent(s): fadb92b

Fix build: download checkpoint from HF Hub, fix CUDA compilation

Browse files

- Download checkpoint from AGLO-AI/raster2seq-checkpoints model repo
- Set TORCH_CUDA_ARCH_LIST and FORCE_CUDA for headless CUDA compilation
- Use 'build install' instead of 'build develop' for extensions
- Remove gdown dependency, add huggingface_hub

Made-with: Cursor

Files changed (1) hide show
  1. Dockerfile +7 -5
Dockerfile CHANGED
@@ -8,17 +8,19 @@ RUN useradd -m -u 1000 user
8
  WORKDIR /app
9
  COPY . /app
10
 
 
 
 
11
  RUN pip3 install torch==2.3.1 torchvision==0.18.1 \
12
  --index-url https://download.pytorch.org/whl/cu118
13
  RUN pip3 install -r requirements.txt
14
- RUN pip3 install gradio gdown
15
 
16
- RUN cd models/ops && sh make.sh && cd ../..
17
- RUN cd diff_ras && python3 setup.py build develop && cd ..
18
 
19
  RUN mkdir -p checkpoints && \
20
- gdown --fuzzy "https://drive.google.com/file/d/1M32HlYwXw-4Q_uajSCvpbF31UFPzQVHP/view?usp=sharing" \
21
- -O checkpoints/r2g_res256_ep0849.pth
22
 
23
  RUN chown -R user:user /app
24
  USER user
 
8
  WORKDIR /app
9
  COPY . /app
10
 
11
+ ENV TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6"
12
+ ENV FORCE_CUDA=1
13
+
14
  RUN pip3 install torch==2.3.1 torchvision==0.18.1 \
15
  --index-url https://download.pytorch.org/whl/cu118
16
  RUN pip3 install -r requirements.txt
17
+ RUN pip3 install gradio huggingface_hub
18
 
19
+ RUN cd models/ops && python3 setup.py build install && cd ../..
20
+ RUN cd diff_ras && python3 setup.py build install && cd ..
21
 
22
  RUN mkdir -p checkpoints && \
23
+ python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download('AGLO-AI/raster2seq-checkpoints', 'r2g_res256_ep0849.pth', local_dir='checkpoints')"
 
24
 
25
  RUN chown -R user:user /app
26
  USER user