Spaces:
Running
Running
nalin0503
commited on
Commit
·
3f0cc27
1
Parent(s):
3c73bdd
try to correct subprocess spawn and cuda 12.5.1 with cudnn 9...
Browse files- Dockerfile +49 -0
- requirements.txt +2 -2
- run_morphing.py +3 -0
Dockerfile
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use NVIDIA’s CUDA 12.5.1 with cuDNN 9 on Ubuntu 22.04
|
2 |
+
FROM nvidia/cuda:12.5.1-cudnn9-runtime-ubuntu22.04
|
3 |
+
|
4 |
+
# Set non-interactive mode for apt-get
|
5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
+
|
7 |
+
# Install system packages and add deadsnakes PPA for Python 3.12.9
|
8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
9 |
+
software-properties-common \
|
10 |
+
&& add-apt-repository ppa:deadsnakes/ppa -y \
|
11 |
+
&& apt-get update && apt-get install -y --no-install-recommends \
|
12 |
+
python3.12 \
|
13 |
+
python3.12-venv \
|
14 |
+
python3.12-dev \
|
15 |
+
python3-pip \
|
16 |
+
git \
|
17 |
+
curl \
|
18 |
+
&& rm -rf /var/lib/apt/lists/*
|
19 |
+
|
20 |
+
# Create symlinks for python and pip
|
21 |
+
RUN ln -s /usr/bin/python3.12 /usr/local/bin/python && \
|
22 |
+
ln -s /usr/bin/pip3 /usr/local/bin/pip
|
23 |
+
|
24 |
+
# Upgrade pip to the latest version
|
25 |
+
RUN pip install --upgrade pip
|
26 |
+
|
27 |
+
# Install PyTorch with CUDA 12.5 support
|
28 |
+
RUN pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu125
|
29 |
+
|
30 |
+
# Set the working directory
|
31 |
+
WORKDIR /app
|
32 |
+
|
33 |
+
# Copy requirements.txt first to leverage Docker caching
|
34 |
+
COPY requirements.txt .
|
35 |
+
|
36 |
+
# Install other Python dependencies
|
37 |
+
RUN pip install -r requirements.txt
|
38 |
+
|
39 |
+
# Copy the rest of your repository into the container
|
40 |
+
COPY . .
|
41 |
+
|
42 |
+
# Set environment variable to mitigate CUDA memory fragmentation
|
43 |
+
ENV PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
|
44 |
+
|
45 |
+
# Expose the default port for Streamlit
|
46 |
+
EXPOSE 8501
|
47 |
+
|
48 |
+
# Command to run your Streamlit app
|
49 |
+
CMD ["streamlit", "run", "app.py", "--server.enableCORS", "false"]
|
requirements.txt
CHANGED
@@ -10,8 +10,8 @@ Pillow==10.1.0
|
|
10 |
safetensors==0.4.0
|
11 |
tqdm==4.65.0
|
12 |
transformers==4.34.1
|
13 |
-
torch
|
14 |
-
torchvision
|
15 |
lpips
|
16 |
# peft
|
17 |
tensorflow==2.18.0
|
|
|
10 |
safetensors==0.4.0
|
11 |
tqdm==4.65.0
|
12 |
transformers==4.34.1
|
13 |
+
# torch
|
14 |
+
# torchvision
|
15 |
lpips
|
16 |
# peft
|
17 |
tensorflow==2.18.0
|
run_morphing.py
CHANGED
@@ -6,6 +6,9 @@ import argparse
|
|
6 |
|
7 |
from FILM import process_keyframes
|
8 |
|
|
|
|
|
|
|
9 |
def parse_arguments():
|
10 |
parser = argparse.ArgumentParser(
|
11 |
description="Orchestrate DiffMorpher || LCM-LoRa || LCM, and FILM for smooth morphing between two images.")
|
|
|
6 |
|
7 |
from FILM import process_keyframes
|
8 |
|
9 |
+
import multiprocessing as mp
|
10 |
+
mp.set_start_method("spawn", force=True)
|
11 |
+
|
12 |
def parse_arguments():
|
13 |
parser = argparse.ArgumentParser(
|
14 |
description="Orchestrate DiffMorpher || LCM-LoRa || LCM, and FILM for smooth morphing between two images.")
|