roll-ai commited on
Commit
16ac378
·
verified ·
1 Parent(s): 5d7894f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +43 -45
Dockerfile CHANGED
@@ -1,52 +1,50 @@
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
 
3
  ARG HF_TOKEN
4
  ENV HF_TOKEN=${HF_TOKEN}
5
 
 
6
  RUN python -c "import os; print('✅ HF_TOKEN set' if os.getenv('HF_TOKEN') else '❌ HF_TOKEN missing')"
7
 
8
-
9
- # # Install OS-level dependencies
10
- # RUN apt-get update && apt-get install -y \
11
- # git ffmpeg curl \
12
- # libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev \
13
- # libavutil-dev libswscale-dev libswresample-dev \
14
- # && apt-get clean
15
-
16
- # # Set working directory
17
- # WORKDIR /app
18
- # COPY . /app
19
- # RUN ls /app
20
- # # Create weights directory
21
- # # RUN mkdir -p /weights/FVSM /weights/OMSM /weights/output /weights/assets/manual_poses
22
-
23
- # # Install required Python packages
24
- # RUN pip install --upgrade pip
25
- # RUN pip install gdown
26
- # RUN pip install av huggingface_hub
27
- # RUN pip install -r requirements.txt
28
- # RUN pip install --no-binary :all: av # optional av re-install
29
- # # --------------------------
30
- # # Download ckpt weights from Hugging Face dataset (requires HF_TOKEN if private)
31
- # RUN python -c "\
32
- # from huggingface_hub import snapshot_download; \
33
- # snapshot_download(\
34
- # repo_id='roll-ai/FloVD-weights', \
35
- # repo_type='dataset', \
36
- # local_dir='/app/ckpt', \
37
- # allow_patterns='ckpt/**', \
38
- # use_auth_token=True\
39
- # )"
40
-
41
- # # --------------------------
42
- # # Download example camera pose
43
- # # --------------------------
44
- # RUN curl -L -o /weights/assets/manual_poses/example.txt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/example.txt
45
-
46
- # # Set permissions
47
- # RUN chmod -R 777 /app
48
-
49
- # EXPOSE 7860
50
-
51
- # # Start the app
52
- # CMD ["python", "app.py"]
 
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
3
+ # Accept HF token as build argument and set as environment variable
4
  ARG HF_TOKEN
5
  ENV HF_TOKEN=${HF_TOKEN}
6
 
7
+ # Debug print (you can remove this later)
8
  RUN python -c "import os; print('✅ HF_TOKEN set' if os.getenv('HF_TOKEN') else '❌ HF_TOKEN missing')"
9
 
10
+ # Install OS-level dependencies
11
+ RUN apt-get update && apt-get install -y \
12
+ git ffmpeg curl unzip \
13
+ libavformat-dev libavcodec-dev libavdevice-dev libavfilter-dev \
14
+ libavutil-dev libswscale-dev libswresample-dev \
15
+ && apt-get clean
16
+
17
+ # Set working directory
18
+ WORKDIR /app
19
+ COPY . /app
20
+ RUN ls /app
21
+
22
+ # Upgrade pip and install required Python packages
23
+ RUN pip install --upgrade pip
24
+ RUN pip install gdown av huggingface_hub
25
+ RUN pip install -r requirements.txt
26
+ RUN pip install --no-binary :all: av # optional: rebuild av from source
27
+
28
+ # Download ckpt weights from Hugging Face (private or public)
29
+ RUN python -c "\
30
+ from huggingface_hub import snapshot_download; \
31
+ snapshot_download(\
32
+ repo_id='roll-ai/FloVD-weights', \
33
+ repo_type='dataset', \
34
+ local_dir='/app/ckpt', \
35
+ allow_patterns='ckpt/**', \
36
+ token=os.getenv('HF_TOKEN')\
37
+ )"
38
+
39
+ # Download example camera pose
40
+ RUN mkdir -p /weights/assets/manual_poses
41
+ RUN curl -L -o /weights/assets/manual_poses/example.txt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/example.txt
42
+
43
+ # Set permissions (optional but helpful)
44
+ RUN chmod -R 777 /app
45
+
46
+ # Expose Gradio/Streamlit/Flask port
47
+ EXPOSE 7860
48
+
49
+ # Start the app
50
+ CMD ["python", "app.py"]