ThomasBlumet commited on
Commit
69a1d98
·
1 Parent(s): 65f5aea

update including pip and cuda version

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -46
  2. requirements.txt +2 -1
Dockerfile CHANGED
@@ -4,6 +4,9 @@ FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
4
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
 
 
 
7
  # Where we'll copy the code
8
  WORKDIR /code
9
 
@@ -11,7 +14,7 @@ WORKDIR /code
11
  COPY ./requirements.txt /code/requirements.txt
12
  # Install pip requirements
13
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
14
- RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
15
 
16
  # Creates a non-root user with an explicit UID
17
  # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
@@ -35,48 +38,3 @@ COPY --chown=user . $HOME/app
35
  EXPOSE 7860
36
  ENV GRADIO_SERVER_NAME="0.0.0.0"
37
  CMD ["python", "app.py"]
38
-
39
- ##################################################
40
- #with cuda 12.1
41
- # FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
42
-
43
- # ARG DEBIAN_FRONTEND=noninteractive
44
-
45
- # ENV PYTHONUNBUFFERED=1
46
-
47
- # RUN apt-get update && apt-get install --no-install-recommends -y \
48
- # build-essential \
49
- # python3.9 \
50
- # python3-pip \
51
- # git \
52
- # ffmpeg \
53
- # && apt-get clean && rm -rf /var/lib/apt/lists/*
54
-
55
- # WORKDIR /code
56
-
57
- # COPY ./requirements.txt /code/requirements.txt
58
-
59
- # # Set up a new user named "user" with user ID 1000
60
- # RUN useradd -m -u 1000 user
61
- # # Switch to the "user" user
62
- # USER user
63
- # # Set home to the user's home directory
64
- # ENV HOME=/home/user \
65
- # PATH=/home/user/.local/bin:$PATH \
66
- # PYTHONPATH=$HOME/app \
67
- # PYTHONUNBUFFERED=1 \
68
- # GRADIO_ALLOW_FLAGGING=never \
69
- # GRADIO_NUM_PORTS=1 \
70
- # GRADIO_SERVER_NAME=0.0.0.0 \
71
- # GRADIO_THEME=huggingface \
72
- # SYSTEM=spaces
73
-
74
- # RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
75
-
76
- # # Set the working directory to the user's home directory
77
- # WORKDIR $HOME/app
78
-
79
- # # Copy the current directory contents into the container at $HOME/app setting the owner to the user
80
- # COPY --chown=user . $HOME/app
81
-
82
- # CMD ["python3", "app.py"]
 
4
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # Install Python and pip
8
+ RUN apt-get update && apt-get install -y python3 python3-pip
9
+
10
  # Where we'll copy the code
11
  WORKDIR /code
12
 
 
14
  COPY ./requirements.txt /code/requirements.txt
15
  # Install pip requirements
16
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
17
+ #RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
18
 
19
  # Creates a non-root user with an explicit UID
20
  # For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
 
38
  EXPOSE 7860
39
  ENV GRADIO_SERVER_NAME="0.0.0.0"
40
  CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,6 +1,7 @@
1
  transformers
2
- torch
3
  gradio
 
4
  huggingface_hub
5
  optimum
6
  #for running auto-gptq
 
1
  transformers
2
+ torch=2.0.1+cu113
3
  gradio
4
+ #spaces
5
  huggingface_hub
6
  optimum
7
  #for running auto-gptq