samwell commited on
Commit
1c3a936
·
verified ·
1 Parent(s): 4233b79

Use public pytorch image, install cosmos-guardrail with --no-deps

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -3
Dockerfile CHANGED
@@ -1,9 +1,41 @@
1
- FROM nvcr.io/nvidia/cosmos/cosmos-predict2-container:1.2
2
 
3
  WORKDIR /app
4
 
5
- # Install API server dependencies
6
- RUN pip install --no-cache-dir fastapi uvicorn python-multipart
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  # Copy handler
9
  COPY handler.py /app/handler.py
 
1
+ FROM pytorch/pytorch:2.4.1-cuda12.1-cudnn9-runtime
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ libgl1-mesa-glx \
9
+ libglib2.0-0 \
10
+ ffmpeg \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Install cosmos-guardrail first with --no-deps to avoid version conflicts
14
+ RUN pip install --no-cache-dir cosmos-guardrail --no-deps
15
+
16
+ # Install cosmos-guardrail runtime dependencies (flexible versions)
17
+ RUN pip install --no-cache-dir \
18
+ better-profanity \
19
+ nltk \
20
+ opencv-python-headless \
21
+ retinaface-py \
22
+ scikit-image \
23
+ imageio \
24
+ "imageio-ffmpeg>=0.4.5"
25
+
26
+ # Install main dependencies
27
+ RUN pip install --no-cache-dir \
28
+ "diffusers>=0.35.0" \
29
+ "transformers>=4.47.0" \
30
+ "accelerate>=1.0.0" \
31
+ "safetensors" \
32
+ "Pillow" \
33
+ "peft>=0.17.0" \
34
+ "sentencepiece" \
35
+ "protobuf" \
36
+ "huggingface_hub>=0.27.0" \
37
+ "fastapi" \
38
+ "uvicorn"
39
 
40
  # Copy handler
41
  COPY handler.py /app/handler.py