Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +7 -19
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Use the NVIDIA CUDA runtime as a base image
|
2 |
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
|
3 |
|
4 |
# Set environment variables
|
@@ -37,8 +37,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
37 |
# Set environment variables
|
38 |
ENV HOME=/home/user \
|
39 |
CUDA_HOME=/usr/local/cuda \
|
40 |
-
LD_LIBRARY_PATH
|
41 |
-
LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH} \
|
42 |
PYTHONUNBUFFERED=1 \
|
43 |
GRADIO_ALLOW_FLAGGING=never \
|
44 |
GRADIO_NUM_PORTS=1 \
|
@@ -50,11 +49,11 @@ ENV HOME=/home/user \
|
|
50 |
# Set working directory
|
51 |
WORKDIR $HOME/app
|
52 |
|
53 |
-
# Upgrade pip and install numpy<2 first, then PyTorch
|
54 |
RUN pip install --no-cache-dir --upgrade pip && \
|
55 |
pip install --no-cache-dir "numpy<2" && \
|
56 |
-
pip install --no-cache-dir torch==1.
|
57 |
-
python -c "import torch; print('PyTorch version:', torch.__version__)"
|
58 |
|
59 |
# Clone the repository
|
60 |
RUN git clone --recursive https://github.com/jnjaby/KEEP.git .
|
@@ -65,23 +64,12 @@ COPY requirements_HF.txt .
|
|
65 |
|
66 |
# Install Python dependencies
|
67 |
RUN pip install --no-cache-dir -r requirements_HF.txt
|
68 |
-
RUN pip install --no-cache-dir gradio
|
69 |
-
|
70 |
-
# Install Cython (needed for some dependencies)
|
71 |
-
#RUN pip install --no-cache-dir cython==0.29.36
|
72 |
-
|
73 |
-
# Install basicsr with selective warnings
|
74 |
-
#RUN BASICSR_EXT=True CFLAGS="-Wno-deprecated-declarations" python basicsr/setup.py develop
|
75 |
-
|
76 |
RUN pip install basicsr
|
77 |
-
#RUN pip install gfpgan --use-pep517
|
78 |
-
|
79 |
-
# Install additional packages
|
80 |
-
RUN pip install --no-cache-dir ffmpeg-python dlib-bin
|
81 |
|
82 |
# Set CUDA device settings
|
83 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
84 |
ENV CUDA_VISIBLE_DEVICES=0
|
85 |
|
86 |
# Command to run the application
|
87 |
-
CMD ["python", "app.py"]
|
|
|
1 |
+
# Use the NVIDIA CUDA runtime as a base image (MATCHING PyTorch)
|
2 |
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
|
3 |
|
4 |
# Set environment variables
|
|
|
37 |
# Set environment variables
|
38 |
ENV HOME=/home/user \
|
39 |
CUDA_HOME=/usr/local/cuda \
|
40 |
+
LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH \
|
|
|
41 |
PYTHONUNBUFFERED=1 \
|
42 |
GRADIO_ALLOW_FLAGGING=never \
|
43 |
GRADIO_NUM_PORTS=1 \
|
|
|
49 |
# Set working directory
|
50 |
WORKDIR $HOME/app
|
51 |
|
52 |
+
# Upgrade pip and install numpy<2 first, then PyTorch (with correct CUDA version)
|
53 |
RUN pip install --no-cache-dir --upgrade pip && \
|
54 |
pip install --no-cache-dir "numpy<2" && \
|
55 |
+
pip install --no-cache-dir torch==1.10.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 && \
|
56 |
+
python -c "import torch; print('PyTorch version:', torch.__version__); print('CUDA Available:', torch.cuda.is_available()); print('Device:', torch.cuda.get_device_name(0))"
|
57 |
|
58 |
# Clone the repository
|
59 |
RUN git clone --recursive https://github.com/jnjaby/KEEP.git .
|
|
|
64 |
|
65 |
# Install Python dependencies
|
66 |
RUN pip install --no-cache-dir -r requirements_HF.txt
|
67 |
+
RUN pip install --no-cache-dir gradio ffmpeg-python dlib-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
RUN pip install basicsr
|
|
|
|
|
|
|
|
|
69 |
|
70 |
# Set CUDA device settings
|
71 |
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
72 |
ENV CUDA_VISIBLE_DEVICES=0
|
73 |
|
74 |
# Command to run the application
|
75 |
+
CMD ["python", "app.py"]
|