Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +6 -12
Dockerfile
CHANGED
|
@@ -1,13 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
|
| 4 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
-
|
| 6 |
-
# Install Python 3.9 (or any other version you need)
|
| 7 |
-
RUN apt-get install -y python3.9
|
| 8 |
-
|
| 9 |
-
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y sudo && apt-get install -y python3-pip && pip3 install --upgrade pip
|
| 10 |
-
RUN apt-get install -y curl gnupg wget htop sudo git git-lfs software-properties-common build-essential libgl1 zip unzip
|
| 11 |
|
| 12 |
# Set up a new user named "user" with user ID 1000
|
| 13 |
RUN useradd -m -u 1000 user
|
|
@@ -24,9 +17,6 @@ WORKDIR $HOME/app
|
|
| 24 |
# Clone your repository or add your code to the container
|
| 25 |
RUN git clone -b dev https://github.com/camenduru/DiffBIR $HOME/app
|
| 26 |
|
| 27 |
-
# Install PyTorch and torchvision with a specific CUDA toolkit version
|
| 28 |
-
#RUN pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
|
| 29 |
-
|
| 30 |
# Install Python dependencies
|
| 31 |
RUN pip3 install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips opencv-python
|
| 32 |
|
|
@@ -58,5 +48,9 @@ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co
|
|
| 58 |
|
| 59 |
RUN find $HOME/app
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
# Define the command to run your application
|
| 62 |
CMD ["python", "gradio_diffbir.py", "--ckpt", "/home/user/app/models/general_full_v1.ckpt", "--config", "/home/user/app/configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "/home/user/app/models/general_swinir_v1.ckpt"]
|
|
|
|
| 1 |
+
# Use an official PyTorch image with CUDA support as the base image
|
| 2 |
+
FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Set up a new user named "user" with user ID 1000
|
| 6 |
RUN useradd -m -u 1000 user
|
|
|
|
| 17 |
# Clone your repository or add your code to the container
|
| 18 |
RUN git clone -b dev https://github.com/camenduru/DiffBIR $HOME/app
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
# Install Python dependencies
|
| 21 |
RUN pip3 install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips opencv-python
|
| 22 |
|
|
|
|
| 48 |
|
| 49 |
RUN find $HOME/app
|
| 50 |
|
| 51 |
+
# Set the environment variable to specify the GPU device
|
| 52 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
| 53 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
| 54 |
+
|
| 55 |
# Define the command to run your application
|
| 56 |
CMD ["python", "gradio_diffbir.py", "--ckpt", "/home/user/app/models/general_full_v1.ckpt", "--config", "/home/user/app/configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "/home/user/app/models/general_swinir_v1.ckpt"]
|