fffiloni commited on
Commit
116c46b
·
1 Parent(s): 4ac02e3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -30
Dockerfile CHANGED
@@ -1,29 +1,5 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
- FROM python:3.9
5
-
6
- WORKDIR /code
7
-
8
- # Clone the repository
9
- RUN git clone -b dev https://github.com/camenduru/DiffBIR
10
-
11
- # Change the working directory to /content/DiffBIR
12
- WORKDIR /code/DiffBIR
13
-
14
- # Install Python dependencies
15
- RUN pip install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips
16
-
17
- # Install open_clip from GitHub
18
- RUN pip install -q git+https://github.com/mlfoundations/open_clip@v2.20.0
19
-
20
- # Install aria2
21
- RUN apt-get update && apt-get install -y aria2
22
-
23
- # Download checkpoint files using aria2
24
- RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_full_v1.ckpt -d /content/models -o general_full_v1.ckpt
25
- RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_swinir_v1.ckpt -d /content/models -o general_swinir_v1.ckpt
26
-
27
 
28
  # Set up a new user named "user" with user ID 1000
29
  RUN useradd -m -u 1000 user
@@ -38,8 +14,27 @@ ENV HOME=/home/user \
38
  # Set the working directory to the user's home directory
39
  WORKDIR $HOME/app
40
 
41
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
42
- COPY --chown=user . $HOME/app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
- # Run the Python script inside the Docker container
45
- CMD ["python", "gradio_diffbir.py", "--ckpt", "models/general_full_v1.ckpt", "--config", "configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "models/general_swinir_v1.ckpt"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  # Set up a new user named "user" with user ID 1000
5
  RUN useradd -m -u 1000 user
 
14
  # Set the working directory to the user's home directory
15
  WORKDIR $HOME/app
16
 
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 pip install -q einops pytorch_lightning gradio omegaconf xformers==0.0.20 transformers lpips
22
+
23
+ # Install Hugging Face Transformers library
24
+ RUN pip install transformers
25
+
26
+ # Install Hugging Face Datasets library (if needed)
27
+ # RUN pip install datasets
28
+
29
+ # Install other dependencies as required
30
+
31
+ # Download checkpoint files using aria2
32
+ RUN apt-get update && apt-get install -y aria2
33
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_full_v1.ckpt -d $HOME/app/models -o general_full_v1.ckpt
34
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lxq007/DiffBIR/resolve/main/general_swinir_v1.ckpt -d $HOME/app/models -o general_swinir_v1.ckpt
35
+
36
+ # Expose any necessary ports (if your application requires it)
37
+ # EXPOSE 80
38
 
39
+ # Define the command to run your application
40
+ CMD ["python", "gradio_diffbir.py", "--ckpt", "$HOME/app/models/general_full_v1.ckpt", "--config", "$HOME/app/DiffBIR/configs/model/cldm.yaml", "--reload_swinir", "--swinir_ckpt", "$HOME/app/models/general_swinir_v1.ckpt"]